* section.c (_bfd_strip_section_from_output): Ignore sections

DISCARDed by the link script.
This commit is contained in:
Richard Henderson
1999-06-20 14:15:42 +00:00
parent f97f730029
commit 0bde07d41a
2 changed files with 9 additions and 2 deletions

View File

@ -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)