Skip to content

Commit

Permalink
[XRay][compiler-rt] Stash flags as well in x86_64 trampoline
Browse files Browse the repository at this point in the history
Summary:
This change saves and restores the full flags register in x86_64 mode.
This makes running instrumented signal handlers safer, and avoids flags
set during the execution of the event handlers from polluting the
instrumented call's flags state.

Reviewers: kpw, eizan, jfb

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D51277

llvm-svn: 340812
  • Loading branch information
deanberris committed Aug 28, 2018
1 parent 6a5c01c commit bb6aa92
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions compiler-rt/lib/xray/xray_trampoline_x86_64.S
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@


.macro SAVE_REGISTERS
pushfq
subq $240, %rsp
CFI_DEF_CFA_OFFSET(248)
movq %rbp, 232(%rsp)
Expand Down Expand Up @@ -69,6 +70,7 @@
movq 8(%rsp), %r14
movq 0(%rsp), %r15
addq $240, %rsp
popfq
CFI_DEF_CFA_OFFSET(8)
.endm

Expand Down

0 comments on commit bb6aa92

Please sign in to comment.