binutils-gdb/ld/testsuite
H.J. Lu bc696fd5af Handle weak alias for PIE with copy reloc
When there is a weak symbol with a real definition, the processor
independent code will have arranged for us to see the real definition
first.  We need to copy the needs_copy bit from the real definition and
check it when allowing copy reloc in PIE.

bfd/

	PR ld/17689
	* elf64-x86-64.c (elf_x86_64_link_hash_entry): Add needs_copy.
	Change has_bnd_reloc to bit field.
	(elf_x86_64_link_hash_newfunc): Initialize needs_copy and
	has_bnd_reloc to 0.
	(elf_x86_64_check_relocs): Set has_bnd_reloc to 1 instead
	of TRUE.
	(elf_x86_64_adjust_dynamic_symbol): Copy needs_copy from the
	real definition to a weak symbol.
	(elf_x86_64_allocate_dynrelocs): Also check needs_copy of a
	weak symbol for PIE when discarding space for relocs against
	symbols which turn out to need copy relocs.
	(elf_x86_64_relocate_section): Also check needs_copy of a
	weak symbol for PIE with copy reloc.

ld/testsuite/

	PR ld/17689
	* ld-x86-64/pr17689.out: New file.
	* ld-x86-64/pr17689.rd: Likewise.
	* ld-x86-64/pr17689a.c: Likewise.
	* ld-x86-64/pr17689b.S: Likewise.

	* ld-x86-64/x86-64.exp: Run PR ld/17689 tests.
2014-12-13 23:39:56 -08:00
..
config
ld-aarch64 [AArch64] Cortex-A53 erratum 835769 linker workaround 2014-10-24 11:39:35 +01:00
ld-alpha Update ld-alpha tests for secureplt 2014-11-25 13:41:30 -08:00
ld-arm Calculate ARM arch attribute after relaxation 2014-11-21 11:54:39 +08:00
ld-auto-import
ld-avr When relaxing, update size of symbols. 2014-11-03 20:34:13 +00:00
ld-bootstrap
ld-cdtest
ld-checks
ld-cris Display symbol version when dumping dynrelocs 2014-11-25 06:47:44 -08:00
ld-crx
ld-cygwin
ld-d10v
ld-discard
ld-elf Add Visium support to ld 2014-12-06 16:45:22 +01:00
ld-elfcomm
ld-elfvers Display symbol version when dumping dynrelocs 2014-11-25 06:47:44 -08:00
ld-elfvsb
ld-elfweak
ld-fastcall
ld-frv
ld-gc
ld-h8300
ld-i386 Optimize out i386/x86-64 JUMP_SLOT relocation 2014-11-25 05:05:39 -08:00
ld-ia64
ld-ifunc Always load function pointer into a stack variable 2014-11-20 11:29:45 -08:00
ld-libs
ld-linkonce
ld-m68hc11
ld-m68k
ld-mep
ld-metag
ld-mips-elf [MIPS] When calculating a relocation using an undefined weak symbol don't check for overflow. 2014-12-02 13:27:36 +00:00
ld-misc
ld-mmix
ld-mn10300
ld-nds32
ld-nios2
ld-pe
ld-pie
ld-plugin Find lto plugin when using gcc-5.0 2014-09-22 19:04:48 +09:30
ld-powerpc Sort relocs output by ld -r 2014-12-04 17:37:58 +10:30
ld-s390
ld-scripts Fix ld tests with sysroot=/ and --enable-targets=all and test --print-sysroot 2014-10-17 13:11:42 +02:00
ld-selective
ld-sh Sort relocs output by ld -r 2014-12-04 17:37:58 +10:30
ld-shared
ld-size
ld-sparc
ld-spu
ld-srec
ld-tic6x
ld-tilegx
ld-tilepro
ld-undefined
ld-unique ld/testsuite/ld-unique: Fix running unique tests on ARM 2014-10-30 11:06:43 +00:00
ld-v850
ld-vax-elf
ld-versados
ld-visium Add Visium support to ld 2014-12-06 16:45:22 +01:00
ld-vxworks
ld-x86-64 Handle weak alias for PIE with copy reloc 2014-12-13 23:39:56 -08:00
ld-xc16x
ld-xstormy16
ld-xtensa
lib Add Visium support to ld 2014-12-06 16:45:22 +01:00
ChangeLog Handle weak alias for PIE with copy reloc 2014-12-13 23:39:56 -08:00
ChangeLog-2004
ChangeLog-2005
ChangeLog-2006
ChangeLog-2007
ChangeLog-2008
ChangeLog-2009
ChangeLog-2010
ChangeLog-2011
ChangeLog-2012
ChangeLog-2013
ChangeLog-9303