[PATCH] D64023: [TSan] Improve handling of stack pointer mangling in {set,long}jmp, pt.6
Julian Lettner via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Jul 1 10:49:05 PDT 2019
yln created this revision.
yln added a reviewer: dvyukov.
Herald added subscribers: llvm-commits, Sanitizers, javed.absar, kubamracek.
Herald added projects: Sanitizers, LLVM.
Since we don't clobber x1/w1 (2nd argument) anymore, we don't have to
save/restore it.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D64023
Files:
compiler-rt/lib/tsan/rtl/tsan_rtl_aarch64.S
Index: compiler-rt/lib/tsan/rtl/tsan_rtl_aarch64.S
===================================================================
--- compiler-rt/lib/tsan/rtl/tsan_rtl_aarch64.S
+++ compiler-rt/lib/tsan/rtl/tsan_rtl_aarch64.S
@@ -123,8 +123,9 @@
mov x0, x19
ldr x19, [sp, 16]
ldp x29, x30, [sp], 32
- CFI_RESTORE (30)
CFI_RESTORE (19)
+ CFI_RESTORE (29)
+ CFI_RESTORE (30)
CFI_DEF_CFA (31, 0)
// tail jump to libc setjmp
@@ -173,8 +174,9 @@
mov x0, x19
ldr x19, [sp, 16]
ldp x29, x30, [sp], 32
- CFI_RESTORE (30)
CFI_RESTORE (19)
+ CFI_RESTORE (29)
+ CFI_RESTORE (30)
CFI_DEF_CFA (31, 0)
// tail jump to libc setjmp
@@ -208,11 +210,9 @@
add x29, sp, 0
CFI_DEF_CFA_REGISTER (29)
- // Save jmp_buf and savesigs
- stp x19, x20, [sp, 16]
+ // Save jmp_buf
+ str x19, [sp, 16]
CFI_OFFSET (19, -16)
- CFI_OFFSET (20, -8)
- mov w20, w1
mov x19, x0
// Obtain SP, first argument to `void __tsan_setjmp(uptr sp)`
@@ -222,14 +222,12 @@
bl ASM_SYMBOL(__tsan_setjmp)
// restore env parameter
- mov w1, w20
mov x0, x19
- ldp x19, x20, [sp, 16]
+ ldr x19, [sp, 16]
ldp x29, x30, [sp], 32
- CFI_RESTORE (30)
- CFI_RESTORE (29)
CFI_RESTORE (19)
- CFI_RESTORE (20)
+ CFI_RESTORE (29)
+ CFI_RESTORE (30)
CFI_DEF_CFA (31, 0)
// tail jump to libc sigsetjmp
@@ -263,11 +261,9 @@
add x29, sp, 0
CFI_DEF_CFA_REGISTER (29)
- // Save jmp_buf and savesigs
- stp x19, x20, [sp, 16]
+ // Save jmp_buf
+ str x19, [sp, 16]
CFI_OFFSET (19, -16)
- CFI_OFFSET (20, -8)
- mov w20, w1
mov x19, x0
// Obtain SP, first argument to `void __tsan_setjmp(uptr sp)`
@@ -276,14 +272,13 @@
// call tsan interceptor
bl ASM_SYMBOL(__tsan_setjmp)
- mov w1, w20
+ // restore env parameter
mov x0, x19
- ldp x19, x20, [sp, 16]
+ ldr x19, [sp, 16]
ldp x29, x30, [sp], 32
- CFI_RESTORE (30)
- CFI_RESTORE (29)
CFI_RESTORE (19)
- CFI_RESTORE (20)
+ CFI_RESTORE (29)
+ CFI_RESTORE (30)
CFI_DEF_CFA (31, 0)
// tail jump to libc __sigsetjmp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D64023.207376.patch
Type: text/x-patch
Size: 2151 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190701/7956a912/attachment.bin>
More information about the llvm-commits
mailing list