__tls_get_addr_opt stub eh_frame info
authorAlan Modra <amodra@gmail.com>
Tue, 25 Jul 2017 04:22:32 +0000 (13:52 +0930)
committerAlan Modra <amodra@gmail.com>
Tue, 25 Jul 2017 05:44:39 +0000 (15:14 +0930)
commitd4aaa2a0744a28143f0b923802b6d1fa8db15887
tree29a6410366e5a99161ed99b3a8756c1f9d7e8d1b
parentaafd38357af0c9c225f56afcb93cc3a4da763ccd
__tls_get_addr_opt stub eh_frame info

Since the __tls_get_addr_opt stub saves LR and makes a call, eh_frame
info should be generated to describe how to unwind through the stub.

The patch also changes the way the backend iterates over stubs, from
looking at all sections in stub_bfd to which all dynamic sections are
attached as well, to iterating over the group list, which gets just
the stub sections.  Most binaries will have just one or two stub
groups, so this is a little faster.

bfd/
* elf64-ppc.c (struct map_stub): Add tls_get_addr_opt_bctrl.
(stub_eh_frame_size): New function.
(ppc_size_one_stub): Set group tls_get_addr_opt_bctrl.
(group_sections): Init group tls_get_addr_opt_bctrl.
(ppc64_elf_size_stubs): Update sizing and initialization of
.eh_frame.  Iteration over stubs via group list.
(ppc64_elf_build_stubs): Iterate over stubs via group list.
(ppc64_elf_finish_dynamic_sections): Update finalization of
.eh_frame.
ld/
* testsuite/ld-powerpc/tlsopt5.s: Add cfi.
* testsuite/ld-powerpc/tlsopt5.d: Update.
* testsuite/ld-powerpc/tlsopt5.wf: New file.
* testsuite/ld-powerpc/powerpc.exp: Perform new tlsopt5 test.
bfd/ChangeLog
bfd/elf64-ppc.c
ld/ChangeLog
ld/testsuite/ld-powerpc/powerpc.exp
ld/testsuite/ld-powerpc/tlsopt5.d
ld/testsuite/ld-powerpc/tlsopt5.s
ld/testsuite/ld-powerpc/tlsopt5.wf [new file with mode: 0644]