Only set lma_region from the default for the first section
authorAlan Modra <amodra@gmail.com>
Tue, 23 Jan 2001 11:48:28 +0000 (11:48 +0000)
committerAlan Modra <amodra@gmail.com>
Tue, 23 Jan 2001 11:48:28 +0000 (11:48 +0000)
of a group of overlay sections.

ld/ChangeLog
ld/ldlang.c

index 49ec5e4..15f683c 100644 (file)
@@ -1,3 +1,8 @@
+2001-01-23  Alan Modra  <alan@linuxcare.com.au>
+
+       * ldlang.c (lang_leave_overlay): Only set lma_region from the
+       default for the first section of a group of overlay sections.
+
 2001-01-22  Alan Modra  <alan@linuxcare.com.au>
 
        * Makefile.am (GENSCRIPTS): Pass exec_prefix.
index bc25f04..2baf13b 100644 (file)
@@ -4780,7 +4780,10 @@ lang_leave_overlay (fill, memspec, phdrs, lma_memspec)
        l->os->fill = fill;
       if (region != NULL && l->os->region == NULL)
        l->os->region = region;
-      if (lma_region != NULL && l->os->lma_region == NULL)
+      /* We only set lma_region for the first overlay section, as
+        subsequent overlay sections will have load_base set relative
+        to the first section.  */
+      if (lma_region != NULL && l->os->lma_region == NULL && l->next == NULL)
        l->os->lma_region = lma_region;
       if (phdrs != NULL && l->os->phdrs == NULL)
        l->os->phdrs = phdrs;