aboutsummaryrefslogtreecommitdiff
path: root/bfd/section.c
diff options
context:
space:
mode:
authorRichard Henderson <rth@redhat.com>1999-06-20 14:15:42 +0000
committerRichard Henderson <rth@redhat.com>1999-06-20 14:15:42 +0000
commit0bde07d41af5c67daa9291f64b6cf87909df245c (patch)
treeebc3d2f7e16cfbf3caac016652d0c9617985660f /bfd/section.c
parentf97f73002970e20650a4f9ccf635be632b9555de (diff)
downloadgdb-0bde07d41af5c67daa9291f64b6cf87909df245c.zip
gdb-0bde07d41af5c67daa9291f64b6cf87909df245c.tar.gz
gdb-0bde07d41af5c67daa9291f64b6cf87909df245c.tar.bz2
* section.c (_bfd_strip_section_from_output): Ignore sections
DISCARDed by the link script.
Diffstat (limited to 'bfd/section.c')
-rw-r--r--bfd/section.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/bfd/section.c b/bfd/section.c
index dcb240f..414a9cd 100644
--- a/bfd/section.c
+++ b/bfd/section.c
@@ -1065,8 +1065,10 @@ _bfd_strip_section_from_output (s)
break;
}
- /* If the output section is empty, remove it too. */
- if (!os->link_order_head)
+ /* If the output section is empty, remove it too. Careful about sections
+ that have been discarded in the link script -- they are mapped to
+ bfd_abs_section, which has no owner. */
+ if (!os->link_order_head && os->owner)
{
for (spp = &os->owner->sections; *spp; spp = &(*spp)->next)
if (*spp == os)