binutils-gdb/ld/testsuite
H.J. Lu cd04836359 x86: Remove the unused _GLOBAL_OFFSET_TABLE_
Since _GLOBAL_OFFSET_TABLE_ may be referenced implicitly on x86,
checking ref_regular_nonweak leaves the unused _GLOBAL_OFFSET_TABLE_
in output.  This patch checks explicit GOT references instead.

ld-i386/discarded1.s and ld-x86-64/discarded1.s are updated to avoid
linker optimization which removes GOT references.

bfd/

	PR ld/22782
	* elf32-i386.c (elf_i386_check_relocs): Set got_referenced if
	_GLOBAL_OFFSET_TABLE_ is referenced or GOT is needed to resolve
	undefined weak symbol to 0.
	* elf64-x86-64.c (elf_x86_64_check_relocs): Set got_referenced
	if _GLOBAL_OFFSET_TABLE_ is referenced.
	* elfxx-x86.c (_bfd_x86_elf_size_dynamic_sections): Check
	got_referenced instead of ref_regular_nonweak.  Remove the
	unused _GLOBAL_OFFSET_TABLE_ from symbol table.
	* elfxx-x86.h (elf_x86_link_hash_table): Add got_referenced.

ld/

	PR ld/22782
	* testsuite/ld-i386/discarded1.s: Replace mov with div.
	* testsuite/ld-x86-64/discarded1.s: Likewise.
	* testsuite/ld-i386/i386.exp: Run pr22782.
	* testsuite/ld-i386/load1-nacl.d: Updated for removing
	_GLOBAL_OFFSET_TABLE_ from output.
	* testsuite/ld-i386/load1.d: Likewise.
	* testsuite/ld-x86-64/load1a-nacl.d: Likewise.
	* testsuite/ld-x86-64/load1a.d: Likewise.
	* testsuite/ld-x86-64/load1b-nacl.d: Likewise.
	* testsuite/ld-x86-64/load1b.d: Likewise.
	* testsuite/ld-i386/pr22782.d: New file.
	* testsuite/ld-i386/pr22782.s: Likewise.
	* testsuite/ld-x86-64/pr22782.s: Likewise.
	* testsuite/ld-x86-64/pr22782a.d: Likewise.
	* testsuite/ld-x86-64/pr22782b.d: Likewise.
	* testsuite/ld-x86-64/x86-64.exp: Run pr22782a and pr22782b.
2018-02-05 08:38:16 -08:00
..
config ld: Skip unsupported static executable tests 2018-01-29 04:55:23 -08:00
ld-aarch64 [LD][AARCH64]Add group relocations to create PC-relative offset. 2018-01-24 16:20:05 +00:00
ld-alpha Update year range in copyright notice of binutils files 2018-01-03 17:49:56 +10:30
ld-arc Update year range in copyright notice of binutils files 2018-01-03 17:49:56 +10:30
ld-arm Update year range in copyright notice of binutils files 2018-01-03 17:49:56 +10:30
ld-auto-import Update year range in copyright notice of binutils files 2018-01-03 17:49:56 +10:30
ld-avr Update year range in copyright notice of binutils files 2018-01-03 17:49:56 +10:30
ld-bootstrap ld: Skip unsupported static executable tests 2018-01-29 04:55:23 -08:00
ld-cdtest Update year range in copyright notice of binutils files 2018-01-03 17:49:56 +10:30
ld-checks Update year range in copyright notice of binutils files 2018-01-03 17:49:56 +10:30
ld-cris Update year range in copyright notice of binutils files 2018-01-03 17:49:56 +10:30
ld-crx Update year range in copyright notice of binutils files 2018-01-03 17:49:56 +10:30
ld-cygwin Update year range in copyright notice of binutils files 2018-01-03 17:49:56 +10:30
ld-d10v Update year range in copyright notice of binutils files 2018-01-03 17:49:56 +10:30
ld-discard Update year range in copyright notice of binutils files 2018-01-03 17:49:56 +10:30
ld-elf LD/testsuite: Pass $AFLAGS_PIC to GAS for PIC assembly 2018-02-02 18:08:04 +00:00
ld-elfcomm Update year range in copyright notice of binutils files 2018-01-03 17:49:56 +10:30
ld-elfvers Update year range in copyright notice of binutils files 2018-01-03 17:49:56 +10:30
ld-elfvsb Update year range in copyright notice of binutils files 2018-01-03 17:49:56 +10:30
ld-elfweak Update year range in copyright notice of binutils files 2018-01-03 17:49:56 +10:30
ld-fastcall Update year range in copyright notice of binutils files 2018-01-03 17:49:56 +10:30
ld-frv Update year range in copyright notice of binutils files 2018-01-03 17:49:56 +10:30
ld-gc MIPS/LD/testsuite: Correct dynamic links with VR4100, VR4300 and VR5000 2018-01-31 14:47:12 +00:00
ld-h8300 Update year range in copyright notice of binutils files 2018-01-03 17:49:56 +10:30
ld-i386 x86: Remove the unused _GLOBAL_OFFSET_TABLE_ 2018-02-05 08:38:16 -08:00
ld-ia64 Update year range in copyright notice of binutils files 2018-01-03 17:49:56 +10:30
ld-ifunc ld: Skip unsupported static executable tests 2018-01-29 04:55:23 -08:00
ld-libs Update year range in copyright notice of binutils files 2018-01-03 17:49:56 +10:30
ld-linkonce Update year range in copyright notice of binutils files 2018-01-03 17:49:56 +10:30
ld-m68hc11 Update year range in copyright notice of binutils files 2018-01-03 17:49:56 +10:30
ld-m68k Update year range in copyright notice of binutils files 2018-01-03 17:49:56 +10:30
ld-mep Update year range in copyright notice of binutils files 2018-01-03 17:49:56 +10:30
ld-metag Update year range in copyright notice of binutils files 2018-01-03 17:49:56 +10:30
ld-mips-elf MIPS/LD/testsuite: Correct dynamic links with VR4100, VR4300 and VR5000 2018-01-31 14:47:12 +00:00
ld-misc Update year range in copyright notice of binutils files 2018-01-03 17:49:56 +10:30
ld-mmix Update year range in copyright notice of binutils files 2018-01-03 17:49:56 +10:30
ld-mn10300 Update year range in copyright notice of binutils files 2018-01-03 17:49:56 +10:30
ld-msp430-elf Update year range in copyright notice of binutils files 2018-01-03 17:49:56 +10:30
ld-nds32 Update year range in copyright notice of binutils files 2018-01-03 17:49:56 +10:30
ld-nios2
ld-pe Update year range in copyright notice of binutils files 2018-01-03 17:49:56 +10:30
ld-pie Update year range in copyright notice of binutils files 2018-01-03 17:49:56 +10:30
ld-plugin Add a testcase for PR ld/22751 2018-01-27 16:04:34 -08:00
ld-powerpc PowerPC PLT speculative execution barriers 2018-01-17 18:52:57 +10:30
ld-pru
ld-riscv-elf RISC-V: Fix accidental embedded -shared regressions. 2018-01-08 17:55:29 -08:00
ld-s390 Update year range in copyright notice of binutils files 2018-01-03 17:49:56 +10:30
ld-scripts ld: Fix issue where PROVIDE overrides defined symbol 2018-01-11 17:35:35 +00:00
ld-selective Update year range in copyright notice of binutils files 2018-01-03 17:49:56 +10:30
ld-sh Update year range in copyright notice of binutils files 2018-01-03 17:49:56 +10:30
ld-shared Update year range in copyright notice of binutils files 2018-01-03 17:49:56 +10:30
ld-size Update year range in copyright notice of binutils files 2018-01-03 17:49:56 +10:30
ld-sparc Fix PR ld/22727 (TLS breakage in PIC/PIE mode on SPARC). 2018-01-25 12:16:06 +01:00
ld-spu Update year range in copyright notice of binutils files 2018-01-03 17:49:56 +10:30
ld-srec Update year range in copyright notice of binutils files 2018-01-03 17:49:56 +10:30
ld-tic6x Update year range in copyright notice of binutils files 2018-01-03 17:49:56 +10:30
ld-tilegx Update year range in copyright notice of binutils files 2018-01-03 17:49:56 +10:30
ld-tilepro Update year range in copyright notice of binutils files 2018-01-03 17:49:56 +10:30
ld-undefined Update year range in copyright notice of binutils files 2018-01-03 17:49:56 +10:30
ld-unique Update year range in copyright notice of binutils files 2018-01-03 17:49:56 +10:30
ld-v850 Update year range in copyright notice of binutils files 2018-01-03 17:49:56 +10:30
ld-vax-elf Update year range in copyright notice of binutils files 2018-01-03 17:49:56 +10:30
ld-versados Update year range in copyright notice of binutils files 2018-01-03 17:49:56 +10:30
ld-visium Update year range in copyright notice of binutils files 2018-01-03 17:49:56 +10:30
ld-vxworks Update year range in copyright notice of binutils files 2018-01-03 17:49:56 +10:30
ld-x86-64 x86: Remove the unused _GLOBAL_OFFSET_TABLE_ 2018-02-05 08:38:16 -08:00
ld-xc16x Update year range in copyright notice of binutils files 2018-01-03 17:49:56 +10:30
ld-xstormy16 Update year range in copyright notice of binutils files 2018-01-03 17:49:56 +10:30
ld-xtensa Update year range in copyright notice of binutils files 2018-01-03 17:49:56 +10:30
ld-z8k Update year range in copyright notice of binutils files 2018-01-03 17:49:56 +10:30
lib ld: Skip unsupported static executable tests 2018-01-29 04:55:23 -08:00
ChangeLog-2004
ChangeLog-2005
ChangeLog-2006
ChangeLog-2007
ChangeLog-2008
ChangeLog-2009
ChangeLog-2010
ChangeLog-2011
ChangeLog-2012
ChangeLog-2013
ChangeLog-2014
ChangeLog-2015
ChangeLog-9303