aboutsummaryrefslogtreecommitdiff
path: root/ld/ldlang.c
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2006-09-15 09:48:58 +0000
committerNick Clifton <nickc@redhat.com>2006-09-15 09:48:58 +0000
commit99643f697ed692215488dd72f36eb3d82fd2c2ac (patch)
treefe5aa43caf03ccf95c998a504c4b554c6533240d /ld/ldlang.c
parent7d3d6bd5c1bb432075af20a5838f192728f7c3ff (diff)
downloadfsf-binutils-gdb-99643f697ed692215488dd72f36eb3d82fd2c2ac.zip
fsf-binutils-gdb-99643f697ed692215488dd72f36eb3d82fd2c2ac.tar.gz
fsf-binutils-gdb-99643f697ed692215488dd72f36eb3d82fd2c2ac.tar.bz2
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.
Diffstat (limited to 'ld/ldlang.c')
-rw-r--r--ld/ldlang.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/ld/ldlang.c b/ld/ldlang.c
index bd9fd89..8b6cbd2 100644
--- a/ld/ldlang.c
+++ b/ld/ldlang.c
@@ -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;