From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1944) id 7371A385E452; Wed, 14 Feb 2024 15:36:02 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7371A385E452 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1707924962; bh=MVVXu/k2Ue5BMfrWn6j7ipYNFQ2lZ1ZneUsvYJniYNo=; h=From:To:Subject:Date:From; b=vKMpmyezDn5+3Q4Zv2m/WVK4GsLtBYzglKAimqrfB+ZcMaXLrc6HEqOyXcDwzyU9p +UJUz7dOEIrBXjDxPmE+suzIutmPSxF42x2+Ac9d1L6/rQLTrA6z9JZIqu0+r2/N2S 4dmRVbeF7b0Gn3sxfeE10PyjK8uftkfT98bpQ97w= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Szabolcs Nagy To: gcc-cvs@gcc.gnu.org Subject: [gcc(refs/vendors/ARM/heads/gcs-13)] Ifdef `.hidden`, `.type`, and `.size` pseudo-ops for `aarch64-w64-mingw32` target X-Act-Checkin: gcc X-Git-Author: Zac Walker X-Git-Refname: refs/vendors/ARM/heads/gcs-13 X-Git-Oldrev: f05df91eade6cce802483c262f3bbcae978ff28d X-Git-Newrev: e72cc96a2efe69e91875b076ae174aac8289310c Message-Id: <20240214153602.7371A385E452@sourceware.org> Date: Wed, 14 Feb 2024 15:36:02 +0000 (GMT) List-Id: https://gcc.gnu.org/g:e72cc96a2efe69e91875b076ae174aac8289310c commit e72cc96a2efe69e91875b076ae174aac8289310c Author: Zac Walker Date: Tue Jan 23 15:32:30 2024 +0000 Ifdef `.hidden`, `.type`, and `.size` pseudo-ops for `aarch64-w64-mingw32` target Recent change (https://gcc.gnu.org/pipermail/gcc-cvs/2023-December/394915.html) added a generic SME support using `.hidden`, `.type`, and ``.size` pseudo-ops in the assembly sources, `aarch64-w64-mingw32` does not support the pseudo-ops though. This patch wraps usage of those pseudo-ops using macros and ifdefs them for `__ELF__` define. libgcc/ * config/aarch64/aarch64-asm.h (HIDDEN, SYMBOL_SIZE, SYMBOL_TYPE) (ENTRY_ALIGN, GNU_PROPERTY): New macros. * config/aarch64/__arm_sme_state.S: Use them. * config/aarch64/__arm_tpidr2_save.S: Likewise. * config/aarch64/__arm_za_disable.S: Likewise. * config/aarch64/crti.S: Likewise. * config/aarch64/lse.S: Likewise. Diff: --- libgcc/config/aarch64/__arm_sme_state.S | 2 +- libgcc/config/aarch64/__arm_tpidr2_save.S | 4 ++-- libgcc/config/aarch64/__arm_za_disable.S | 6 +++--- libgcc/config/aarch64/aarch64-asm.h | 14 ++++++++++++-- libgcc/config/aarch64/crti.S | 12 ++++-------- libgcc/config/aarch64/lse.S | 9 +++++---- 6 files changed, 27 insertions(+), 20 deletions(-) diff --git a/libgcc/config/aarch64/__arm_sme_state.S b/libgcc/config/aarch64/__arm_sme_state.S index c4e16cac00d1..a8b4c83fa0f1 100644 --- a/libgcc/config/aarch64/__arm_sme_state.S +++ b/libgcc/config/aarch64/__arm_sme_state.S @@ -30,7 +30,7 @@ - Takes no argument. - Returns SME state in x0 and TPIDR2_EL0 in x1. */ -.hidden __aarch64_have_sme +HIDDEN (__aarch64_have_sme) variant_pcs (__arm_sme_state) diff --git a/libgcc/config/aarch64/__arm_tpidr2_save.S b/libgcc/config/aarch64/__arm_tpidr2_save.S index 879cf7980798..78ca99332124 100644 --- a/libgcc/config/aarch64/__arm_tpidr2_save.S +++ b/libgcc/config/aarch64/__arm_tpidr2_save.S @@ -31,7 +31,7 @@ - Does not return a value. - Can abort on failure (then registers are not preserved). */ -.hidden __aarch64_have_sme +HIDDEN (__aarch64_have_sme) variant_pcs (__arm_tpidr2_save) @@ -97,5 +97,5 @@ END (__arm_tpidr2_save) /* Hidden alias used by __arm_za_disable. */ .global __libgcc_arm_tpidr2_save -.hidden __libgcc_arm_tpidr2_save +HIDDEN (__libgcc_arm_tpidr2_save) .set __libgcc_arm_tpidr2_save, __arm_tpidr2_save diff --git a/libgcc/config/aarch64/__arm_za_disable.S b/libgcc/config/aarch64/__arm_za_disable.S index 03fc28a39317..98cb7471bbe7 100644 --- a/libgcc/config/aarch64/__arm_za_disable.S +++ b/libgcc/config/aarch64/__arm_za_disable.S @@ -31,9 +31,9 @@ - Does not return a value. - Can abort on failure (then registers are not preserved). */ -.hidden __aarch64_have_sme +HIDDEN (__aarch64_have_sme) -.hidden __libgcc_arm_tpidr2_save +HIDDEN (__libgcc_arm_tpidr2_save) variant_pcs (__arm_za_disable) @@ -66,5 +66,5 @@ END (__arm_za_disable) /* Hidden alias used by the unwinder. */ .global __libgcc_arm_za_disable -.hidden __libgcc_arm_za_disable +HIDDEN (__libgcc_arm_za_disable) .set __libgcc_arm_za_disable, __arm_za_disable diff --git a/libgcc/config/aarch64/aarch64-asm.h b/libgcc/config/aarch64/aarch64-asm.h index 8969b06b09c6..3257a3193e74 100644 --- a/libgcc/config/aarch64/aarch64-asm.h +++ b/libgcc/config/aarch64/aarch64-asm.h @@ -58,6 +58,16 @@ # define AUTIASP #endif +#ifdef __ELF__ +#define HIDDEN(name) .hidden name +#define SYMBOL_SIZE(name) .size name, .-name +#define SYMBOL_TYPE(name, _type) .type name, _type +#else +#define HIDDEN(name) +#define SYMBOL_SIZE(name) +#define SYMBOL_TYPE(name, _type) +#endif + /* Add a NT_GNU_PROPERTY_TYPE_0 note. */ #define GNU_PROPERTY(type, value) \ .section .note.gnu.property, "a"; \ @@ -85,7 +95,7 @@ GNU_PROPERTY (FEATURE_1_AND, BTI_FLAG|PAC_FLAG) #define ENTRY_ALIGN(name, align) \ .global name; \ - .type name,%function; \ + SYMBOL_TYPE(name, %function); \ .balign align; \ name: \ .cfi_startproc; \ @@ -95,4 +105,4 @@ GNU_PROPERTY (FEATURE_1_AND, BTI_FLAG|PAC_FLAG) #define END(name) \ .cfi_endproc; \ - .size name, .-name + SYMBOL_SIZE(name) diff --git a/libgcc/config/aarch64/crti.S b/libgcc/config/aarch64/crti.S index eed872a36fe0..f7a9198cabb1 100644 --- a/libgcc/config/aarch64/crti.S +++ b/libgcc/config/aarch64/crti.S @@ -21,6 +21,8 @@ # see the files COPYING3 and COPYING.RUNTIME respectively. If not, see # . +#include "aarch64-asm.h" + /* An executable stack is *not* required for these functions. */ #if defined(__ELF__) && defined(__linux__) .section .note.GNU-stack,"",%progbits @@ -31,12 +33,6 @@ # .init sections. Users may put any desired instructions in those # sections. -#ifdef __ELF__ -#define TYPE(x) .type x,function -#else -#define TYPE(x) -#endif - # Note - this macro is complemented by the FUNC_END macro # in crtn.S. If you change this macro you must also change # that macro match. @@ -53,7 +49,7 @@ .section ".init" .align 2 .global _init - TYPE(_init) + SYMBOL_TYPE(_init, function) _init: FUNC_START @@ -61,7 +57,7 @@ _init: .section ".fini" .align 2 .global _fini - TYPE(_fini) + SYMBOL_TYPE(_fini, function) _fini: FUNC_START diff --git a/libgcc/config/aarch64/lse.S b/libgcc/config/aarch64/lse.S index dde3a28e07b1..2114272d1059 100644 --- a/libgcc/config/aarch64/lse.S +++ b/libgcc/config/aarch64/lse.S @@ -48,6 +48,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see * separately to minimize code size. */ +#include "aarch64-asm.h" #include "auto-target.h" /* Tell the assembler to accept LSE instructions. */ @@ -58,7 +59,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #endif /* Declare the symbol gating the LSE implementations. */ - .hidden __aarch64_have_lse_atomics + HIDDEN(__aarch64_have_lse_atomics) /* Turn size and memory model defines into mnemonic fragments. */ #if SIZE == 1 @@ -168,8 +169,8 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see .text .balign 16 .globl \name - .hidden \name - .type \name, %function + HIDDEN(\name) + SYMBOL_TYPE(\name, %function) .cfi_startproc \name: BTI_C @@ -177,7 +178,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see .macro ENDFN name .cfi_endproc - .size \name, . - \name + SYMBOL_SIZE(\name) .endm /* Branch to LABEL if LSE is disabled. */