Fix generic linker symbol output when weak is overridden by strong
authorAlan Modra <amodra@gmail.com>
Wed, 24 Dec 2014 01:22:26 +0000 (11:52 +1030)
committerAlan Modra <amodra@gmail.com>
Wed, 24 Dec 2014 02:32:42 +0000 (13:02 +1030)
Yes, I know this also affects bfd_link_hash_indirect, but output of
indirect and warning symbols looks quite broken anyway.

* linker.c (_bfd_generic_link_output_symbols): Remove BSF_WEAK
flag from bfd_link_hash_defined symbols.

bfd/ChangeLog
bfd/linker.c

index 8e6fa09472249d376c32efc415cd5347129b9d82..7b0ad1decb9e6bd69e08dabb4136ea19db321ef2 100644 (file)
@@ -1,3 +1,8 @@
+2014-12-24  Alan Modra  <amodra@gmail.com>
+
+       * linker.c (_bfd_generic_link_output_symbols): Remove BSF_WEAK
+       flag from bfd_link_hash_defined symbols.
+
 2014-12-23  Andrew Burgess  <andrew.burgess@embecosm.com>
 
        * elf32-avr.c (bfd_elf_avr_final_write_processing): Don't set
index 92238101010c0ae00adcd4d3d23231a0275a7c43..083a2504b677a20a8aae5d27c810eb788000873b 100644 (file)
@@ -2136,7 +2136,7 @@ _bfd_generic_link_output_symbols (bfd *output_bfd,
                  /* fall through */
                case bfd_link_hash_defined:
                  sym->flags |= BSF_GLOBAL;
-                 sym->flags &=~ BSF_CONSTRUCTOR;
+                 sym->flags &=~ (BSF_WEAK | BSF_CONSTRUCTOR);
                  sym->value = h->root.u.def.value;
                  sym->section = h->root.u.def.section;
                  break;