aboutsummaryrefslogtreecommitdiff
path: root/ld/ldlang.c
diff options
context:
space:
mode:
authorRichard Sandiford <rdsandiford@googlemail.com>2002-06-10 16:12:04 +0000
committerRichard Sandiford <rdsandiford@googlemail.com>2002-06-10 16:12:04 +0000
commite052cfbe6898f57a9f63055c9e02b116ce69b41b (patch)
treeb5f44acce4346cdf931790054ff9fc551e8a7b91 /ld/ldlang.c
parent0ebaf18527d124cb0cde59192c5fd7c352b22cd4 (diff)
downloadgdb-e052cfbe6898f57a9f63055c9e02b116ce69b41b.zip
gdb-e052cfbe6898f57a9f63055c9e02b116ce69b41b.tar.gz
gdb-e052cfbe6898f57a9f63055c9e02b116ce69b41b.tar.bz2
* ldlang.c (lang_size_sections_1): Skip removed output sections.
Diffstat (limited to 'ld/ldlang.c')
-rw-r--r--ld/ldlang.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/ld/ldlang.c b/ld/ldlang.c
index 6346a74..abe3834 100644
--- a/ld/ldlang.c
+++ b/ld/ldlang.c
@@ -2907,6 +2907,14 @@ lang_size_sections_1 (s, output_section_statement, prev, fill, dot, relax)
/* This section was never actually created. */
break;
+ /* The section might have been removed after its statement was
+ added. For example, ldemul_before_allocation can remove
+ dynamic sections if they turn out not to be needed. */
+ if (!link_info.relocateable
+ && (bfd_get_section_flags (output_bfd, os->bfd_section)
+ & SEC_EXCLUDE) != 0)
+ break;
+
/* If this is a COFF shared library section, use the size and
address from the input section. FIXME: This is COFF
specific; it would be cleaner if there were some other way