[compiler-rt] dc9c411 - [hwasan] Replace j __interceptor_sigsetjmp instead with tail for RISC-V

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 13 17:44:43 PST 2023


Author: Khem Raj
Date: 2023-01-13T17:44:38-08:00
New Revision: dc9c41125caa07b4f4ad0b6cb3348b499dbcf3a5

URL: https://github.com/llvm/llvm-project/commit/dc9c41125caa07b4f4ad0b6cb3348b499dbcf3a5
DIFF: https://github.com/llvm/llvm-project/commit/dc9c41125caa07b4f4ad0b6cb3348b499dbcf3a5.diff

LOG: [hwasan] Replace j __interceptor_sigsetjmp instead with tail for RISC-V

R_RISCV_JAL referencing a preemptible symbol is disallowed with ld.lld and binutils 2.40 (https://sourceware.org/PR28509)

    riscv64-yoe-linux-ld: relocation R_RISCV_JAL against `__interceptor_sigsetjmp' which may bind externally can not be used when making a shared object; recompile with -fPIC

Reviewed By: kito-cheng, MaskRay

Differential Revision: https://reviews.llvm.org/D141656

Added: 
    

Modified: 
    compiler-rt/lib/hwasan/hwasan_setjmp_riscv64.S

Removed: 
    


################################################################################
diff  --git a/compiler-rt/lib/hwasan/hwasan_setjmp_riscv64.S b/compiler-rt/lib/hwasan/hwasan_setjmp_riscv64.S
index f33c4916df130..43f9c3c26b4e0 100644
--- a/compiler-rt/lib/hwasan/hwasan_setjmp_riscv64.S
+++ b/compiler-rt/lib/hwasan/hwasan_setjmp_riscv64.S
@@ -36,7 +36,7 @@ ASM_TYPE_FUNCTION(__interceptor_setjmp)
 __interceptor_setjmp:
   CFI_STARTPROC
   addi x11, x0, 0
-  j    __interceptor_sigsetjmp
+  tail __interceptor_sigsetjmp
   CFI_ENDPROC
 ASM_SIZE(__interceptor_setjmp)
 


        


More information about the llvm-commits mailing list