]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
If a region is specified assign it to all sections inside the overlay unless
authorNick Clifton <nickc@redhat.com>
Thu, 19 Jul 2001 16:23:30 +0000 (16:23 +0000)
committerNick Clifton <nickc@redhat.com>
Thu, 19 Jul 2001 16:23:30 +0000 (16:23 +0000)
they have been assigned to the own, non-default, memory region

ld/ChangeLog
ld/ldlang.c

index 3d930b9ac4d746b8bb688ed84a47b57adbf92334..54a9aa5c30130faac4d08b4e122d6e5bfa83409f 100644 (file)
@@ -1,3 +1,9 @@
+2001-07-19  Nick Clifton  <nickc@cambridge.redhat.com>
+
+       * ldlang.c (lang_leave_overlay): If a region is specified assign
+       it to all sections inside the overlay unless they have been
+       assigned to the own, non-default, memory region.
+
 2001-07-14  matthew green  <mrg@eterna.com.au>
 
        * configure.tgt (i386-*-netbsdelf*): New target.
index f683abb1405227e52b08c109d330c754fff65192..924e3ec32c5ea24a1e75eccf7234dc0cc4206014 100644 (file)
@@ -4766,10 +4766,13 @@ lang_leave_overlay (fill, memspec, phdrs, lma_memspec)
      const char *lma_memspec;
 {
   lang_memory_region_type *region;
+  lang_memory_region_type * default_region;
   lang_memory_region_type *lma_region;
   struct overlay_list *l;
   struct lang_nocrossref *nocrossref;
 
+  default_region = lang_memory_region_lookup ("*default*");
+
   if (memspec == NULL)
     region = NULL;
   else
@@ -4789,8 +4792,15 @@ lang_leave_overlay (fill, memspec, phdrs, lma_memspec)
 
       if (fill != 0 && l->os->fill == 0)
        l->os->fill = fill;
-      if (region != NULL && l->os->region == NULL)
+
+      /* Assign a region to the sections, if one has been specified.
+        Override the assignment of the default section, but not
+        other sections.  */
+      if (region != NULL &&
+         (l->os->region == NULL ||
+          l->os->region == default_region))
        l->os->region = region;
+
       /* We only set lma_region for the first overlay section, as
         subsequent overlay sections will have load_base set relative
         to the first section.  Also, don't set lma_region if
@@ -4800,6 +4810,7 @@ lang_leave_overlay (fill, memspec, phdrs, lma_memspec)
       if (lma_region != NULL && l->os->lma_region == NULL
          && l->next == NULL && l->os->load_base == NULL)
        l->os->lma_region = lma_region;
+
       if (phdrs != NULL && l->os->phdrs == NULL)
        l->os->phdrs = phdrs;