PowerPC64 tls_get_addr_desc static support
authorAlan Modra <amodra@gmail.com>
Wed, 22 Jan 2020 01:54:56 +0000 (12:24 +1030)
committerAlan Modra <amodra@gmail.com>
Wed, 22 Jan 2020 06:44:08 +0000 (17:14 +1030)
commita804e4760a9f05aeb61071f8caad3579e6a197a2
treec25f0e5d42c379e7d388df47f6f0fe698a0bdd3b
parent9e7028aa1e788d666bad91fb20159da6c95bbab1
PowerPC64 tls_get_addr_desc static support

This provides a linker generated __tls_get_addr_desc wrapper function
preserving registers around a __tls_get_addr call.  The idea being to
support __tls_get_addr_desc without requiring a glibc update.

bfd/
* elf64-ppc.c (struct ppc_link_hash_table): Add tga_group.
(ppc64_elf_archive_symbol_lookup): Extract __tls_get_addr_opt for
__tls_get_addr_desc.
(ppc64_elf_size_stubs): Add section for linker generated
__tls_get_addr_desc wrapper function.  Loop at least once if
generating this function.
(emit_tga_desc, emit_tga_desc_eh_frame): New functions.
(ppc64_elf_build_stubs): Generate __tls_get_addr_desc.
ld/
* testsuite/ld-powerpc/tlsdesc3.d,
* testsuite/ld-powerpc/tlsdesc3.wf,
* testsuite/ld-powerpc/tlsdesc4.d,
* testsuite/ld-powerpc/tlsdesc4.s,
* testsuite/ld-powerpc/tlsdesc4.wf: New tests.
* testsuite/ld-powerpc/powerpc.exp: Run them.
bfd/ChangeLog
bfd/elf64-ppc.c
ld/ChangeLog
ld/testsuite/ld-powerpc/powerpc.exp
ld/testsuite/ld-powerpc/tlsdesc3.d [new file with mode: 0644]
ld/testsuite/ld-powerpc/tlsdesc3.wf [new file with mode: 0644]
ld/testsuite/ld-powerpc/tlsdesc4.d [new file with mode: 0644]
ld/testsuite/ld-powerpc/tlsdesc4.s [new file with mode: 0644]
ld/testsuite/ld-powerpc/tlsdesc4.wf [new file with mode: 0644]