binutils-gdb/ld/testsuite
Eric Botcazou f8745e1cd1 PR ld/22972 on SPARC.
This is a regression for the corner case of a hidden symbol in a PIC/PIE
binary which is subject to both a new-style GOTDATA relocation and an
old-style GOT relocation.  In this case, depending  on the link order,
the R_SPARC_RELATIVE dynamic relocation for the GOT slot needed because
of the old-style relocation can be replaced with R_SPARC_NONE coming
from the GOTDATA relocation.

The fix simply records whether an old-style GOT relocation is seen for a
symbol and prevents the R_SPARC_NONE from being generated in this case.

bfd/
	* elfxx-sparc.c (struct _bfd_sparc_elf_link_hash_entry): Add new flag
	has_old_style_got_reloc.
	(_bfd_sparc_elf_check_relocs) <GOT relocations>: Set it for old-style
	relocations.  Fix a couple of long lines.
	(_bfd_sparc_elf_relocate_section) <R_SPARC_GOTDATA_OP>: Do not generate
	a R_SPARC_NONE for the GOT slot if the symbol is also subject to
	old-style GOT relocations.
ld/
	* testsuite/ld-sparc/sparc.exp: Add test for mixed GOTDATA/GOT relocs.
	* testsuite/ld-sparc/gotop-hidden.c: New file.
	* testsuite/ld-sparc/got-hidden32.s: Likewise.
	* testsuite/ld-sparc/got-hidden64.s: Likewise.
	* testsuite/ld-sparc/pass.out: Likewise.
2018-03-28 12:17:15 +02:00
..
config
ld-aarch64 [PR20402][LD][AARCH64]Don't emit RELATIVE relocation for absolute symbols which are resolved at static linking time. 2018-03-07 14:47:27 +00:00
ld-alpha
ld-arc ld error/warning messages 2018-02-26 10:51:12 +10:30
ld-arm ld error/warning messages 2018-02-26 10:51:12 +10:30
ld-auto-import
ld-avr
ld-bootstrap
ld-cdtest
ld-checks
ld-cris ld error/warning messages 2018-02-26 10:51:12 +10:30
ld-crx
ld-cygwin
ld-d10v
ld-discard
ld-elf ld/testsuite: XFAIL pr20995-2 on aarch64*-*-elf* 2018-03-20 13:31:05 -07:00
ld-elfcomm ELF linker messages 2018-02-26 09:29:15 +10:30
ld-elfvers
ld-elfvsb
ld-elfweak
ld-fastcall
ld-frv
ld-gc gc.exp: Remove extraneous LD flags from the personality test 2018-03-20 11:48:59 +00:00
ld-h8300
ld-i386 x86: Treat relocation against IFUNC symbol as FUNC 2018-03-08 06:36:52 -08:00
ld-ia64
ld-ifunc Fix Sparc, s390 and AArch64 targets so that they can handle relocs against ifunc symbols found in note sections. 2018-03-09 14:37:36 +00:00
ld-libs
ld-linkonce
ld-m68hc11
ld-m68k
ld-mep
ld-metag
ld-mips-elf PR ld/21900: MIPS: Fix relocation processing with undefined symbols 2018-03-03 15:49:21 +00:00
ld-misc
ld-mmix ld error/warning messages 2018-02-26 10:51:12 +10:30
ld-mn10300
ld-msp430-elf
ld-nds32
ld-nios2
ld-pe
ld-pie
ld-plugin Adjust testsuite/ld-plugin/pr22983.d 2018-03-20 09:21:35 -07:00
ld-powerpc ld error/warning messages 2018-02-26 10:51:12 +10:30
ld-pru
ld-riscv-elf RISC-V: Give error for ignored pcrel_lo addend. 2018-02-15 10:53:46 -08:00
ld-s390
ld-scripts
ld-selective
ld-sh ld error/warning messages 2018-02-26 10:51:12 +10:30
ld-shared
ld-size
ld-sparc PR ld/22972 on SPARC. 2018-03-28 12:17:15 +02:00
ld-spu
ld-srec RISC-V: Disallow output format changes. 2018-03-06 12:01:50 -08:00
ld-tic6x ELF linker messages 2018-02-26 09:29:15 +10:30
ld-tilegx
ld-tilepro
ld-undefined ld error/warning messages 2018-02-26 10:51:12 +10:30
ld-unique RISC-V: Disallow output format changes. 2018-03-06 12:01:50 -08:00
ld-v850
ld-vax-elf
ld-versados
ld-visium
ld-vxworks
ld-x86-64 x86-64: Add ENDBR64 to the TLSDESC PLT entry 2018-03-25 05:02:32 -07:00
ld-xc16x
ld-xstormy16
ld-xtensa
ld-z8k
lib
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