binutils-gdb/ld/testsuite
Alan Modra 9a23f96e91 PowerPC TPREL16_HA/LO reloc optimization
In the TLS GD/LD to LE optimization, ld replaces a sequence like

 addi 3,2,x@got@tlsgd		R_PPC64_GOT_TLSGD16	x
 bl __tls_get_addr(x@tlsgd)	R_PPC64_TLSGD		x
				R_PPC64_REL24		__tls_get_addr
 nop

with

 addis 3,13,x@tprel@ha		R_PPC64_TPREL16_HA	x
 addi 3,3,x@tprel@l		R_PPC64_TPREL16_LO	x
 nop

When the tprel offset is small, this can be further optimized to

 nop
 addi 3,13,x@tprel
 nop

bfd/
	* elf64-ppc.c (struct ppc_link_hash_table): Add do_tls_opt.
	(ppc64_elf_tls_optimize): Set it.
	(ppc64_elf_relocate_section): Nop addis on TPREL16_HA, and convert
	insn on TPREL16_LO and TPREL16_LO_DS relocs to use r13 when
	addis would add zero.
	* elf32-ppc.c (struct ppc_elf_link_hash_table): Add do_tls_opt.
	(ppc_elf_tls_optimize): Set it.
	(ppc_elf_relocate_section): Nop addis on TPREL16_HA, and convert
	insn on TPREL16_LO relocs to use r2 when addis would add zero.
gold/
	* powerpc.cc (Target_powerpc::Relocate::relocate): Nop addis on
	TPREL16_HA, and convert insn on TPREL16_LO and TPREL16_LO_DS
	relocs to use r2/r13 when addis would add zero.
ld/
	* testsuite/ld-powerpc/tls.s: Add calls with tls markers.
	* testsuite/ld-powerpc/tls32.s: Likewise.
	* testsuite/ld-powerpc/powerpc.exp: Run tls marker tests.
	* testsuite/ld-powerpc/tls.d: Adjust for TPREL16_HA/LO optimization.
	* testsuite/ld-powerpc/tlsexe.d: Likewise.
	* testsuite/ld-powerpc/tlsexetoc.d: Likewise.
	* testsuite/ld-powerpc/tlsld.d: Likewise.
	* testsuite/ld-powerpc/tlsmark.d: Likewise.
	* testsuite/ld-powerpc/tlsopt4.d: Likewise.
	* testsuite/ld-powerpc/tlstoc.d: Likewise.
2017-08-30 20:43:31 +09:30
..
config LD_CLASS: Check .libs/ld-new for linker first 2017-08-09 16:38:09 -07:00
ld-aarch64 More support for ld --hash-style in the ld testsuite 2017-08-08 07:22:36 +09:30
ld-alpha Support different ld --hash-style in the ld testsuite 2017-08-07 22:10:51 +09:30
ld-arc Support different ld --hash-style in the ld testsuite 2017-08-07 22:10:51 +09:30
ld-arm More support for ld --hash-style in the ld testsuite 2017-08-08 07:22:36 +09:30
ld-auto-import
ld-avr This patch introduces support for specifing views in .loc directives, so that the compiler can use the assembler to generate line number information and have the assembler determine view numbers to multiple views at the same program counter. 2017-07-21 10:13:18 +01:00
ld-bootstrap
ld-cdtest
ld-checks
ld-cris testsuite/ld-cris various files: Run ld with --hash-style=sysv. 2017-08-30 02:27:14 +02:00
ld-crx
ld-cygwin
ld-d10v
ld-discard
ld-elf ld: Add "--" after regexp 2017-08-24 17:45:24 -07:00
ld-elfcomm Fix spelling typos. 2017-07-18 16:58:14 +01:00
ld-elfvers
ld-elfvsb Support different ld --hash-style in the ld testsuite 2017-08-07 22:10:51 +09:30
ld-elfweak
ld-fastcall
ld-frv More support for ld --hash-style in the ld testsuite 2017-08-08 07:22:36 +09:30
ld-gc Remove pr19161 test hppa xfail 2017-08-23 08:58:42 +09:30
ld-h8300
ld-i386 Disallow copy relocation against protected data symbol 2017-08-26 19:26:21 -07:00
ld-ia64 Support different ld --hash-style in the ld testsuite 2017-08-07 22:10:51 +09:30
ld-ifunc Support different ld --hash-style in the ld testsuite 2017-08-07 22:10:51 +09:30
ld-libs
ld-linkonce
ld-m68hc11
ld-m68k Support different ld --hash-style in the ld testsuite 2017-08-07 22:10:51 +09:30
ld-mep
ld-metag Support different ld --hash-style in the ld testsuite 2017-08-07 22:10:51 +09:30
ld-mips-elf MIPS/LD: Fix a segfault from ELF `e_flags' access with non-ELF output BFD 2017-07-07 17:58:03 +01:00
ld-misc
ld-mmix PR ld/20125, MMIX weak symbols 2017-08-21 03:43:35 +02:00
ld-mn10300
ld-msp430-elf Improve MSP430 section placement. 2017-08-29 17:18:43 +01:00
ld-nds32
ld-nios2
ld-pe
ld-pie
ld-plugin
ld-powerpc PowerPC TPREL16_HA/LO reloc optimization 2017-08-30 20:43:31 +09:30
ld-pru
ld-s390 Support different ld --hash-style in the ld testsuite 2017-08-07 22:10:51 +09:30
ld-scripts Support different ld --hash-style in the ld testsuite 2017-08-07 22:10:51 +09:30
ld-selective Support single digit GCC version 2017-07-11 08:41:22 -07:00
ld-sh Support different ld --hash-style in the ld testsuite 2017-08-07 22:10:51 +09:30
ld-shared Support different ld --hash-style in the ld testsuite 2017-08-07 22:10:51 +09:30
ld-size
ld-sparc Support different ld --hash-style in the ld testsuite 2017-08-07 22:10:51 +09:30
ld-spu
ld-srec
ld-tic6x Support different ld --hash-style in the ld testsuite 2017-08-07 22:10:51 +09:30
ld-tilegx
ld-tilepro
ld-undefined Test undefined symbols in shared libraries 2017-08-24 16:43:39 +09:30
ld-unique Don't fail in elf32_hppa_set_gp 2017-08-05 23:28:21 +09:30
ld-v850
ld-vax-elf Support different ld --hash-style in the ld testsuite 2017-08-07 22:10:51 +09:30
ld-versados
ld-visium
ld-vxworks
ld-x86-64 Disallow copy relocation against protected data symbol 2017-08-26 19:26:21 -07:00
ld-xc16x
ld-xstormy16
ld-xtensa Support different ld --hash-style in the ld testsuite 2017-08-07 22:10:51 +09:30
ld-z8k
lib ld: Add "--" after regexp 2017-08-24 17:45:24 -07: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