https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112562
--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> --- So does this fix it? 2023-11-20 Jakub Jelinek <ja...@redhat.com> PR sanitizer/112562 * sanitizer_common/sanitizer_asm.h (ASM_TYPE_FUNCTION): Use @function rather than %function except on arm/aarch64. * interception/interception.h (ASM_TYPE_FUNCTION_STR): Define. (DECLARE_WRAPPER): Use it instead of hardcoding %function. --- libsanitizer/sanitizer_common/sanitizer_asm.h.jj 2023-11-15 17:19:11.507783822 +0100 +++ libsanitizer/sanitizer_common/sanitizer_asm.h 2023-11-20 18:16:48.740201609 +0100 @@ -62,7 +62,11 @@ #if !defined(__APPLE__) # define ASM_HIDDEN(symbol) .hidden symbol -# define ASM_TYPE_FUNCTION(symbol) .type symbol, %function +# if defined(__arm__) || defined(__aarch64__) +# define ASM_TYPE_FUNCTION(symbol) .type symbol, %function +# else +# define ASM_TYPE_FUNCTION(symbol) .type symbol, @function +# endif # define ASM_SIZE(symbol) .size symbol, .-symbol # define ASM_SYMBOL(symbol) symbol # define ASM_SYMBOL_INTERCEPTOR(symbol) symbol --- libsanitizer/interception/interception.h.jj 2023-11-15 17:19:11.505783850 +0100 +++ libsanitizer/interception/interception.h 2023-11-20 18:16:48.736201664 +0100 @@ -185,6 +185,11 @@ const interpose_substitution substitutio # else # define __ASM_WEAK_WRAPPER(func) ".weak " #func "\n" # endif // SANITIZER_FREEBSD || SANITIZER_NETBSD +# if defined(__arm__) || defined(__aarch64__) +# define ASM_TYPE_FUNCTION_STR "%function" +# else +# define ASM_TYPE_FUNCTION_STR "@function" +# endif // Keep trampoline implementation in sync with sanitizer_common/sanitizer_asm.h # define DECLARE_WRAPPER(ret_type, func, ...) \ extern "C" ret_type func(__VA_ARGS__); \ @@ -196,7 +201,8 @@ const interpose_substitution substitutio __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)) ", " \ + ASM_TYPE_FUNCTION_STR "\n" \ SANITIZER_STRINGIFY(TRAMPOLINE(func)) ":\n" \ SANITIZER_STRINGIFY(CFI_STARTPROC) "\n" \ SANITIZER_STRINGIFY(ASM_TAIL_CALL) " __interceptor_" \