aboutsummaryrefslogtreecommitdiff
path: root/ld/ldlang.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2013-03-05 02:55:27 +0000
committerAlan Modra <amodra@gmail.com>2013-03-05 02:55:27 +0000
commit13762d2ee43b8b49d5d26a87c5496439d829bc6a (patch)
treec03c40bb14a66e3b1780ba4184d2ea82b6ad8c8b /ld/ldlang.c
parentda797b631b318a4ecab6aac93315feb24553bfdf (diff)
downloadgdb-13762d2ee43b8b49d5d26a87c5496439d829bc6a.zip
gdb-13762d2ee43b8b49d5d26a87c5496439d829bc6a.tar.gz
gdb-13762d2ee43b8b49d5d26a87c5496439d829bc6a.tar.bz2
PR ld/15222
ld/ * ldlang.c (lang_size_sections_1): When given an lma_region align LMA as per VMA only if lma_region is the same as region. ld/testsuite/ * ld-scripts/rgn-at6.s, * ld-scripts/rgn-at6.t, * ld-scripts/rgn-at6.d, * ld-scripts/rgn-at7.t, * ld-scripts/rgn-at7.d: New tests.
Diffstat (limited to 'ld/ldlang.c')
-rw-r--r--ld/ldlang.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/ld/ldlang.c b/ld/ldlang.c
index 65d8bbd..08aa32a 100644
--- a/ld/ldlang.c
+++ b/ld/ldlang.c
@@ -4963,6 +4963,13 @@ lang_size_sections_1
{
bfd_vma lma = os->lma_region->current;
+ /* When LMA_REGION is the same as REGION, align the LMA
+ as we did for the VMA, possibly including alignment
+ from the bfd section. If a different region, then
+ only align according to the value in the output
+ statement. */
+ if (os->lma_region != os->region)
+ section_alignment = os->section_alignment;
if (section_alignment > 0)
lma = align_power (lma, section_alignment);
os->bfd_section->lma = lma;