[compiler-rt] r340812 - [XRay][compiler-rt] Stash flags as well in x86_64 trampoline
Dean Michael Berris via llvm-commits
llvm-commits at lists.llvm.org
Tue Aug 28 03:32:50 PDT 2018
Author: dberris
Date: Tue Aug 28 03:32:50 2018
New Revision: 340812
URL: http://llvm.org/viewvc/llvm-project?rev=340812&view=rev
Log:
[XRay][compiler-rt] Stash flags as well in x86_64 trampoline
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
Modified:
compiler-rt/trunk/lib/xray/xray_trampoline_x86_64.S
Modified: compiler-rt/trunk/lib/xray/xray_trampoline_x86_64.S
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/xray/xray_trampoline_x86_64.S?rev=340812&r1=340811&r2=340812&view=diff
==============================================================================
--- compiler-rt/trunk/lib/xray/xray_trampoline_x86_64.S (original)
+++ compiler-rt/trunk/lib/xray/xray_trampoline_x86_64.S Tue Aug 28 03:32:50 2018
@@ -19,6 +19,7 @@
.macro SAVE_REGISTERS
+ pushfq
subq $240, %rsp
CFI_DEF_CFA_OFFSET(248)
movq %rbp, 232(%rsp)
@@ -69,6 +70,7 @@
movq 8(%rsp), %r14
movq 0(%rsp), %r15
addq $240, %rsp
+ popfq
CFI_DEF_CFA_OFFSET(8)
.endm
More information about the llvm-commits
mailing list