Skip to content

Commit

Permalink
Don't clobber rax in x86_64 trampoline (JuliaLang#38882)
Browse files Browse the repository at this point in the history
rax is used to pass vararg metadata. r11 can be used for dynamic linker shenanigans between
functions. Messing with rax here can cause `jl_` to print nonsense.
  • Loading branch information
Keno authored and ElOceanografo committed May 4, 2021
1 parent b0e1bde commit b8eaecc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cli/trampolines/trampolines_x86_64.S
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ SEH_START1(name); \
name##:; \
SEH_START2(); \
CET_START(); \
mov CNAME(name##_addr)(%rip),%rax; \
jmpq *%rax; \
mov CNAME(name##_addr)(%rip),%r11; \
jmpq *%r11; \
ud2; \
SEH_END(); \
.cfi_endproc; \
Expand Down

0 comments on commit b8eaecc

Please sign in to comment.