bfd/
[external/binutils.git] / ld / ldlang.c
index d9b8ac9..2c9426e 100644 (file)
@@ -4368,18 +4368,12 @@ lang_size_sections_1
            os->processed_vma = TRUE;
 
            if (bfd_is_abs_section (os->bfd_section) || os->ignored)
-             {
-               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);
-                 }
-             }
+             /* Except for some special linker created sections,
+                no output section should change from zero size
+                after strip_excluded_output_sections.  A non-zero
+                size on an ignored section indicates that some
+                input section was not sized early enough.  */
+             ASSERT (os->bfd_section->size == 0);
            else
              {
                dot = os->bfd_section->vma;