[compiler-rt] 85d3873 - Fix "[compiler-rt] Allow 3 simultaneous interceptors on Linux"

Marco Elver via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 9 03:14:57 PDT 2023


Author: Marco Elver
Date: 2023-06-09T12:14:45+02:00
New Revision: 85d3873a45f9977f868723a221ebcb35100cac22

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

LOG: Fix "[compiler-rt] Allow 3 simultaneous interceptors on Linux"

Fix inline asm trampoline type. Some architectures will complain:

<inline asm>:8:41: error: expected STT_<TYPE_IN_UPPER_CASE>, '#<type>', '%<type>' or "<type>"
    8 | .type  __interceptor_trampoline_malloc, @function

Just use %function instead, which is what is also used in
sanitizer_asm.h

Added: 
    

Modified: 
    compiler-rt/lib/interception/interception.h

Removed: 
    


################################################################################
diff  --git a/compiler-rt/lib/interception/interception.h b/compiler-rt/lib/interception/interception.h
index 3ae698fb9ae11..078d33b61be31 100644
--- a/compiler-rt/lib/interception/interception.h
+++ b/compiler-rt/lib/interception/interception.h
@@ -196,7 +196,7 @@ const interpose_substitution substitution_##func_name[]             \
        __ASM_WEAK_WRAPPER(func)                                                \
        ".set " #func ", " SANITIZER_STRINGIFY(TRAMPOLINE(func)) "\n"           \
        ".globl " SANITIZER_STRINGIFY(TRAMPOLINE(func)) "\n"                    \
-       ".type  " SANITIZER_STRINGIFY(TRAMPOLINE(func)) ", @function\n"         \
+       ".type  " SANITIZER_STRINGIFY(TRAMPOLINE(func)) ", %function\n"         \
        SANITIZER_STRINGIFY(TRAMPOLINE(func)) ":\n"                             \
        SANITIZER_STRINGIFY(CFI_STARTPROC) "\n"                                 \
        SANITIZER_STRINGIFY(ASM_TAIL_CALL) " __interceptor_"                    \


        


More information about the llvm-commits mailing list