binutils-gdb/ld/testsuite
Alan Modra c213164ad2 [PowerPC64] pc-relative TLS relocations
This patch supports using pcrel instructions in TLS code sequences.  A
number of new relocations are needed, gas operand modifiers to
generate those relocations, and new TLS optimisation.  For
optimisation it turns out that the new pcrel GD and LD sequences can
be distinguished from the non-pcrel GD and LD sequences by there being
different relocations on the new sequence.  The final "add ra,rb,13"
on IE sequences similarly needs a new relocation, or as I chose, a
modification of R_PPC64_TLS.  On pcrel IE code, the R_PPC64_TLS points
one byte into the "add" instruction rather than being on the
instruction boundary.

GD:
 pla 3,z@got@tlsgd@pcrel	  # R_PPC64_GOT_TLSGD34
 bl __tls_get_addr@notoc(z@tlsgd) # R_PPC64_TLSGD and R_PPC64_REL24_NOTOC
  edited to IE
   pld 3,z@got@tprel@pcrel
   add 3,3,13
  edited to LE
   paddi 3,13,z@tprel
   nop

LD:
 pla 3,z@got@tlsld@pcrel	  # R_PPC64_GOT_TLSLD34
 bl __tls_get_addr@notoc(z@tlsld) # R_PPC64_TLSLD and R_PPC64_REL24_NOTOC
 ..
 paddi 9,3,z2@dtprel
 pld 10,z3@got@dtprel@pcrel
 add 10,10,3
  edited to LE
   paddi 3,13,0x1000
   nop

IE:
 pld 9,z@got@tprel@pcrel	  # R_PPC64_GOT_TPREL34
 add 3,9,z@tls@pcrel		  # R_PPC64_TLS at insn+1
 ldx 4,9,z@tls@pcrel
 lwax 5,9,z@tls@pcrel
 stdx 5,9,z@tls@pcrel
  edited to LE
  paddi 9,13,z@tprel
  nop
  ld 4,0(9)
  lwa 5,0(9)
  std 5,0(9)

LE:
 paddi 10,13,z@tprel

include/
	* elf/ppc64.h (R_PPC64_TPREL34, R_PPC64_DTPREL34),
	(R_PPC64_GOT_TLSGD34, R_PPC64_GOT_TLSLD34),
	(R_PPC64_GOT_TPREL34, R_PPC64_GOT_DTPREL34): Define.
	(IS_PPC64_TLS_RELOC): Include new tls relocs.
bfd/
	* reloc.c (BFD_RELOC_PPC64_TPREL34, BFD_RELOC_PPC64_DTPREL34),
	(BFD_RELOC_PPC64_GOT_TLSGD34, BFD_RELOC_PPC64_GOT_TLSLD34),
	(BFD_RELOC_PPC64_GOT_TPREL34, BFD_RELOC_PPC64_GOT_DTPREL34),
	(BFD_RELOC_PPC64_TLS_PCREL): New pcrel tls relocs.
	* elf64-ppc.c (ppc64_elf_howto_raw): Add howtos for pcrel tls relocs.
	(ppc64_elf_reloc_type_lookup): Translate pcrel tls relocs.
	(must_be_dyn_reloc, dec_dynrel_count): Add R_PPC64_TPREL64.
	(ppc64_elf_check_relocs): Support pcrel tls relocs.
	(ppc64_elf_tls_optimize, ppc64_elf_relocate_section): Likewise.
	* bfd-in2.h: Regenerate.
	* libbfd.h: Regenerate.
gas/
	* config/tc-ppc.c (ppc_elf_suffix): Map "tls@pcrel", "got@tlsgd@pcrel",
	"got@tlsld@pcrel", "got@tprel@pcrel", and "got@dtprel@pcrel".
	(fixup_size, md_assemble): Handle pcrel tls relocs.
	(ppc_force_relocation, ppc_fix_adjustable): Likewise.
	(md_apply_fix, tc_gen_reloc): Likewise.
ld/
	* testsuite/ld-powerpc/tlsgd.d,
	* testsuite/ld-powerpc/tlsgd.s,
	* testsuite/ld-powerpc/tlsie.d,
	* testsuite/ld-powerpc/tlsie.s,
	* testsuite/ld-powerpc/tlsld.d,
	* testsuite/ld-powerpc/tlsld.s: New tests.
	* testsuite/ld-powerpc/powerpc.exp: Run them.
2019-07-19 18:01:25 +09:30
..
config Use better test for usable compiler in ld testsuite. 2019-04-24 12:14:56 -07:00
ld-aarch64 Add R_AARCH64_P32_MOVW_PREL_* ELF32 relocs 2019-06-14 12:02:19 +01:00
ld-alpha Fix alpha testsuite regression 2019-06-14 10:23:20 +09:30
ld-arc Update year range in copyright notice of binutils files 2019-01-01 22:06:53 +10:30
ld-arm Ensure that debug information is retained for ARMv8-M security functions. 2019-07-02 12:43:59 +01:00
ld-auto-import Use better test for usable compiler in ld testsuite. 2019-04-24 12:14:56 -07:00
ld-avr Fix PR 24571 - Relaxation does not shorten jmp or call to target at pc-relative range boundary 2019-05-21 12:48:06 +05:30
ld-bootstrap Update year range in copyright notice of binutils files 2019-01-01 22:06:53 +10:30
ld-bpf ld: add support for eBPF 2019-05-23 19:34:15 +02:00
ld-cdtest Update year range in copyright notice of binutils files 2019-01-01 22:06:53 +10:30
ld-checks Update year range in copyright notice of binutils files 2019-01-01 22:06:53 +10:30
ld-cris Dynamic TLS section symbols 2019-07-13 09:57:50 +09:30
ld-crx Update year range in copyright notice of binutils files 2019-01-01 22:06:53 +10:30
ld-csky Add support for the C_SKY series of processors. 2018-07-30 12:24:14 +01:00
ld-cygwin Use better test for usable compiler in ld testsuite. 2019-04-24 12:14:56 -07:00
ld-d10v Update year range in copyright notice of binutils files 2019-01-01 22:06:53 +10:30
ld-discard Support tcl procedure calls in run_dump_test xfail 2019-05-30 00:52:08 +09:30
ld-elf Re: ld -r: Don't merge with member of output section group 2019-07-19 18:01:25 +09:30
ld-elfcomm Use better test for usable compiler in ld testsuite. 2019-04-24 12:14:56 -07:00
ld-elfvers Use better test for usable compiler in ld testsuite. 2019-04-24 12:14:56 -07:00
ld-elfvsb Use better test for usable compiler in ld testsuite. 2019-04-24 12:14:56 -07:00
ld-elfweak Use better test for usable compiler in ld testsuite. 2019-04-24 12:14:56 -07:00
ld-fastcall Update year range in copyright notice of binutils files 2019-01-01 22:06:53 +10:30
ld-frv Update year range in copyright notice of binutils files 2019-01-01 22:06:53 +10:30
ld-gc Use better test for usable compiler in ld testsuite. 2019-04-24 12:14:56 -07:00
ld-h8300 Update year range in copyright notice of binutils files 2019-01-01 22:06:53 +10:30
ld-i386 Use better test for usable compiler in ld testsuite. 2019-04-24 12:14:56 -07:00
ld-ia64 Update year range in copyright notice of binutils files 2019-01-01 22:06:53 +10:30
ld-ifunc Use better test for usable compiler in ld testsuite. 2019-04-24 12:14:56 -07:00
ld-libs Update year range in copyright notice of binutils files 2019-01-01 22:06:53 +10:30
ld-linkonce Update year range in copyright notice of binutils files 2019-01-01 22:06:53 +10:30
ld-m68hc11 Update year range in copyright notice of binutils files 2019-01-01 22:06:53 +10:30
ld-m68k run_dump_test source in build directory 2019-01-08 18:50:54 +10:30
ld-mep Update year range in copyright notice of binutils files 2019-01-01 22:06:53 +10:30
ld-metag Update year range in copyright notice of binutils files 2019-01-01 22:06:53 +10:30
ld-mips-elf Dynamic TLS section symbols 2019-07-13 09:57:50 +09:30
ld-misc Update year range in copyright notice of binutils files 2019-01-01 22:06:53 +10:30
ld-mmix Update year range in copyright notice of binutils files 2019-01-01 22:06:53 +10:30
ld-mn10300 Use better test for usable compiler in ld testsuite. 2019-04-24 12:14:56 -07:00
ld-msp430-elf MSP430 Linker: Define __crt0_init_bss/__crt0_movedata symbols when .lower or .either prefixed sections are present. 2019-04-17 15:05:08 +01:00
ld-nds32 Update year range in copyright notice of binutils files 2019-01-01 22:06:53 +10:30
ld-nios2 Run more ld tests when not native 2017-01-02 23:48:08 +10:30
ld-or1k Update year range in copyright notice of binutils files 2019-01-01 22:06:53 +10:30
ld-pe Use better test for usable compiler in ld testsuite. 2019-04-24 12:14:56 -07:00
ld-pie Use better test for usable compiler in ld testsuite. 2019-04-24 12:14:56 -07:00
ld-plugin Don't complain undefined weak dynamic reference 2019-04-26 07:52:09 -07:00
ld-powerpc [PowerPC64] pc-relative TLS relocations 2019-07-19 18:01:25 +09:30
ld-pru Fix binary compatibility between GCC and the TI compiler for the PRU target. 2018-05-09 11:39:32 +01:00
ld-riscv-elf Fix spelling mistakes in BFD library. 2019-01-21 12:39:24 +00:00
ld-s12z Update year range in copyright notice of binutils files 2019-01-01 22:06:53 +10:30
ld-s390 Dynamic TLS section symbols 2019-07-13 09:57:50 +09:30
ld-scripts Support tcl procedure calls in run_dump_test xfail 2019-05-30 00:52:08 +09:30
ld-selective Update year range in copyright notice of binutils files 2019-01-01 22:06:53 +10:30
ld-sh Use better test for usable compiler in ld testsuite. 2019-04-24 12:14:56 -07:00
ld-shared Use better test for usable compiler in ld testsuite. 2019-04-24 12:14:56 -07:00
ld-size Use better test for usable compiler in ld testsuite. 2019-04-24 12:14:56 -07:00
ld-sparc Dynamic TLS section symbols 2019-07-13 09:57:50 +09:30
ld-spu Update year range in copyright notice of binutils files 2019-01-01 22:06:53 +10:30
ld-srec Use better test for usable compiler in ld testsuite. 2019-04-24 12:14:56 -07:00
ld-tic6x Update year range in copyright notice of binutils files 2019-01-01 22:06:53 +10:30
ld-tilegx Update year range in copyright notice of binutils files 2019-01-01 22:06:53 +10:30
ld-tilepro Update year range in copyright notice of binutils files 2019-01-01 22:06:53 +10:30
ld-undefined PicoJava weak undefined symbols 2019-05-06 11:41:28 +09:30
ld-unique Use better test for usable compiler in ld testsuite. 2019-04-24 12:14:56 -07:00
ld-v850 Update year range in copyright notice of binutils files 2019-01-01 22:06:53 +10:30
ld-vax-elf Update year range in copyright notice of binutils files 2019-01-01 22:06:53 +10:30
ld-visium Update year range in copyright notice of binutils files 2019-01-01 22:06:53 +10:30
ld-vxworks Update year range in copyright notice of binutils files 2019-01-01 22:06:53 +10:30
ld-x86-64 elf: Remove the property after reporting its removal 2019-06-24 11:08:57 -07:00
ld-xc16x Update year range in copyright notice of binutils files 2019-01-01 22:06:53 +10:30
ld-xstormy16 Update year range in copyright notice of binutils files 2019-01-01 22:06:53 +10:30
ld-xtensa bfd: xtensa: fix shrink_dynamic_reloc_sections for export-dynamic 2019-03-29 10:02:10 -07:00
ld-z8k Update year range in copyright notice of binutils files 2019-01-01 22:06:53 +10:30
lib s12z genelf.em 2019-05-30 01:01:42 +09:30
ChangeLog-2004
ChangeLog-2005
ChangeLog-2006
ChangeLog-2007
ChangeLog-2008
ChangeLog-2009
ChangeLog-2010
ChangeLog-2011
ChangeLog-2012
ChangeLog-2013
ChangeLog-2014
ChangeLog-2015 binutils ChangeLog rotation 2016-01-01 22:59:17 +10:30
ChangeLog-9303