PR ld/3107
authorNick Clifton <nickc@redhat.com>
Fri, 15 Sep 2006 09:48:58 +0000 (09:48 +0000)
committerNick Clifton <nickc@redhat.com>
Fri, 15 Sep 2006 09:48:58 +0000 (09:48 +0000)
* ldlang.c (lang_size_sections_1): Do not abort when encountering a non-empty
  section that is ignored.  Instead produce a warning message.

ld/ChangeLog
ld/ldlang.c

index 81519124fb5812b0344acca6eb55aff529f88536..dab46921e0264e9b4c7190073efe147d082c1b97 100644 (file)
@@ -1,3 +1,10 @@
+2006-09-15  Nick Clifton  <nickc@redhat.com>
+
+       PR ld/3107
+       * ldlang.c (lang_size_sections_1): Do not abort when encountering
+       a non-empty section that is ignored.  Instead produce a warning
+       message.
+
 2006-09-08  H.J. Lu  <hongjiu.lu@intel.com>
 
        * ld.texinfo: Document --dynamic-list-cpp-typeinfo.
index bd9fd89a528cd720c4aa6d0e50be8db47fd1f73f..8b6cbd2d64cc67e69fbafc958749749a5a59717f 100644 (file)
@@ -4367,7 +4367,18 @@ lang_size_sections_1
            os->processed_vma = TRUE;
 
            if (bfd_is_abs_section (os->bfd_section) || os->ignored)
-             ASSERT (os->bfd_section->size == 0);
+             {
+               if (os->bfd_section->size > 0)
+                 {
+                   /* PR ld/3107:  Do not abort when a buggy linker script
+                      causes a non-empty section to be discarded.  */
+                   if (bfd_is_abs_section (os->bfd_section))
+                     einfo (_("%P%X: internal error: attempting to take the size of the non-section *ABS*\n"));
+                   else
+                     einfo (_("%P: warning: discarding non-empty, well known section %A\n"),
+                            os->bfd_section);
+                 }
+             }
            else
              {
                dot = os->bfd_section->vma;