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 @@ -2,6 +2,7 @@ #if defined(__aarch64__) #include "sanitizer_common/sanitizer_asm.h" +#include "builtins/assembly.h" #if defined(__APPLE__) .align 2 @@ -38,6 +39,10 @@ ASM_TYPE_FUNCTION(ASM_SYMBOL_INTERCEPTOR(setjmp)) ASM_SYMBOL_INTERCEPTOR(setjmp): CFI_STARTPROC +#if PAC_FLAG + hint #25 // paciasp + .CFI_NEGATE_RA_STATE +#endif // Save frame/link register stp x29, x30, [sp, -32]! @@ -68,6 +73,10 @@ CFI_RESTORE (29) CFI_RESTORE (30) CFI_DEF_CFA (31, 0) +#if PAC_FLAG + hint #29 // autiasp + .CFI_NEGATE_RA_STATE +#endif // tail jump to libc setjmp #if !defined(__APPLE__) @@ -89,7 +98,10 @@ ASM_TYPE_FUNCTION(ASM_SYMBOL_INTERCEPTOR(_setjmp)) ASM_SYMBOL_INTERCEPTOR(_setjmp): CFI_STARTPROC - +#if PAC_FLAG + hint #25 // paciasp + .CFI_NEGATE_RA_STATE +#endif // Save frame/link register stp x29, x30, [sp, -32]! CFI_DEF_CFA_OFFSET (32) @@ -119,7 +131,10 @@ CFI_RESTORE (29) CFI_RESTORE (30) CFI_DEF_CFA (31, 0) - +#if PAC_FLAG + hint #29 // autiasp + .CFI_NEGATE_RA_STATE +#endif // tail jump to libc setjmp #if !defined(__APPLE__) adrp x1, :got:_ZN14__interception12real__setjmpE @@ -140,7 +155,10 @@ ASM_TYPE_FUNCTION(ASM_SYMBOL_INTERCEPTOR(sigsetjmp)) ASM_SYMBOL_INTERCEPTOR(sigsetjmp): CFI_STARTPROC - +#if PAC_FLAG + hint #25 // paciasp + .CFI_NEGATE_RA_STATE +#endif // Save frame/link register stp x29, x30, [sp, -32]! CFI_DEF_CFA_OFFSET (32) @@ -172,7 +190,10 @@ CFI_RESTORE (29) CFI_RESTORE (30) CFI_DEF_CFA (31, 0) - +#if PAC_FLAG + hint #29 // autiasp + .CFI_NEGATE_RA_STATE +#endif // tail jump to libc sigsetjmp #if !defined(__APPLE__) adrp x2, :got:_ZN14__interception14real_sigsetjmpE @@ -193,7 +214,10 @@ ASM_TYPE_FUNCTION(ASM_SYMBOL_INTERCEPTOR(__sigsetjmp)) ASM_SYMBOL_INTERCEPTOR(__sigsetjmp): CFI_STARTPROC - +#if PAC_FLAG + hint #25 // paciasp + .CFI_NEGATE_RA_STATE +#endif // Save frame/link register stp x29, x30, [sp, -32]! CFI_DEF_CFA_OFFSET (32) @@ -225,7 +249,10 @@ CFI_RESTORE (29) CFI_RESTORE (30) CFI_DEF_CFA (31, 0) - +#if PAC_FLAG + hint #29 // autiasp + .CFI_NEGATE_RA_STATE +#endif // tail jump to libc __sigsetjmp #if !defined(__APPLE__) adrp x2, :got:_ZN14__interception16real___sigsetjmpE @@ -242,4 +269,6 @@ NO_EXEC_STACK_DIRECTIVE +GNU_PROPERTY_BTI_PAC + #endif