Use a symbol flag bit to mark linker defined symbols
authorAlan Modra <amodra@gmail.com>
Tue, 23 Dec 2014 08:37:23 +0000 (19:07 +1030)
committerAlan Modra <amodra@gmail.com>
Tue, 23 Dec 2014 13:06:50 +0000 (23:36 +1030)
commit12b2843a6bb12292d8e36d8df22c788a3c91cb2f
tree09f7f27839b1e5fe160a58612b5939037905e968
parent4cc2bf08a4e18aa2009e9d4f1694a800eacbee17
Use a symbol flag bit to mark linker defined symbols

Trying to use the SEC_LINKER_CREATED section flag to determine whether
a symbol is linker defined fails to work on targets like alpha that
define special SEC_COMMON sections.  These might contain symbols that
originated in an object file.

include/
* bfdlink.h (struct bfd_link_hash_entry): Comment non_ir_ref.  Add
linker_def.
bfd/
* elflink.c (_bfd_elf_define_linkage_sym): Set linker_def.
* linker.c (_bfd_generic_link_add_one_symbol): Clear linker_def
for CDEF, DEF, DEFW, COM.
ld/
* ldexp.c (exp_fold_tree_1 <etree_provide>): Test linker_def.
ld/testsuite/
* ld-powerpc/sdabase.s,
* ld-powerpc/sdabase.t,
* ld-powerpc/sdabase.d: New test.
* ld-powerpc/sdabase2.t,
* ld-powerpc/sdabase2.d: New test.
* ld-powerpc/powerpc.exp: Run them.
14 files changed:
bfd/ChangeLog
bfd/elflink.c
bfd/linker.c
include/ChangeLog
include/bfdlink.h
ld/ChangeLog
ld/ldexp.c
ld/testsuite/ChangeLog
ld/testsuite/ld-powerpc/powerpc.exp
ld/testsuite/ld-powerpc/sdabase.d [new file with mode: 0644]
ld/testsuite/ld-powerpc/sdabase.s [new file with mode: 0644]
ld/testsuite/ld-powerpc/sdabase.t [new file with mode: 0644]
ld/testsuite/ld-powerpc/sdabase2.d [new file with mode: 0644]
ld/testsuite/ld-powerpc/sdabase2.t [new file with mode: 0644]