ld/
authorAlan Modra <amodra@gmail.com>
Wed, 18 Apr 2007 03:55:10 +0000 (03:55 +0000)
committerAlan Modra <amodra@gmail.com>
Wed, 18 Apr 2007 03:55:10 +0000 (03:55 +0000)
* ldlang.h (enum section_type): Add overlay_section.
* ldlang.c (lang_add_section): Handle flags for overlay_section
as per normal_section.
(lang_size_sections_1): When setting lma, detect overlays by
os->sectype rather than by looking for overlapping vmas.
(lang_enter_overlay_section): Use overlay_section type.
(lang_leave_overlay): Set first overlay section to normal.
ld/testsuite/
* ld-spu/ovl.lnk: Use OVERLAY keyword.

ld/ChangeLog
ld/ldlang.c
ld/ldlang.h
ld/testsuite/ChangeLog
ld/testsuite/ld-spu/ovl.lnk

index 5912cafc8715c32d6c0a1dfc0f8010e68ef00617..50a474aed31f64b58989bd31c1994e6bf8e89d23 100644 (file)
@@ -1,3 +1,13 @@
+2007-04-18  Alan Modra  <amodra@bigpond.net.au>
+
+       * ldlang.h (enum section_type): Add overlay_section.
+       * ldlang.c (lang_add_section): Handle flags for overlay_section
+       as per normal_section.
+       (lang_size_sections_1): When setting lma, detect overlays by
+       os->sectype rather than by looking for overlapping vmas.
+       (lang_enter_overlay_section): Use overlay_section type.
+       (lang_leave_overlay): Set first overlay section to normal.
+
 2007-04-14  Steve Ellcey  <sje@cup.hp.com>
 
        * Makefile.am: Add ACLOCAL_AMFLAGS.
index cf1a697a1393cfbe308744f60d5bda0752477fcd..297df20a301189ae453d3dac621f0e962a24cc7e 100644 (file)
@@ -2040,6 +2040,7 @@ lang_add_section (lang_statement_list_type *ptr,
       switch (output->sectype)
        {
        case normal_section:
+       case overlay_section:
          break;
        case noalloc_section:
          flags &= ~SEC_ALLOC;
@@ -4438,14 +4439,9 @@ lang_size_sections_1
                  }
                else
                  {
-                   /* If the current vma overlaps the previous section,
-                      then set the current lma to that at the end of
-                      the previous section.  The previous section was
-                      probably an overlay.  */
-                   if ((dot >= last->vma
-                        && dot < last->vma + last->size)
-                       || (last->vma >= dot
-                           && last->vma < dot + os->bfd_section->size))
+                   /* If this is an overlay, set the current lma to that
+                      at the end of the previous section.  */
+                   if (os->sectype == overlay_section)
                      lma = last->lma + last->size;
 
                    /* Otherwise, keep the same lma to vma relationship
@@ -6392,7 +6388,7 @@ lang_enter_overlay_section (const char *name)
   struct overlay_list *n;
   etree_type *size;
 
-  lang_enter_output_section_statement (name, overlay_vma, normal_section,
+  lang_enter_output_section_statement (name, overlay_vma, overlay_section,
                                       0, overlay_subalign, 0, 0);
 
   /* If this is the first section, then base the VMA of future
@@ -6506,7 +6502,10 @@ lang_leave_overlay (etree_type *lma_expr,
         The base address is not needed (and should be null) if
         an LMA region was specified.  */
       if (l->next == 0)
-       l->os->load_base = lma_expr;
+       {
+         l->os->load_base = lma_expr;
+         l->os->sectype = normal_section;
+       }
       if (phdrs != NULL && l->os->phdrs == NULL)
        l->os->phdrs = phdrs;
 
index 33abf9f2a73e5ad5cc8b79c0e9e5817c382c8995..f52f46ffbc693ebfac5ef0d43402abdaee419891 100644 (file)
@@ -108,6 +108,7 @@ typedef struct lang_output_statement_struct
 enum section_type
 {
   normal_section,
+  overlay_section,
   noload_section,
   noalloc_section
 };
index 5b5a49615812df6c464668d4b32cf713e597a857..5033f78dfe9f3ed26ebeb44b8d206d524e20b000 100644 (file)
@@ -1,3 +1,7 @@
+2007-04-18  Alan Modra  <amodra@bigpond.net.au>
+
+       * ld-spu/ovl.lnk: Use OVERLAY keyword.
+
 2007-04-17  Paul Brook  <paul@codesourcery.com>
 
        * ld-arm/preempt-app.s: New test.
index 84701d438711f094aebaa0e45ac589dbdf75e611..408ed1ebd67c9371a2a5e024dd483c5a0ba51ebe 100644 (file)
@@ -3,10 +3,11 @@ SECTIONS
   . = SIZEOF_HEADERS;
   .text : { *(.text) *(.stub) }
 
-  . = 0x400;
-  .ov_a1 : { *(.ov_a1) }
-  .ov_a2 ADDR (.ov_a1) : { *(.ov_a2) }
-  . = ADDR (.ov_a1) + MAX (SIZEOF (.ov_a1), SIZEOF (.ov_a2));
+  OVERLAY 0x400 :
+  {
+    .ov_a1 { *(.ov_a1) }
+    .ov_a2 { *(.ov_a2) }
+  }
 
   .data : { *(.data) *(.ovtab) }
   .bss : { *(.bss) }
This page took 0.031965 seconds and 4 git commands to generate.