binutils-gdb/ld/testsuite/ld-powerpc
Alan Modra f749f26eea PowerPC PIC vs. DLL TLS issues
1) GOT entries generated for any of the GOT TLS relocations don't need
dynamic relocations for locally defined symbols in PIEs.  In the case
of a tls_index doubleword, the dtpmod entry is known to be 1, and the
dtprel entry is also known at link time and relative.  Similarly,
dtprel and tprel words are known at link time and relative.  (GOT
entries for other than TLS symbols are not relative and thus need
dynamic relocations in PIEs.)
2) Local dynamic TLS code is really only meant for accesses local to
the current binary.  There was a cheapskate test for this before using
the common tlsld_got slot, but the test wasn't exactly correct and
might confuse anyone looking at the code.  The proper test,
SYMBOL_REFERENCES_LOCAL isn't so expensive that it should be avoided.
3) The same cheap test for local syms when optimising TLS sequences
should be SYMBOL_REFERENCES_LOCAL too.

bfd/
	* elf64-ppc.c (ppc64_elf_check_relocs): Move initialisation of vars.
	(ppc64_elf_tls_optimize): Correct is_local condition.
	(allocate_got): Don't reserve dynamic relocations for any of the
	tls got relocs in PIEs when the symbol is local.
	(allocate_dynrelocs): Correct validity test for local sym using
	tlsld_got slot.
	(ppc64_elf_size_dynamic_sections): Don't reserve dynamic relocations
	for any of the tls got relocs in PIEs.
	(ppc64_elf_layout_multitoc): Likewise.
	(ppc64_elf_relocate_section): Correct validity test for local sym
	using tlsld_got slot.  Don't emit dynamic relocations for any of
	the tls got relocs in PIEs when the symbol is local.
	* elf32-ppc.c (ppc_elf_tls_optimize): Correct is_local condition.
	(got_relocs_needed): Delete.
	(allocate_dynrelocs): Correct validity test for local sym using
	tlsld_got slot.  Don't reserve dynamic relocations for any of the
	tls got relocs in PIEs when the symbol is local.
	(ppc_elf_size_dynamic_sections): Don't reserve dynamic relocations
	for any of the tls got relocs in PIEs.
	(ppc_elf_relocate_section): Correct validity test for local sym
	using tlsld_got slot.  Don't emit dynamic relocations for any of
	the tls got relocs in PIEs when the symbol is local.
ld/
	* testsuite/ld-powerpc/tlsso.d: Adjust to suit tlsld_got usage change.
	* testsuite/ld-powerpc/tlsso.g: Likewise.
	* testsuite/ld-powerpc/tlsso.r: Likewise.
	* testsuite/ld-powerpc/tlsso32.d: Likewise.
	* testsuite/ld-powerpc/tlsso32.g: Likewise.
	* testsuite/ld-powerpc/tlsso32.r: Likewise.
2019-10-04 22:53:56 +09:30
..
addpcis.d
addpcis.s
aix52.exp Update year range in copyright notice of binutils files 2019-01-01 22:06:53 +10:30
aix-abs-branch-1.dd
aix-abs-branch-1.ex
aix-abs-branch-1.im
aix-abs-branch-1.nd
aix-abs-branch-1.s
aix-abs-reloc-1.ex
aix-abs-reloc-1.im
aix-abs-reloc-1.nd
aix-abs-reloc-1.od
aix-abs-reloc-1.s
aix-core-sec-1.ex
aix-core-sec-1.hd
aix-core-sec-1.s
aix-core-sec-2.ex
aix-core-sec-2.hd
aix-core-sec-2.s
aix-core-sec-3.ex
aix-core-sec-3.hd
aix-core-sec-3.s
aix-export-1-all.dd
aix-export-1-full.dd
aix-export-1a.s
aix-export-1b.s
aix-export-2.nd
aix-export-2.s
aix-gc-1-32.dd
aix-gc-1-64.dd
aix-gc-1.ex
aix-gc-1.nd
aix-gc-1.s
aix-glink-1-32.d
aix-glink-1-32.dd
aix-glink-1-64.d
aix-glink-1-64.dd
aix-glink-1.ex
aix-glink-1.s
aix-glink-2-32.dd
aix-glink-2-64.dd
aix-glink-2a.ex
aix-glink-2a.s
aix-glink-2b.s
aix-glink-2c.ex
aix-glink-2c.s
aix-glink-2d.s
aix-glink-3-32.d
aix-glink-3-64.d
aix-glink-3.dd
aix-glink-3.s
aix-glink-3a.s
aix-glink-3b.s
aix-lineno-1.s
aix-lineno-1.txt
aix-lineno-1a.dd
aix-lineno-1a.nd
aix-lineno-1b.dd
aix-lineno-1b.nd
aix-no-dup-syms-1-dso.dnd
aix-no-dup-syms-1-dso.drd
aix-no-dup-syms-1-dso.nd
aix-no-dup-syms-1-dso.rd
aix-no-dup-syms-1-rel.nd
aix-no-dup-syms-1-rel.rd
aix-no-dup-syms-1.ex
aix-no-dup-syms-1.im
aix-no-dup-syms-1a.s
aix-no-dup-syms-1b.s
aix-ref-1-32.od
aix-ref-1-64.od
aix-ref-1.s
aix-rel-1.od
aix-rel-1.s
aix-toc-1-32.dd
aix-toc-1-64.dd
aix-toc-1.ex
aix-toc-1a.s
aix-toc-1b.s
aix-weak-1-dso.dnd
aix-weak-1-dso.hd
aix-weak-1-dso.nd
aix-weak-1-gcdso.dnd
aix-weak-1-gcdso.hd
aix-weak-1-gcdso.nd
aix-weak-1-rel.hd
aix-weak-1-rel.nd
aix-weak-1.ex
aix-weak-1a.s
aix-weak-1b.s
aix-weak-2a.ex
aix-weak-2a.nd
aix-weak-2a.s
aix-weak-2b.nd
aix-weak-2b.s
aix-weak-2c.ex
aix-weak-2c.nd
aix-weak-2c.od
aix-weak-2c.s
aix-weak-3-32.d
aix-weak-3-32.dd
aix-weak-3-64.d
aix-weak-3-64.dd
aix-weak-3a.ex
aix-weak-3a.s
aix-weak-3b.ex
aix-weak-3b.s
ambiguousv1.d
ambiguousv1b.d
ambiguousv2.d
ambiguousv2b.d
apuinfo1.s
apuinfo2.s
apuinfo-nul1.s
apuinfo-nul.rd
apuinfo-nul.s
apuinfo-vle2.s
apuinfo-vle.rd
apuinfo-vle.s
apuinfo.rd
attr-gnu-4-0.s
attr-gnu-4-1.s
attr-gnu-4-2.s
attr-gnu-4-3.s
attr-gnu-4-00.d
attr-gnu-4-01.d
attr-gnu-4-02.d
attr-gnu-4-03.d
attr-gnu-4-10.d
attr-gnu-4-11.d
attr-gnu-4-12.d
attr-gnu-4-13.d
attr-gnu-4-20.d
attr-gnu-4-21.d
attr-gnu-4-22.d
attr-gnu-4-23.d
attr-gnu-4-31.d
attr-gnu-4-32.d
attr-gnu-4-33.d
attr-gnu-8-1.s
attr-gnu-8-2.s
attr-gnu-8-3.s
attr-gnu-8-11.d
attr-gnu-8-23.d
attr-gnu-8-31.d
attr-gnu-12-1.s
attr-gnu-12-2.s
attr-gnu-12-11.d
attr-gnu-12-21.d
big.s
callstub-1.d Re: PowerPC notoc call stub tests 2019-07-08 15:24:14 +09:30
callstub-1.s PowerPC notoc call stub tests 2019-06-28 10:16:17 +09:30
callstub-2.d Re: PowerPC notoc call stub tests 2019-07-08 15:24:14 +09:30
callstub-2.s PowerPC notoc call stub tests 2019-06-28 10:16:17 +09:30
defsym.d
defsym.s
dotsym1.d
dotsym2.d
dotsym3.d
dotsym4.d
dotsymref.s
elfv2-2a.s
elfv2-2b.s
elfv2-2exe.d
elfv2-2so.d
elfv2.s
elfv2exe.d PR24704, Internal error building skiboot for powerpc64-linux-gnu 2019-06-23 23:11:27 +09:30
elfv2so.d PR24704, Internal error building skiboot for powerpc64-linux-gnu 2019-06-23 23:11:27 +09:30
export-class.exp Update year range in copyright notice of binutils files 2019-01-01 22:06:53 +10:30
ext.d
ext.lnk
ext.s
funref2.s
funref.s
funv1.s
funv2.s
nodotsym.s
notoc2.d PowerPC notoc linkage stubs 2019-05-24 10:28:07 +09:30
notoc2.s PowerPC notoc linkage stubs 2019-05-24 10:28:07 +09:30
notoc.d
notoc.s
notoc.wf
oldtlslib.s
pcrelopt.d R_PPC64_PCREL_OPT 2019-09-05 13:56:20 +09:30
pcrelopt.s R_PPC64_PCREL_OPT 2019-09-05 13:56:20 +09:30
pcrelopt.sec PowerPC GOT_PCREL34 optimisation 2019-05-24 10:27:53 +09:30
plt1.d
plt1.s
powerpc-32-export-class.rd
powerpc-32-export-class.xd
powerpc-64-export-class.rd
powerpc-64-export-class.xd
powerpc.exp [PowerPC64] pc-relative TLS relocations 2019-07-19 18:01:25 +09:30
ppc476-shared2.d
ppc476-shared.d
ppc476-shared.lnk
ppc476-shared.s
pr23937.d
pr23937.s
relax.d
relax.s
relaxr.d
relaxrl.d
relbrlt.d
relbrlt.s
reloc.d
reloc.s
relocsort.d
relocsort.s
sdabase2.d
sdabase2.t
sdabase.d
sdabase.s
sdabase.t
sdadyn.d
sdadyn.s
sdalib.s
startv1.s
startv2.s
symtocbase-1.s
symtocbase-2.s
symtocbase.d
tls32.d
tls32.g
tls32.s PowerPC __tls_get_addr arg parsing 2019-02-21 18:05:05 +10:30
tls32.t
tls.d
tls.g
tls.s
tls.t
tlsdll_32.s
tlsdll.s
tlsdll.ver
tlsexe32.d PowerPC disassembler: Don't emit trailing spaces 2019-04-05 12:20:49 +10:30
tlsexe32.g
tlsexe32.r
tlsexe32.t
tlsexe.d
tlsexe.g
tlsexe.r
tlsexe.t
tlsexetoc.d
tlsexetoc.g
tlsexetoc.r
tlsexetoc.t
tlsgd.d [PowerPC64] pc-relative TLS relocations 2019-07-19 18:01:25 +09:30
tlsgd.s [PowerPC64] pc-relative TLS relocations 2019-07-19 18:01:25 +09:30
tlsie.d [PowerPC64] pc-relative TLS relocations 2019-07-19 18:01:25 +09:30
tlsie.s PowerPC tlsie test fix 2019-08-02 12:41:05 +09:30
tlsld.d [PowerPC64] pc-relative TLS relocations 2019-07-19 18:01:25 +09:30
tlsld.s [PowerPC64] pc-relative TLS relocations 2019-07-19 18:01:25 +09:30
tlsldopt32.d [PowerPC] Rename testcase 2019-07-19 18:01:25 +09:30
tlsldopt32.s [PowerPC] Rename testcase 2019-07-19 18:01:25 +09:30
tlsldopt.d [PowerPC] Rename testcase 2019-07-19 18:01:25 +09:30
tlsldopt.s [PowerPC] Rename testcase 2019-07-19 18:01:25 +09:30
tlslib32.s
tlslib.s
tlsmark32.d
tlsmark32.s
tlsmark.d
tlsmark.s
tlsopt1_32.d
tlsopt1_32.s
tlsopt1.d
tlsopt1.s
tlsopt2_32.d
tlsopt2_32.s
tlsopt2.d
tlsopt2.s
tlsopt3_32.d
tlsopt3_32.s
tlsopt3.d
tlsopt3.s
tlsopt4_32.d
tlsopt4_32.s
tlsopt4.d
tlsopt4.s
tlsopt5_32.d PowerPC disassembler: Don't emit trailing spaces 2019-04-05 12:20:49 +10:30
tlsopt5_32.s
tlsopt5.d PowerPC disassembler: Don't emit trailing spaces 2019-04-05 12:20:49 +10:30
tlsopt5.s
tlsopt5.wf
tlsso32.d PowerPC PIC vs. DLL TLS issues 2019-10-04 22:53:56 +09:30
tlsso32.g PowerPC PIC vs. DLL TLS issues 2019-10-04 22:53:56 +09:30
tlsso32.r PowerPC PIC vs. DLL TLS issues 2019-10-04 22:53:56 +09:30
tlsso32.t
tlsso.d PowerPC PIC vs. DLL TLS issues 2019-10-04 22:53:56 +09:30
tlsso.g PowerPC PIC vs. DLL TLS issues 2019-10-04 22:53:56 +09:30
tlsso.r PowerPC PIC vs. DLL TLS issues 2019-10-04 22:53:56 +09:30
tlsso.t
tlstoc.d
tlstoc.g
tlstoc.s
tlstoc.t
tlstocso.d
tlstocso.g
tlstocso.r Dynamic TLS section symbols 2019-07-13 09:57:50 +09:30
tlstocso.t
tocnovar.d
tocnovar.s
tocopt2.d
tocopt2.out
tocopt2.s
tocopt3.d
tocopt3.s
tocopt4.d
tocopt4a.s
tocopt4b.s
tocopt5.d PowerPC64 GOT indirect to GOT relative optimisation 2019-04-30 22:09:54 +09:30
tocopt5.s PowerPC64 GOT indirect to GOT relative optimisation 2019-04-30 22:09:54 +09:30
tocopt6-inc.s
tocopt6.d
tocopt6a.s
tocopt6b.s
tocopt6c.s
tocopt7.d PowerPC64 GOT indirect to GOT relative optimisation 2019-04-30 22:09:54 +09:30
tocopt7.out
tocopt7.s PowerPC64 GOT indirect to GOT relative optimisation 2019-04-30 22:09:54 +09:30
tocopt8.d PowerPC64 GOT indirect to GOT relative optimisation 2019-04-30 22:09:54 +09:30
tocopt8.s PowerPC64 GOT indirect to GOT relative optimisation 2019-04-30 22:09:54 +09:30
tocopt.d PowerPC64 GOT indirect to GOT relative optimisation 2019-04-30 22:09:54 +09:30
tocopt.out
tocopt.s PowerPC64 GOT indirect to GOT relative optimisation 2019-04-30 22:09:54 +09:30
tocsave1.s
tocsave1a.d
tocsave1s.d
tocsave2.s
tocsave2a.d
tocsave2s.d
tocsavelib.s
tocvar.d
tocvar.s
vle-multiseg-1.d
vle-multiseg-1.ld
vle-multiseg-2.d
vle-multiseg-2.ld
vle-multiseg-3.d
vle-multiseg-3.ld
vle-multiseg-4.d
vle-multiseg-4.ld
vle-multiseg-5.d
vle-multiseg-5.ld
vle-multiseg-6.d
vle-multiseg-6.ld
vle-multiseg-6a.s
vle-multiseg-6b.s
vle-multiseg-6c.s
vle-multiseg-6d.s
vle-multiseg.s
vle-reloc-1.d
vle-reloc-1.s
vle-reloc-2.d
vle-reloc-2.s
vle-reloc-3.d
vle-reloc-3.s
vle-reloc-def-1.s
vle-reloc-def-2.s
vle-reloc-def-3.s
vle.ld
vxworks1-lib.dd
vxworks1-lib.nd
vxworks1-lib.rd
vxworks1-lib.s
vxworks1-lib.sd
vxworks1-lib.td
vxworks1-static.d
vxworks1.dd
vxworks1.ld
vxworks1.rd
vxworks1.s
vxworks2-static.sd
vxworks2.s
vxworks2.sd
vxworks-relax-2.rd
vxworks-relax-2.s
vxworks-relax.rd
vxworks-relax.s