summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulian Lettner <jlettner@apple.com>2019-07-05 18:00:16 +0000
committerJulian Lettner <jlettner@apple.com>2019-07-05 18:00:16 +0000
commit72690297e9740bd76a8c946fb831dd56e8bd12a4 (patch)
treedfa5b02b6fe4ab97e31484455e4eff919ba1561e
parent7cc9cd069b244b4d57df46c0087d0adc53179c26 (diff)
downloadcompiler-rt-72690297e9740bd76a8c946fb831dd56e8bd12a4.tar.gz
[TSan] Improve handling of stack pointer mangling in {set,long}jmp, pt.5
Remove unnecessary computation of mangled SP for ARM64 architecture. Reviewed By: dvyukov Differential Revision: https://reviews.llvm.org/D64022 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@365230 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/tsan/rtl/tsan_rtl_aarch64.S43
1 files changed, 4 insertions, 39 deletions
diff --git a/lib/tsan/rtl/tsan_rtl_aarch64.S b/lib/tsan/rtl/tsan_rtl_aarch64.S
index 7a9a03d1d..93948e953 100644
--- a/lib/tsan/rtl/tsan_rtl_aarch64.S
+++ b/lib/tsan/rtl/tsan_rtl_aarch64.S
@@ -105,18 +105,8 @@ ASM_SYMBOL_INTERCEPTOR(setjmp):
CFI_OFFSET (19, -16)
mov x19, x0
-#if !defined(__APPLE__)
- // SP pointer mangling (see glibc setjmp)
- adrp x2, __tsan_pointer_chk_guard
- ldr x2, [x2, #:lo12:__tsan_pointer_chk_guard]
- add x0, x29, 32
- eor x1, x2, x0
-#else
- adrp x2, ___tsan_darwin_setjmp_xor_key@page
- ldr x2, [x2, ___tsan_darwin_setjmp_xor_key@pageoff]
+ // Obtain SP, first argument to `void __tsan_setjmp(uptr sp)`
add x0, x29, 32
- eor x1, x2, x0
-#endif
// call tsan interceptor
bl ASM_SYMBOL(__tsan_setjmp)
@@ -165,18 +155,8 @@ ASM_SYMBOL_INTERCEPTOR(_setjmp):
CFI_OFFSET (19, -16)
mov x19, x0
-#if !defined(__APPLE__)
- // SP pointer mangling (see glibc setjmp)
- adrp x2, __tsan_pointer_chk_guard
- ldr x2, [x2, #:lo12:__tsan_pointer_chk_guard]
- add x0, x29, 32
- eor x1, x2, x0
-#else
- adrp x2, ___tsan_darwin_setjmp_xor_key@page
- ldr x2, [x2, ___tsan_darwin_setjmp_xor_key@pageoff]
+ // Obtain SP, first argument to `void __tsan_setjmp(uptr sp)`
add x0, x29, 32
- eor x1, x2, x0
-#endif
// call tsan interceptor
bl ASM_SYMBOL(__tsan_setjmp)
@@ -227,18 +207,8 @@ ASM_SYMBOL_INTERCEPTOR(sigsetjmp):
mov w20, w1
mov x19, x0
-#if !defined(__APPLE__)
- // SP pointer mangling (see glibc setjmp)
- adrp x2, __tsan_pointer_chk_guard
- ldr x2, [x2, #:lo12:__tsan_pointer_chk_guard]
- add x0, x29, 32
- eor x1, x2, x0
-#else
- adrp x2, ___tsan_darwin_setjmp_xor_key@page
- ldr x2, [x2, ___tsan_darwin_setjmp_xor_key@pageoff]
+ // Obtain SP, first argument to `void __tsan_setjmp(uptr sp)`
add x0, x29, 32
- eor x1, x2, x0
-#endif
// call tsan interceptor
bl ASM_SYMBOL(__tsan_setjmp)
@@ -292,13 +262,8 @@ ASM_SYMBOL_INTERCEPTOR(__sigsetjmp):
mov w20, w1
mov x19, x0
-#if !defined(__APPLE__)
- // SP pointer mangling (see glibc setjmp)
- adrp x2, __tsan_pointer_chk_guard
- ldr x2, [x2, #:lo12:__tsan_pointer_chk_guard]
+ // Obtain SP, first argument to `void __tsan_setjmp(uptr sp)`
add x0, x29, 32
- eor x1, x2, x0
-#endif
// call tsan interceptor
bl ASM_SYMBOL(__tsan_setjmp)