Skip to content

Commit

Permalink
Don't clobber rax in x86_64 trampoline (#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 Dec 15, 2020
1 parent 8d80154 commit b376982
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 b376982

Please sign in to comment.