aboutsummaryrefslogtreecommitdiff
path: root/gas/write.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2002-11-28 14:13:51 +0000
committerJakub Jelinek <jakub@redhat.com>2002-11-28 14:13:51 +0000
commit381a1ab30c060addb84bcd45ae1fbe1abd8c8f4d (patch)
treec7e39f8782ff6425aa0c2506fd8508cbed18ef11 /gas/write.c
parent947216bf8f343c1440e85633b5bf2f2394f87bc4 (diff)
downloadgdb-381a1ab30c060addb84bcd45ae1fbe1abd8c8f4d.zip
gdb-381a1ab30c060addb84bcd45ae1fbe1abd8c8f4d.tar.gz
gdb-381a1ab30c060addb84bcd45ae1fbe1abd8c8f4d.tar.bz2
* write.c (subsegs_finish): For SEC_MERGE sections pad last fragment
to entsize.
Diffstat (limited to 'gas/write.c')
-rw-r--r--gas/write.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/gas/write.c b/gas/write.c
index b1c27d7..40c18f8 100644
--- a/gas/write.c
+++ b/gas/write.c
@@ -1409,7 +1409,25 @@ subsegs_finish ()
any alignment is meaningless, and, moreover, will look weird
if we are generating a listing. */
if (!had_errors ())
- alignment = SUB_SEGMENT_ALIGN (now_seg, frchainP);
+ {
+ alignment = SUB_SEGMENT_ALIGN (now_seg, frchainP);
+#ifdef BFD_ASSEMBLER
+ if ((bfd_get_section_flags (now_seg->owner, now_seg) & SEC_MERGE)
+ && now_seg->entsize)
+ {
+ unsigned int entsize = now_seg->entsize;
+ int entalign = 0;
+
+ while ((entsize & 1) == 0)
+ {
+ ++entalign;
+ entsize >>= 1;
+ }
+ if (entalign > alignment)
+ alignment = entalign;
+ }
+#endif
+ }
if (subseg_text_p (now_seg))
frag_align_code (alignment, 0);