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.

(cherry picked from commit b376982)
  • Loading branch information
Keno authored and KristofferC committed Dec 17, 2020
1 parent 3ba80c6 commit 3b18f1a
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 3b18f1a

Please sign in to comment.