aboutsummaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
authorClément Chigot <clement.chigot@atos.net>2021-06-15 11:06:52 +0200
committerAlan Modra <amodra@gmail.com>2021-06-17 23:29:47 +0930
commitbcf8470303e06cb6cd5294608aad913fe5580f45 (patch)
tree7ef5ce89e4df1a0952945ad6655c060f66c2d6a1 /gas
parent18263be7565782a9c07045a7a72d80c507a5be09 (diff)
downloadgdb-bcf8470303e06cb6cd5294608aad913fe5580f45.zip
gdb-bcf8470303e06cb6cd5294608aad913fe5580f45.tar.gz
gdb-bcf8470303e06cb6cd5294608aad913fe5580f45.tar.bz2
gas: handle csect in bss section for XCOFF
Latest gcc versions are now generating csects instead of .lcomm for bss symbols. Some adjustements are needed in order to handle them. * config/tc-ppc.c (md_begin): Create bss section with dummy symbol. (ppc_frob_symbol): Output XTY_CM for bss csects. (ppc_fix_adjustable): Adjust condition to avoid bss csects.
Diffstat (limited to 'gas')
-rw-r--r--gas/ChangeLog7
-rw-r--r--gas/config/tc-ppc.c10
2 files changed, 14 insertions, 3 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index ad20137..821cc81 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,5 +1,12 @@
2021-06-17 Clément Chigot <clement.chigot@atos.net>
+ * config/tc-ppc.c (md_begin): Create bss section with dummy
+ symbol.
+ (ppc_frob_symbol): Output XTY_CM for bss csects.
+ (ppc_fix_adjustable): Adjust condition to avoid bss csects.
+
+2021-06-17 Clément Chigot <clement.chigot@atos.net>
+
* config/tc-ppc.c (md_apply_fix): Adjust addend to nullify
section contents for BFD_RELOC_PPC_TLSM or
BFD_RELOC_PPC64_TLSM.
diff --git a/gas/config/tc-ppc.c b/gas/config/tc-ppc.c
index 72bf5ce..ad85d38 100644
--- a/gas/config/tc-ppc.c
+++ b/gas/config/tc-ppc.c
@@ -1883,7 +1883,7 @@ md_begin (void)
data csects. These symbols will not be output. */
ppc_init_xcoff_section (&ppc_xcoff_text_section, text_section, true);
ppc_init_xcoff_section (&ppc_xcoff_data_section, data_section, true);
- ppc_init_xcoff_section (&ppc_xcoff_bss_section, bss_section, false);
+ ppc_init_xcoff_section (&ppc_xcoff_bss_section, bss_section, true);
#endif
}
@@ -5986,7 +5986,10 @@ ppc_frob_symbol (symbolS *sym)
a->x_csect.x_scnlen.l = (S_GET_VALUE (symbol_get_tc (sym)->next)
- S_GET_VALUE (sym));
}
- a->x_csect.x_smtyp = (symbol_get_tc (sym)->align << 3) | XTY_SD;
+ if (symbol_get_tc (sym)->symbol_class == XMC_BS)
+ a->x_csect.x_smtyp = (symbol_get_tc (sym)->align << 3) | XTY_CM;
+ else
+ a->x_csect.x_smtyp = (symbol_get_tc (sym)->align << 3) | XTY_SD;
}
else if (S_GET_SEGMENT (sym) == bss_section
|| S_GET_SEGMENT (sym) == ppc_xcoff_tbss_section.segment)
@@ -6415,7 +6418,8 @@ ppc_fix_adjustable (fixS *fix)
/* Adjust a reloc against a .lcomm symbol to be against the base
.lcomm. */
if (symseg == bss_section
- && ! S_IS_EXTERNAL (fix->fx_addsy))
+ && ! S_IS_EXTERNAL (fix->fx_addsy)
+ && symbol_get_tc (fix->fx_addsy)->subseg == 0)
{
symbolS *sy = symbol_get_frag (fix->fx_addsy)->fr_symbol;