summaryrefslogtreecommitdiff
path: root/ld/ldlang.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@bigpond.net.au>2013-03-05 02:55:24 +0000
committerAlan Modra <amodra@bigpond.net.au>2013-03-05 02:55:24 +0000
commite77023bc73e5162ac35ba7552419d15816445e49 (patch)
treed5ca22d96d1bf528d204c5b8410642c5271adb4a /ld/ldlang.c
parenteb7e7f7c520b495f48e67850671b32042a6d60f6 (diff)
downloadbinutils-redhat-e77023bc73e5162ac35ba7552419d15816445e49.tar.gz
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 65d8bbdfb6..08aa32aa0c 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;