* elflink.h (elf_link_output_extsym): Heed strip_discarded.
authorAlan Modra <amodra@gmail.com>
Mon, 23 Dec 2002 11:53:59 +0000 (11:53 +0000)
committerAlan Modra <amodra@gmail.com>
Mon, 23 Dec 2002 11:53:59 +0000 (11:53 +0000)
bfd/ChangeLog
bfd/elflink.h

index 106eb2cd9a3d84b4484c3e51da7c0824d34ad2fc..df7a736b37bee6fd5e6671c57ee01571efce3cb3 100644 (file)
@@ -1,3 +1,7 @@
+2002-12-23  Alan Modra  <amodra@bigpond.net.au>
+
+       * elflink.h (elf_link_output_extsym): Heed strip_discarded.
+
 2002-12-23  Nick Clifton  <nickc@redhat.com>
 
        * archures.c (bfd_arch_get_compatible): Add third parameter
index ac3cd111e58f3581efcfd5623b9d736cb0014322..060b129d3568fb07efcf25efb11536bcc47e5f9f 100644 (file)
@@ -6123,11 +6123,16 @@ elf_link_output_extsym (h, data)
           && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0
           && (h->elf_link_hash_flags & ELF_LINK_HASH_REF_REGULAR) == 0)
     strip = TRUE;
-  else if (finfo->info->strip == strip_all
-          || (finfo->info->strip == strip_some
-              && bfd_hash_lookup (finfo->info->keep_hash,
-                                  h->root.root.string,
-                                  FALSE, FALSE) == NULL))
+  else if (finfo->info->strip == strip_all)
+    strip = TRUE;
+  else if (finfo->info->strip == strip_some
+          && bfd_hash_lookup (finfo->info->keep_hash,
+                              h->root.root.string, FALSE, FALSE) == NULL)
+    strip = TRUE;
+  else if (finfo->info->strip_discarded
+          && (h->root.type == bfd_link_hash_defined
+              || h->root.type == bfd_link_hash_defweak)
+          && elf_discarded_section (h->root.u.def.section))
     strip = TRUE;
   else
     strip = FALSE;