binutils-gdb/ld/testsuite/ld-elf
H.J. Lu 6e33951edc Properly merge hidden versioned symbol
The hidden versioned symbol can only be merged with the versioned
symbol with the same symbol version.  _bfd_elf_merge_symbol should
check the symbol version before merging the new hidden versioned
symbol with the existing symbol.  _bfd_elf_link_hash_copy_indirect can't
copy any references to the hidden versioned symbol.   We need to
bind a symbol locally when linking executable if it is locally defined,
hidden versioned, not referenced by shared library and not exported.

bfd/

	PR ld/18720
	* elflink.c (_bfd_elf_merge_symbol): Add a parameter to indicate
	if the new symbol matches the existing one.  The new hidden
	versioned symbol matches the existing symbol if they have the
	same symbol version. Update the existing symbol only if they
	match.
	(_bfd_elf_add_default_symbol): Update call to
	_bfd_elf_merge_symbol.
	(_bfd_elf_link_assign_sym_version): Don't set the hidden field
	here.
	(elf_link_add_object_symbols): Override a definition only if the
	new symbol matches the existing one.
	(_bfd_elf_link_hash_copy_indirect): Don't copy any references to
	the hidden versioned symbol.
	(elf_link_output_extsym): Bind a symbol locally when linking
	executable if it is locally defined, hidden versioned, not
	referenced by shared library and not exported.  Turn on
	VERSYM_HIDDEN only if the hidden vesioned symbol is defined
	locally.

ld/testsuite/

	PR ld/18720
	* ld-elf/indirect.exp: Run tests for PR ld/18720.
	* ld-elf/pr18720.out: New file.
	* ld-elf/pr18720a.c: Likewise.
	* ld-elf/pr18720b.c: Likewise.
	* ld-elf/pr18720c.c: Likewise.
2015-08-07 05:04:35 -07:00
..
audit.exp ChangeLog rotatation and copyright year update 2015-01-02 00:53:45 +10:30
audit.rd
begin.c
beginwarn.c
binutils.exp ChangeLog rotatation and copyright year update 2015-01-02 00:53:45 +10:30
check-ptr-eq.c Check address of versined symbol 2015-07-27 10:11:33 -07:00
comm1.c
comm-data1.s
comm-data1.sd
comm-data2.ld
comm-data2.rd
comm-data2.s
comm-data2.sd
comm-data2.xd
comm-data2r.rd
comm-data2r.sd
comm-data2r.xd
comm-data3.sd
comm-data3a.s
comm-data3b.s
comm-data4.d
comm-data4.s
comm-data5.d
comm-data5.s
comm-data.exp ChangeLog rotatation and copyright year update 2015-01-02 00:53:45 +10:30
commonpage1.d
commonpage2.d
compress1.s ChangeLog rotatation and copyright year update 2015-01-02 00:53:45 +10:30
compress1a.d
compress1b.d
compress1c.d
compress.exp Replace -g with -ggdb3 in ld compress tests 2015-07-24 04:16:56 -07:00
compressed1a.d Add SHF_COMPRESSED support to gas and objcopy 2015-04-08 07:54:09 -07:00
compressed1b.d Add SHF_COMPRESSED support to gas and objcopy 2015-04-08 07:54:09 -07:00
compressed1c.d Add SHF_COMPRESSED support to gas and objcopy 2015-04-08 07:54:09 -07:00
compressed1d.d Fixes a typo in the list of targets that should not run the compressed1d test. 2015-06-05 16:48:01 +01:00
compressed1e.d Correct ld-elf/compressed1e.d to use notarget and for cris-elf, not cris-*. 2015-04-24 06:10:19 +02:00
data1.c
data1.h
data2.c
del.cc
depaudit2.rd
depaudit.rd
discard1.d
discard1.s
discard2.d
discard2.s
discard3.d
discard.ld
dl1.c
dl1.list
dl1.out
dl1main.c
dl2.c
dl2.list
dl2a.list
dl2a.out
dl2b.out
dl2main.c
dl2xxx.c
dl2xxx.list
dl3.cc
dl3.list
dl3a.out
dl3b.out
dl3header.h
dl3main.cc
dl4.c
dl4.list
dl4a.out
dl4b.out
dl4main.c
dl4xxx.c
dl4xxx.list
dl5.cc
dl5.out
dl6.c
dl6a.out
dl6amain.c
dl6b.out
dl6bmain.c
dl6cmain.c
dl6dmain.c
dummy.c
dwarf1.c
dwarf1.h
dwarf1.out
dwarf1main.c
dwarf.exp ChangeLog rotatation and copyright year update 2015-01-02 00:53:45 +10:30
dynamic1.d
dynamic1.ld
dynamic1.s
dynamic-1.c
dynamic-1.rd
dynamic-1.syms
dynbss1.c
dynsym1.d
eh1.d Discard zero address range eh_frame FDEs 2014-10-04 22:49:32 +09:30
eh1.s Discard zero address range eh_frame FDEs 2014-10-04 22:49:32 +09:30
eh1a.s
eh2.d Discard zero address range eh_frame FDEs 2014-10-04 22:49:32 +09:30
eh2a.s
eh3.d Discard zero address range eh_frame FDEs 2014-10-04 22:49:32 +09:30
eh3.s Discard zero address range eh_frame FDEs 2014-10-04 22:49:32 +09:30
eh3a.s
eh4.d
eh4.s
eh4a.s
eh5.d Add Visium support to ld 2014-12-06 16:45:22 +01:00
eh5.s
eh5a.s
eh5b.s
eh6.d
eh6.s
eh-frame-hdr.d Add Visium support to ld 2014-12-06 16:45:22 +01:00
eh-frame-hdr.s
eh-group1.s
eh-group2.s
eh-group.exp ChangeLog rotatation and copyright year update 2015-01-02 00:53:45 +10:30
ehdr_start-missing.d
ehdr_start-missing.t
ehdr_start-shared.d
ehdr_start-strongref.s
ehdr_start-userdef.d
ehdr_start-userdef.t
ehdr_start-weak.d Strip undefined symbols from .symtab 2015-02-19 13:36:34 +10:30
ehdr_start.d
ehdr_start.s
elf.exp Fix broken -Bsymbolic-functions 2015-07-25 20:41:04 +09:30
empty2.d
empty2.s
empty.d
empty.s
end.c
endhidden.c
endprotected.c
endsym.d Don't PROVIDE over top of common symbols 2014-12-23 23:36:50 +10:30
endsym.s Don't PROVIDE over top of common symbols 2014-12-23 23:36:50 +10:30
exclude1.s
exclude2.s
exclude3.s
exclude3a.d
exclude3b.d
exclude3c.d
exclude.exp ChangeLog rotatation and copyright year update 2015-01-02 00:53:45 +10:30
export-class-def.s
export-class-dep.s
export-class-lib.s
export-class-lib.ver
export-class-ref.s
export-class.exp ChangeLog rotatation and copyright year update 2015-01-02 00:53:45 +10:30
export-class.sd
export-class.vd
expr1.d
expr1.s
expr1.t
extract-symbol-1.ld
extract-symbol-1.s
extract-symbol-1sec.d Adds support for generating notes in V850 binaries. 2015-02-24 17:54:09 +00:00
extract-symbol-1sym.d
fini0.s
fini1.s
fini2.s
fini3.s
fini.c
fini.out
finin.s
flags1.d Add Visium support to ld 2014-12-06 16:45:22 +01:00
flags1.ld
flags1.s
foo0.s
foo1.s
foo2.s
foo3.s
foo.c
foo.map
foon.s
frame.exp ChangeLog rotatation and copyright year update 2015-01-02 00:53:45 +10:30
frame.s
func1.c
gabiend.rt Add --compress-debug-sections=[none|zlib|zlib-gnu|zlib-gabi] 2015-04-14 22:01:38 -07:00
gabinormal.rt Add --compress-debug-sections=[none|zlib|zlib-gnu|zlib-gabi] 2015-04-14 22:01:38 -07:00
gap.s Assign file position for .strtab only if needed 2014-12-30 19:09:11 -08:00
global1.d
gnubegin.rS Add --compress-debug-sections=[none|zlib|zlib-gnu|zlib-gabi] 2015-04-14 22:01:38 -07:00
gnunormal.rS Add --compress-debug-sections=[none|zlib|zlib-gnu|zlib-gabi] 2015-04-14 22:01:38 -07:00
group1.d Strip undefined symbols from .symtab 2015-02-19 13:36:34 +10:30
group1a.s
group1b.s
group2.d
group3a.d
group3a.s
group3b.d Remove support for the (deprecated) openrisc and or32 configurations and replace 2014-04-22 15:57:47 +01:00
group3b.s
group4.d
group5.d
group6.d
group7.d
group8.s
group8a.d Remove support for the (deprecated) openrisc and or32 configurations and replace 2014-04-22 15:57:47 +01:00
group8b.d Remove support for the (deprecated) openrisc and or32 configurations and replace 2014-04-22 15:57:47 +01:00
group9.s
group9a.d Remove support for the (deprecated) openrisc and or32 configurations and replace 2014-04-22 15:57:47 +01:00
group9b.d Remove support for the (deprecated) openrisc and or32 configurations and replace 2014-04-22 15:57:47 +01:00
group10.d
group10.s
group.ld [MIPS] Implement O32 FPXX, FP64 and FP64A ABI extensions 2014-07-29 11:27:59 +01:00
hash.d
header.d
header.s
header.t
hidden.out
indirect1a.c
indirect1b.c
indirect1c.c
indirect2.c
indirect3.out
indirect3a.c
indirect3b.c
indirect3c.c
indirect4.out
indirect4a.c
indirect4b.c
indirect4c.c
indirect.exp Properly merge hidden versioned symbol 2015-08-07 05:04:35 -07:00
init0.s
init1.s
init2.s
init3.s
init-fini-arrays.d
init-fini-arrays.s
init-mixed.c
init-mixed.out
init.c
init.out
initn.s
libbarw.rd
linkinfo1.s
linkinfo1a.d Properly set sh_info for .rela.plt/rel.plt section 2015-03-30 04:40:49 -07:00
linkinfo1b.d Properly set sh_info for .rela.plt/rel.plt section 2015-03-30 04:40:49 -07:00
linkonce1.d
linkonce1a.s
linkonce1b.s
linkonce2.d Remove support for the (deprecated) openrisc and or32 configurations and replace 2014-04-22 15:57:47 +01:00
linkoncerdiff1.s
linkoncerdiff2.s
linkoncerdiff.d
lma.lnk
lma.s
loadaddr1.d
loadaddr1.t
loadaddr2.d
loadaddr2.t
loadaddr3.t
loadaddr3a.d
loadaddr3b.d
loadaddr.s
loadaddr.t
local1.d
local1.map
local1.s
main.c
maxpage1.d
maxpage1.s
maxpage2.d
maxpage3.t
maxpage3a.d
maxpage3b.d
maxpage3c.d
maxpage4.d
maxpage4.t
maxpage5.d
maxpage5.s
maxpage5.t
merge2.d Remove support for the (deprecated) openrisc and or32 configurations and replace 2014-04-22 15:57:47 +01:00
merge2.s
merge3.d Add aligned string merge test 2015-02-25 00:15:26 +10:30
merge3.s Add aligned string merge test 2015-02-25 00:15:26 +10:30
merge.d
merge.ld
merge.s
multibss1.d
multibss1.s
needed1.out
needed1a.c
needed1b.c
needed1c.c
needed2.ver
needed2a.c
needed2b.c
needed2c.c
needed3.c PR 17287, DT_NEEDED of unneeded libraries affects --as-needed 2014-08-18 18:45:01 +09:30
new.cc
nobits-1.d
nobits-1.s
nobits-1.t
noload-1.d
noload-1.s
noload-1.t
noload-2.d
noload-3.d
noload-3.s
noload-3.t
normal.out
note-1.d
note-1.s
note-1.t
note-2.d
note-2.s
note-2.t
note-3.l
note-3.s
note-3.t
now-1.d
now-2.d
now-3.d
now-4.d
orphan2.d
orphan2.s
orphan3.d Remove support for the (deprecated) openrisc and or32 configurations and replace 2014-04-22 15:57:47 +01:00
orphan3a.s
orphan3b.s
orphan3c.s
orphan3d.s
orphan3e.s
orphan3f.s
orphan4.d
orphan4.ld
orphan4.s
orphan-5.l Add new linker option: --warn-orphan which generates warning messages when orphan sections are detected. 2015-04-07 16:29:41 +01:00
orphan-region.d Remove support for the (deprecated) openrisc and or32 configurations and replace 2014-04-22 15:57:47 +01:00
orphan-region.ld [MIPS] Implement O32 FPXX, FP64 and FP64A ABI extensions 2014-07-29 11:27:59 +01:00
orphan-region.s
orphan.d Remove support for the (deprecated) openrisc and or32 configurations and replace 2014-04-22 15:57:47 +01:00
orphan.ld [MIPS] Implement O32 FPXX, FP64 and FP64A ABI extensions 2014-07-29 11:27:59 +01:00
orphan.s
overlay.d
overlay.s
overlay.t
pass.out
pr349-1.s
pr349-2.s
pr349.d Remove support for the (deprecated) openrisc and or32 configurations and replace 2014-04-22 15:57:47 +01:00
pr2404.out
pr2404a.c
pr2404b.c
pr9676-1.c
pr9676-2.c
pr9676-3.c
pr9676-4.c
pr9676.rd
pr9679-1.c
pr9679-2.c
pr9679.rd
pr11138-1.c
pr11138-1.map
pr11138-2.c
pr11138-2.map
pr11138.out
pr11304.d
pr11304a.s
pr11304b.s
pr12851.d Remove support for the (deprecated) openrisc and or32 configurations and replace 2014-04-22 15:57:47 +01:00
pr12851.s
pr12975.d Remove support for the (deprecated) openrisc and or32 configurations and replace 2014-04-22 15:57:47 +01:00
pr12975.s
pr12975.t
pr13177.d Remove support for the (deprecated) openrisc and or32 configurations and replace 2014-04-22 15:57:47 +01:00
pr13177.s
pr13195.c
pr13195.d Remove support for the (deprecated) openrisc and or32 configurations and replace 2014-04-22 15:57:47 +01:00
pr13195.s
pr13195.t
pr13250-1.c
pr13250-2.c
pr13250-3.c
pr13839.d
pr13839.s
pr13839.t
pr14052.d
pr14052.t
pr14156a.d
pr14156b.d
pr14156c.d
pr14156c.t
pr14170a.s
pr14170b.s
pr14170c.s
pr14323-1.c
pr14323-2.c
pr14525.c
pr14525.out
pr14862-1.c
pr14862-2.c
pr14862.map
pr14862.out
pr14926.d Add Visium support to ld 2014-12-06 16:45:22 +01:00
pr14926.s
pr16322.d
pr16322.s ld: don't use ia64 register name in expression of pr16322 test 2015-01-28 10:04:51 +01:00
pr16452.map Add tests for PR ld/16452 and PR ld/16457 2014-12-01 06:06:21 -08:00
pr16452.od Add tests for PR ld/16452 and PR ld/16457 2014-12-01 06:06:21 -08:00
pr16452a.c Add tests for PR ld/16452 and PR ld/16457 2014-12-01 06:06:21 -08:00
pr16452b.c Add tests for PR ld/16452 and PR ld/16457 2014-12-01 06:06:21 -08:00
pr16457.od Add tests for PR ld/16452 and PR ld/16457 2014-12-01 06:06:21 -08:00
pr16496a.c Display symbol version when dumping dynrelocs 2014-11-25 06:47:44 -08:00
pr16496a.map Display symbol version when dumping dynrelocs 2014-11-25 06:47:44 -08:00
pr16496b.c Display symbol version when dumping dynrelocs 2014-11-25 06:47:44 -08:00
pr16496b.od Display symbol version when dumping dynrelocs 2014-11-25 06:47:44 -08:00
pr16498a.d
pr16498a.s
pr16498a.t
pr16498b.d
pr16498b.t
pr17068.s Reload --as-needed libraries inside groups 2014-07-03 17:05:42 +09:30
pr17068a.s Reload --as-needed libraries inside groups 2014-07-03 17:05:42 +09:30
pr17068b.s Reload --as-needed libraries inside groups 2014-07-03 17:05:42 +09:30
pr17068c.s Reload --as-needed libraries inside groups 2014-07-03 17:05:42 +09:30
pr17068d.s Reload --as-needed libraries inside groups 2014-07-03 17:05:42 +09:30
pr17068e.s Reload --as-needed libraries inside groups 2014-07-03 17:05:42 +09:30
pr17068ez.s Reload --as-needed libraries inside groups 2014-07-03 17:05:42 +09:30
pr17615.d Fix pr17615 testcase 2015-01-20 11:12:35 +10:30
pr17615.s Add a testcase for PR ld/17615 2015-01-19 09:23:29 -08:00
pr18458a.c Convert PLT reloc only if pointer equality isn't needed 2015-05-27 14:32:24 -07:00
pr18458b.c Convert PLT reloc only if pointer equality isn't needed 2015-05-27 14:32:24 -07:00
pr18458c.c Convert PLT reloc only if pointer equality isn't needed 2015-05-27 14:32:24 -07:00
pr18718.c Use noclone attribute only for GCC 4.5 or newer 2015-07-29 11:20:04 -07:00
pr18720.out Properly merge hidden versioned symbol 2015-08-07 05:04:35 -07:00
pr18720a.c Properly merge hidden versioned symbol 2015-08-07 05:04:35 -07:00
pr18720b.c Properly merge hidden versioned symbol 2015-08-07 05:04:35 -07:00
pr18720c.c Properly merge hidden versioned symbol 2015-08-07 05:04:35 -07:00
pr18735.d Don't change the default symbol for relocatable link 2015-07-30 03:28:00 -07:00
pr18735.s Don't change the default symbol for relocatable link 2015-07-30 03:28:00 -07:00
preinit.c
preinit.out
provide-hidden-1.ld
provide-hidden-1.s
provide-hidden-2.ld
provide-hidden-2.s
provide-hidden-3.s
provide-hidden-4.s
provide-hidden-abs.nd
provide-hidden-def.nd
provide-hidden-dyn.nd
provide-hidden-dynabs.nd
provide-hidden-dynsec.nd
provide-hidden-s.ld
provide-hidden-s.nd
provide-hidden-sec.nd
provide-hidden.exp ChangeLog rotatation and copyright year update 2015-01-02 00:53:45 +10:30
rdynamic-1.c
rdynamic-1.rd
rel.c
relmain.c
relmain.out
relocatable.d
relocatable.t
relro1.s
relro2.s
rpath-1.d
rpath-2.d
runpath-1.d
runpath-2.d
sec64k.exp ChangeLog rotatation and copyright year update 2015-01-02 00:53:45 +10:30
sec-to-seg1.s
sec-to-seg2.s
sec-to-seg-script-adjoining-pages.t
sec-to-seg-script-disjoint-pages.t
sec-to-seg-script-same-page.t
sec-to-seg.exp ChangeLog rotatation and copyright year update 2015-01-02 00:53:45 +10:30
seg.d
seg.s
seg.t
shared.exp Check address of versined symbol 2015-07-27 10:11:33 -07:00
simple.s
stab.d
stack-exec.rd
stack-size.rd
stack.s
start.s
strtab.d Run ld-elf/strtab only on linux/gnu targets 2015-06-25 10:14:13 -07:00
strtab.s Use strtab with GC and suffix merging for .strtab 2015-06-25 08:16:14 -07:00
symbol1ref.s
symbol1w.s
symbol2ref.s
symbol2w.s
symbol3.s
symbol3w.s
symbolic-func.r Fix broken -Bsymbolic-functions 2015-07-25 20:41:04 +09:30
symbolic-func.s Fix broken -Bsymbolic-functions 2015-07-25 20:41:04 +09:30
table.s
tbss1.s
tbss2.s
tbss3.s
tbss.s
tdata1.s
tdata2.s
tdata3.s
textaddr1.d
textaddr2.d
textaddr3.d
textaddr4.d
textaddr5.d
textaddr6.d
textaddr7.d
tls_common.exp ChangeLog rotatation and copyright year update 2015-01-02 00:53:45 +10:30
tls_common.s
tls_gc.s
unknown2.d
unknown2.s
unknown.d
var1.d
var1.s
var1.t
warn1.d Remove support for the (deprecated) openrisc and or32 configurations and replace 2014-04-22 15:57:47 +01:00
warn2.d Remove support for the (deprecated) openrisc and or32 configurations and replace 2014-04-22 15:57:47 +01:00
warn3.d Remove support for the (deprecated) openrisc and or32 configurations and replace 2014-04-22 15:57:47 +01:00
warn.out
weak-dyn-1.ld
weak-dyn-1.rd
weak-dyn-1a.s
weak-dyn-1b.s
weakdef1.c
wrap1.c
wrap1.out
wrap1a.c
wrap1b.c
wrap.exp ChangeLog rotatation and copyright year update 2015-01-02 00:53:45 +10:30
zlibbegin.rS Replace -g with -ggdb3 in ld compress tests 2015-07-24 04:16:56 -07:00
zlibnormal.rS Replace -g with -ggdb3 in ld compress tests 2015-07-24 04:16:56 -07:00