* elflink.c (elf_link_output_extsym): Strip defined plugin symbols
authorAlan Modra <amodra@gmail.com>
Fri, 7 Oct 2011 23:06:09 +0000 (23:06 +0000)
committerAlan Modra <amodra@gmail.com>
Fri, 7 Oct 2011 23:06:09 +0000 (23:06 +0000)
even when strip_discarded is false.

bfd/ChangeLog
bfd/elflink.c

index 7e858e2d7a673aa7114409b63949fbec65e4cac3..e2d28e67e36b3ceef5f86ee20446b63986daba50 100644 (file)
@@ -1,3 +1,8 @@
+2011-10-08  Alan Modra  <amodra@gmail.com>
+
+       * elflink.c (elf_link_output_extsym): Strip defined plugin symbols
+       even when strip_discarded is false.
+
 2011-10-05  Kai Tietz  <ktietz@redhat.com>
 
        * coffgen.c (coff_write_alien_symbol): Don't write
index 5d181f7993c2fe76fdcd03cf19efeac6c2bb8ab5..3ae4350684ce9a72af0ef3d68a9213a7c3e0b788 100644 (file)
@@ -8679,10 +8679,12 @@ elf_link_output_extsym (struct bfd_hash_entry *bh, void *data)
           && 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))
+  else if ((h->root.type == bfd_link_hash_defined
+           || h->root.type == bfd_link_hash_defweak)
+          && ((finfo->info->strip_discarded
+               && elf_discarded_section (h->root.u.def.section))
+              || (h->root.u.def.section->owner != NULL
+                  && (h->root.u.def.section->owner->flags & BFD_PLUGIN) != 0)))
     strip = TRUE;
   else if ((h->root.type == bfd_link_hash_undefined
            || h->root.type == bfd_link_hash_undefweak)