aboutsummaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2000-07-12 16:45:46 +0000
committerNick Clifton <nickc@redhat.com>2000-07-12 16:45:46 +0000
commit7f7888218f38ff55bb5a4879e2cc4bd3bdaf7f51 (patch)
tree2427b6d3b179f473fa947b3bf44b9629756d3be5 /gas
parent062739d1510d8ed2c1558dcd51cf958ce52855c3 (diff)
downloadgdb-7f7888218f38ff55bb5a4879e2cc4bd3bdaf7f51.zip
gdb-7f7888218f38ff55bb5a4879e2cc4bd3bdaf7f51.tar.gz
gdb-7f7888218f38ff55bb5a4879e2cc4bd3bdaf7f51.tar.bz2
Add padding to the last section when aligning it increases its size.
Diffstat (limited to 'gas')
-rw-r--r--gas/ChangeLog5
-rw-r--r--gas/config/obj-coff.c16
2 files changed, 19 insertions, 2 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index c7bf35b..87212d9 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,8 @@
+2000-07-12 Mark Elbrecht <snowball3@bigfoot.com>
+
+ * config/obj-coff.c (coff_frob_section): Add padding to the last
+ section when aligning it increases its size.
+
2000-07-11 Kazu Hirata <kazu@hxi.com>
* config/tc-tic54x.c: Fix formatting.
diff --git a/gas/config/obj-coff.c b/gas/config/obj-coff.c
index 018f32b..41fc595 100644
--- a/gas/config/obj-coff.c
+++ b/gas/config/obj-coff.c
@@ -1489,8 +1489,20 @@ coff_frob_section (sec)
#if !defined(TICOFF)
if (size & mask)
{
- size = (size + mask) & ~mask;
- bfd_set_section_size (stdoutput, sec, size);
+ bfd_vma new_size;
+ fragS *last;
+
+ new_size = (size + mask) & ~mask;
+ bfd_set_section_size (stdoutput, sec, new_size);
+
+ /* If the size had to be rounded up, add some padding in
+ the last non-empty frag. */
+ fragp = seg_info (sec)->frchainP->frch_root;
+ last = seg_info (sec)->frchainP->frch_last;
+ while (fragp->fr_next != last)
+ fragp = fragp->fr_next;
+ last->fr_address = size;
+ fragp->fr_offset += new_size - size;
}
#endif