[compiler-rt] r365244 - Revert "[TSan] Improve handling of stack pointer mangling in {set, long}jmp, pt.4"
Julian Lettner via llvm-commits
llvm-commits at lists.llvm.org
Fri Jul 5 14:03:46 PDT 2019
Author: yln
Date: Fri Jul 5 14:03:46 2019
New Revision: 365244
URL: http://llvm.org/viewvc/llvm-project?rev=365244&view=rev
Log:
Revert "[TSan] Improve handling of stack pointer mangling in {set,long}jmp, pt.4"
This reverts commit 6bb13da7c16f2a677cc285bb6ffeb79dfb0cfe64.
Modified:
compiler-rt/trunk/lib/tsan/rtl/tsan_rtl_amd64.S
Modified: compiler-rt/trunk/lib/tsan/rtl/tsan_rtl_amd64.S
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/tsan/rtl/tsan_rtl_amd64.S?rev=365244&r1=365243&r2=365244&view=diff
==============================================================================
--- compiler-rt/trunk/lib/tsan/rtl/tsan_rtl_amd64.S (original)
+++ compiler-rt/trunk/lib/tsan/rtl/tsan_rtl_amd64.S Fri Jul 5 14:03:46 2019
@@ -271,16 +271,30 @@ ASM_SYMBOL_INTERCEPTOR(sigsetjmp):
push %rdi
CFI_ADJUST_CFA_OFFSET(8)
CFI_REL_OFFSET(%rdi, 0)
+ // save savesigs parameter
+ push %rsi
+ CFI_ADJUST_CFA_OFFSET(8)
+ CFI_REL_OFFSET(%rsi, 0)
+ // align stack frame
+ sub $8, %rsp
+ CFI_ADJUST_CFA_OFFSET(8)
// obtain SP, store in %rdi, first argument to `void __tsan_setjmp(uptr sp)`
#if defined(__FreeBSD__) || defined(__NetBSD__)
- lea 8(%rsp), %rdi
+ lea 24(%rsp), %rdi
#elif defined(__linux__) || defined(__APPLE__)
- lea 16(%rsp), %rdi
+ lea 32(%rsp), %rdi
#else
# error "Unknown platform"
#endif
// call tsan interceptor
call ASM_SYMBOL(__tsan_setjmp)
+ // unalign stack frame
+ add $8, %rsp
+ CFI_ADJUST_CFA_OFFSET(-8)
+ // restore savesigs parameter
+ pop %rsi
+ CFI_ADJUST_CFA_OFFSET(-8)
+ CFI_RESTORE(%rsi)
// restore env parameter
pop %rdi
CFI_ADJUST_CFA_OFFSET(-8)
@@ -313,14 +327,28 @@ ASM_SYMBOL_INTERCEPTOR(__sigsetjmp):
push %rdi
CFI_ADJUST_CFA_OFFSET(8)
CFI_REL_OFFSET(%rdi, 0)
+ // save savesigs parameter
+ push %rsi
+ CFI_ADJUST_CFA_OFFSET(8)
+ CFI_REL_OFFSET(%rsi, 0)
+ // align stack frame
+ sub $8, %rsp
+ CFI_ADJUST_CFA_OFFSET(8)
// obtain SP, store in %rdi, first argument to `void __tsan_setjmp(uptr sp)`
#if defined(__FreeBSD__)
- lea 8(%rsp), %rdi
+ lea 24(%rsp), %rdi
#else
- lea 16(%rsp), %rdi
+ lea 32(%rsp), %rdi
#endif
// call tsan interceptor
call ASM_SYMBOL(__tsan_setjmp)
+ // unalign stack frame
+ add $8, %rsp
+ CFI_ADJUST_CFA_OFFSET(-8)
+ // restore savesigs parameter
+ pop %rsi
+ CFI_ADJUST_CFA_OFFSET(-8)
+ CFI_RESTORE(%rsi)
// restore env parameter
pop %rdi
CFI_ADJUST_CFA_OFFSET(-8)
More information about the llvm-commits
mailing list