* section.c (_bfd_strip_section_from_output): Ignore sections
authorRichard Henderson <rth@redhat.com>
Sun, 20 Jun 1999 14:15:42 +0000 (14:15 +0000)
committerRichard Henderson <rth@redhat.com>
Sun, 20 Jun 1999 14:15:42 +0000 (14:15 +0000)
        DISCARDed by the link script.

bfd/ChangeLog
bfd/section.c

index 0ad36fddfc44f0069e923bdf6b8a49f48884b744..af50cb8831eece972218eec73609994b799f9c04 100644 (file)
@@ -1,3 +1,8 @@
+Sun Jun 20 14:13:57 1999  Richard Henderson  <rth@cygnus.com>
+
+       * section.c (_bfd_strip_section_from_output): Ignore sections
+       DISCARDed by the link script.
+
 1999-06-19  Ian Lance Taylor  <ian@zembu.com>
 
        * elflink.h (elf_link_remove_section_and_adjust_dynindices):
index dcb240f897cfe6530598e3db355a691f9277baaf..414a9cd912cec57634859c26e159b82dfd9e5b9c 100644 (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)