[compiler-rt] 2f1e2a6 - [HWASan] Use ASM_WRAPPER_NAME instead of __interceptor_*
Marco Elver via llvm-commits
llvm-commits at lists.llvm.org
Wed May 24 02:58:12 PDT 2023
Author: Marco Elver
Date: 2023-05-24T11:57:18+02:00
New Revision: 2f1e2a6b1ca271b6b0dae169d1c793ffcc37c546
URL: https://github.com/llvm/llvm-project/commit/2f1e2a6b1ca271b6b0dae169d1c793ffcc37c546
DIFF: https://github.com/llvm/llvm-project/commit/2f1e2a6b1ca271b6b0dae169d1c793ffcc37c546.diff
LOG: [HWASan] Use ASM_WRAPPER_NAME instead of __interceptor_*
Use ASM_WRAPPER_NAME to produce the name of the __interceptor_*
functions.
NFC.
Reviewed By: dvyukov
Differential Revision: https://reviews.llvm.org/D151217
Added:
Modified:
compiler-rt/lib/hwasan/hwasan_setjmp_aarch64.S
compiler-rt/lib/hwasan/hwasan_setjmp_riscv64.S
compiler-rt/lib/hwasan/hwasan_setjmp_x86_64.S
Removed:
################################################################################
diff --git a/compiler-rt/lib/hwasan/hwasan_setjmp_aarch64.S b/compiler-rt/lib/hwasan/hwasan_setjmp_aarch64.S
index 744748a5101f..25bd817ae862 100644
--- a/compiler-rt/lib/hwasan/hwasan_setjmp_aarch64.S
+++ b/compiler-rt/lib/hwasan/hwasan_setjmp_aarch64.S
@@ -31,33 +31,33 @@
.section .text
.file "hwasan_setjmp_aarch64.S"
-.global __interceptor_setjmp
-ASM_TYPE_FUNCTION(__interceptor_setjmp)
-__interceptor_setjmp:
+.global ASM_WRAPPER_NAME(setjmp)
+ASM_TYPE_FUNCTION(ASM_WRAPPER_NAME(setjmp))
+ASM_WRAPPER_NAME(setjmp):
CFI_STARTPROC
BTI_C
mov x1, #0
- b __interceptor_sigsetjmp
+ b ASM_WRAPPER_NAME(sigsetjmp)
CFI_ENDPROC
-ASM_SIZE(__interceptor_setjmp)
+ASM_SIZE(ASM_WRAPPER_NAME(setjmp))
#if SANITIZER_ANDROID
// Bionic also defines a function `setjmp` that calls `sigsetjmp` saving the
// current signal.
-.global __interceptor_setjmp_bionic
-ASM_TYPE_FUNCTION(__interceptor_setjmp_bionic)
-__interceptor_setjmp_bionic:
+.global ASM_WRAPPER_NAME(setjmp_bionic)
+ASM_TYPE_FUNCTION(ASM_WRAPPER_NAME(setjmp_bionic))
+ASM_WRAPPER_NAME(setjmp_bionic):
CFI_STARTPROC
BTI_C
mov x1, #1
- b __interceptor_sigsetjmp
+ b ASM_WRAPPER_NAME(sigsetjmp)
CFI_ENDPROC
-ASM_SIZE(__interceptor_setjmp_bionic)
+ASM_SIZE(ASM_WRAPPER_NAME(setjmp_bionic))
#endif
-.global __interceptor_sigsetjmp
-ASM_TYPE_FUNCTION(__interceptor_sigsetjmp)
-__interceptor_sigsetjmp:
+.global ASM_WRAPPER_NAME(sigsetjmp)
+ASM_TYPE_FUNCTION(ASM_WRAPPER_NAME(sigsetjmp))
+ASM_WRAPPER_NAME(sigsetjmp):
CFI_STARTPROC
BTI_C
stp x19, x20, [x0, #0<<3]
@@ -77,7 +77,7 @@ __interceptor_sigsetjmp:
// This function is defined in hwasan_interceptors.cc
b __sigjmp_save
CFI_ENDPROC
-ASM_SIZE(__interceptor_sigsetjmp)
+ASM_SIZE(ASM_WRAPPER_NAME(sigsetjmp))
.macro WEAK_ALIAS first second
@@ -86,13 +86,13 @@ ASM_SIZE(__interceptor_sigsetjmp)
.endm
#if SANITIZER_ANDROID
-WEAK_ALIAS __interceptor_sigsetjmp, sigsetjmp
-WEAK_ALIAS __interceptor_setjmp_bionic, setjmp
+WEAK_ALIAS ASM_WRAPPER_NAME(sigsetjmp), sigsetjmp
+WEAK_ALIAS ASM_WRAPPER_NAME(setjmp_bionic), setjmp
#else
-WEAK_ALIAS __interceptor_sigsetjmp, __sigsetjmp
+WEAK_ALIAS ASM_WRAPPER_NAME(sigsetjmp), __sigsetjmp
#endif
-WEAK_ALIAS __interceptor_setjmp, _setjmp
+WEAK_ALIAS ASM_WRAPPER_NAME(setjmp), _setjmp
#endif
// We do not need executable stack.
diff --git a/compiler-rt/lib/hwasan/hwasan_setjmp_riscv64.S b/compiler-rt/lib/hwasan/hwasan_setjmp_riscv64.S
index 43f9c3c26b4e..40cf6450b93b 100644
--- a/compiler-rt/lib/hwasan/hwasan_setjmp_riscv64.S
+++ b/compiler-rt/lib/hwasan/hwasan_setjmp_riscv64.S
@@ -31,18 +31,18 @@
.section .text
.file "hwasan_setjmp_riscv64.S"
-.global __interceptor_setjmp
-ASM_TYPE_FUNCTION(__interceptor_setjmp)
-__interceptor_setjmp:
+.global ASM_WRAPPER_NAME(setjmp)
+ASM_TYPE_FUNCTION(ASM_WRAPPER_NAME(setjmp))
+ASM_WRAPPER_NAME(setjmp):
CFI_STARTPROC
addi x11, x0, 0
- tail __interceptor_sigsetjmp
+ tail ASM_WRAPPER_NAME(sigsetjmp)
CFI_ENDPROC
-ASM_SIZE(__interceptor_setjmp)
+ASM_SIZE(ASM_WRAPPER_NAME(setjmp))
-.global __interceptor_sigsetjmp
-ASM_TYPE_FUNCTION(__interceptor_sigsetjmp)
-__interceptor_sigsetjmp:
+.global ASM_WRAPPER_NAME(sigsetjmp)
+ASM_TYPE_FUNCTION(ASN_WRAPPER_NAME(sigsetjmp))
+ASM_WRAPPER_NAME(sigsetjmp):
CFI_STARTPROC
sd ra, 0<<3(x10)
sd s0, 1<<3(x10)
@@ -80,7 +80,7 @@ __interceptor_sigsetjmp:
// This function is defined in hwasan_interceptors.cc
tail __sigjmp_save
CFI_ENDPROC
-ASM_SIZE(__interceptor_sigsetjmp)
+ASM_SIZE(ASM_WRAPPER_NAME(sigsetjmp))
.macro WEAK_ALIAS first second
@@ -88,9 +88,9 @@ ASM_SIZE(__interceptor_sigsetjmp)
.equ \second\(), \first
.endm
-WEAK_ALIAS __interceptor_sigsetjmp, __sigsetjmp
+WEAK_ALIAS ASM_WRAPPER_NAME(sigsetjmp), __sigsetjmp
-WEAK_ALIAS __interceptor_setjmp, _setjmp
+WEAK_ALIAS ASM_WRAPPER_NAME(setjmp), _setjmp
#endif
// We do not need executable stack.
diff --git a/compiler-rt/lib/hwasan/hwasan_setjmp_x86_64.S b/compiler-rt/lib/hwasan/hwasan_setjmp_x86_64.S
index a5a3858d94dc..b2c4c50f2fbc 100644
--- a/compiler-rt/lib/hwasan/hwasan_setjmp_x86_64.S
+++ b/compiler-rt/lib/hwasan/hwasan_setjmp_x86_64.S
@@ -31,19 +31,19 @@
.section .text
.file "hwasan_setjmp_x86_64.S"
-.global __interceptor_setjmp
-ASM_TYPE_FUNCTION(__interceptor_setjmp)
-__interceptor_setjmp:
+.global ASM_WRAPPER_NAME(setjmp)
+ASM_TYPE_FUNCTION(ASM_WRAPPER_NAME(setjmp))
+ASM_WRAPPER_NAME(setjmp):
CFI_STARTPROC
_CET_ENDBR
xorl %esi, %esi
jmp .Linterceptor_sigsetjmp
CFI_ENDPROC
-ASM_SIZE(__interceptor_setjmp)
+ASM_SIZE(ASM_WRAPPER_NAME(setjmp))
-.global __interceptor_sigsetjmp
-ASM_TYPE_FUNCTION(__interceptor_sigsetjmp)
-__interceptor_sigsetjmp:
+.global ASM_WRAPPER_NAME(sigsetjmp)
+ASM_TYPE_FUNCTION(ASM_WRAPPER_NAME(sigsetjmp))
+ASM_WRAPPER_NAME(sigsetjmp):
.Linterceptor_sigsetjmp:
CFI_STARTPROC
_CET_ENDBR
@@ -67,7 +67,7 @@ __interceptor_sigsetjmp:
jmp __sigjmp_save
CFI_ENDPROC
-ASM_SIZE(__interceptor_sigsetjmp)
+ASM_SIZE(ASM_WRAPPER_NAME(sigsetjmp))
.macro WEAK_ALIAS first second
@@ -75,8 +75,8 @@ ASM_SIZE(__interceptor_sigsetjmp)
.equ \second\(), \first
.endm
-WEAK_ALIAS __interceptor_sigsetjmp, __sigsetjmp
-WEAK_ALIAS __interceptor_setjmp, _setjmp
+WEAK_ALIAS ASM_WRAPPER_NAME(sigsetjmp), __sigsetjmp
+WEAK_ALIAS ASM_WRAPPER_NAME(setjmp), _setjmp
#endif
// We do not need executable stack.
More information about the llvm-commits
mailing list