summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDean Michael Berris <dberris@google.com>2018-08-28 10:32:50 +0000
committerDean Michael Berris <dberris@google.com>2018-08-28 10:32:50 +0000
commitbb6aa92c311cbd5b290604125e7dc145974456fd (patch)
tree4c8572d2c9232a25859147b1338d77b6b75771c0
parent6a5c01c7e98f27834da0335a1ff96ec99872e18b (diff)
downloadbcm5719-llvm-bb6aa92c311cbd5b290604125e7dc145974456fd.tar.gz
bcm5719-llvm-bb6aa92c311cbd5b290604125e7dc145974456fd.zip
[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 llvm-svn: 340812
-rw-r--r--compiler-rt/lib/xray/xray_trampoline_x86_64.S2
1 files changed, 2 insertions, 0 deletions
diff --git a/compiler-rt/lib/xray/xray_trampoline_x86_64.S b/compiler-rt/lib/xray/xray_trampoline_x86_64.S
index 99ad3966ee3..9dffae04821 100644
--- a/compiler-rt/lib/xray/xray_trampoline_x86_64.S
+++ b/compiler-rt/lib/xray/xray_trampoline_x86_64.S
@@ -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
OpenPOWER on IntegriCloud