aboutsummaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
authorJ.W. Jagersma <jwjagersma@gmail.com>2020-03-25 11:52:07 +0000
committerNick Clifton <nickc@redhat.com>2020-03-25 11:53:12 +0000
commitb77809577782d8798bc86dde3a2a28c30d7805f0 (patch)
tree603ac5a5f7cc001fe756bb91a10c75816d58c5b5 /gas
parent7b1eff95bed765cb20dd3168cb99896a91fcdca7 (diff)
downloadfsf-binutils-gdb-b77809577782d8798bc86dde3a2a28c30d7805f0.zip
fsf-binutils-gdb-b77809577782d8798bc86dde3a2a28c30d7805f0.tar.gz
fsf-binutils-gdb-b77809577782d8798bc86dde3a2a28c30d7805f0.tar.bz2
The "b" flag for COFF sections only unsets the LOAD attribute. It should also clear the CONTENTS attribute so that named bss sections don't take up space in an object file. This can be achieved by setting the 'bss' flag in seg_info.
* config/obj-coff.c (obj_coff_section): Set the bss flag on sections with the "b" attribute.
Diffstat (limited to 'gas')
-rw-r--r--gas/ChangeLog5
-rw-r--r--gas/config/obj-coff.c5
2 files changed, 10 insertions, 0 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index dcac44c..fc436ff 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,8 @@
+2020-03-25 J.W. Jagersma <jwjagersma@gmail.com>
+
+ * config/obj-coff.c (obj_coff_section): Set the bss flag on
+ sections with the "b" attribute.
+
2020-03-22 Alan Modra <amodra@gmail.com>
* testsuite/gas/s12z/truncated.d: Update expected output.
diff --git a/gas/config/obj-coff.c b/gas/config/obj-coff.c
index 178ccaa..70d9fb3 100644
--- a/gas/config/obj-coff.c
+++ b/gas/config/obj-coff.c
@@ -1532,6 +1532,7 @@ obj_coff_section (int ignore ATTRIBUTE_UNUSED)
unsigned int exp;
flagword flags, oldflags;
asection *sec;
+ bfd_boolean is_bss = FALSE;
if (flag_mri)
{
@@ -1581,6 +1582,7 @@ obj_coff_section (int ignore ATTRIBUTE_UNUSED)
/* Uninitialised data section. */
flags |= SEC_ALLOC;
flags &=~ SEC_LOAD;
+ is_bss = TRUE;
break;
case 'n':
@@ -1652,6 +1654,9 @@ obj_coff_section (int ignore ATTRIBUTE_UNUSED)
sec = subseg_new (name, (subsegT) exp);
+ if (is_bss)
+ seg_info (sec)->bss = 1;
+
if (alignment >= 0)
sec->alignment_power = alignment;