aboutsummaryrefslogtreecommitdiff
path: root/include/coff
diff options
context:
space:
mode:
authorClément Chigot <clement.chigot@atos.net>2021-11-16 14:02:16 +0100
committerClément Chigot <clement.chigot@atos.net>2022-01-12 09:08:11 +0100
commitadd588a8ef53a5f77f2abda08a5de643923c4cce (patch)
treef5b85c033c265d175ec30c4de2d7568ac9751f8e /include/coff
parentc4f5871457222f2c4a99e662dfa16b7c662f750a (diff)
downloadgdb-add588a8ef53a5f77f2abda08a5de643923c4cce.zip
gdb-add588a8ef53a5f77f2abda08a5de643923c4cce.tar.gz
gdb-add588a8ef53a5f77f2abda08a5de643923c4cce.tar.bz2
gas: add visibility support for XCOFF
XCOFF assembly defines the visibility using an additional argument on several pseudo-ops: .globl, .weak, .extern and .comm. This implies that .globl and .weak syntax is different than the usual GNU syntax. But we want to provide compatibility with AIX assembler, especially because GCC is generating the visibility using this XCOFF syntax. PR 22085 bfd/ChangeLog: * coffcode.h (coff_write_object_contents): Change XCOFF header vstamp field to 2. * coffgen.c (coff_print_symbol): Increase the size for n_type. gas/ChangeLog: * config/tc-ppc.c (ppc_xcoff_get_visibility): New function. (ppc_globl): New function. (ppc_weak): New function. (ppc_comm): Add visibility field support. (ppc_extern): Likewise. * testsuite/gas/all/cofftag.d: Adjust to new n_type size providing by objdump. * testsuite/gas/ppc/test1xcoff32.d: Likewise. * testsuite/gas/ppc/aix.exp: Add new tests. * testsuite/gas/ppc/xcoff-visibility-1-32.d: New test. * testsuite/gas/ppc/xcoff-visibility-1-64.d: New test. * testsuite/gas/ppc/xcoff-visibility-1.s: New test. include/ChangeLog: * coff/internal.h (SYM_V_INTERNAL, SYM_V_HIDDEN, SYM_V_PROTECTED, SYM_V_EXPORTED, SYM_V_MASK): New defines. * coff/xcoff.h (struct xcoff_link_hash_entry): Add visibility field. ld/ChangeLog: * testsuite/ld-pe/pr19803.d: Adjust to new n_type size providing by objdump.
Diffstat (limited to 'include/coff')
-rw-r--r--include/coff/internal.h7
-rw-r--r--include/coff/xcoff.h3
2 files changed, 10 insertions, 0 deletions
diff --git a/include/coff/internal.h b/include/coff/internal.h
index 69eb0a4..f12908b 100644
--- a/include/coff/internal.h
+++ b/include/coff/internal.h
@@ -536,6 +536,13 @@ struct internal_syment
#define DECREF(x) \
((((x) >> N_TSHIFT) & ~ N_BTMASK) | ((x) & N_BTMASK))
+/* Visibility flag, in XCOFF n_type. */
+#define SYM_V_INTERNAL 0x1000
+#define SYM_V_HIDDEN 0x2000
+#define SYM_V_PROTECTED 0x3000
+#define SYM_V_EXPORTED 0x4000
+#define SYM_V_MASK 0xF000
+
union internal_auxent
{
struct
diff --git a/include/coff/xcoff.h b/include/coff/xcoff.h
index bf53ecd..acadf54 100644
--- a/include/coff/xcoff.h
+++ b/include/coff/xcoff.h
@@ -349,6 +349,9 @@ struct xcoff_link_hash_entry
/* Some linker flags. */
unsigned long flags;
+ /* Symbol visibility, using the same define than n_type. */
+ unsigned short visibility;
+
/* The storage mapping class. */
unsigned char smclas;
};