PowerPC64 __tls_get_addr_opt stub .eh_frame fix
authorAlan Modra <amodra@gmail.com>
Wed, 1 Aug 2018 02:44:22 +0000 (12:14 +0930)
committerAlan Modra <amodra@gmail.com>
Wed, 1 Aug 2018 02:44:22 +0000 (12:14 +0930)
commit1aa4214141d30f99f941266a3bedbc332d674c04
tree4b9c07e9ab01128626d55d0d2e5ec6a1e55af98c
parentcb86a42aba5b6e1c135433e1c0c26223fd0f7a7f
PowerPC64 __tls_get_addr_opt stub .eh_frame fix

This patch sets stub_offset in ppc_size_one_stub rather than in
ppc_build_one_stub.  That allows the plt stub alignment to be done in
just ppc_size_one_stub rather than both functions.  The patch also
corrects the place where the alignment was done, fixing a possible
error in .eh_frame data, and tidies some offset calculations.

bfd/
* elf64-ppc.c (plt_stub_pad): Delay plt_stub_size call until needed.
(ppc_build_one_stub): Don't set stub_offset, instead assert that
it is sane.  Don't adjust stub_offset for alignment.  Adjust size
calculation.  Use "targ" temp when calculating offsets.
(ppc_size_one_stub): Set stub_offset here.  Use "targ" temp when
calculating offsets.  Adjust for alignment before setting
tls_get_addr_opt_bctrl.
ld/
* testsuite/ld-powerpc/powerpc.exp: Run tlsopt5 with plt alignment.
* testsuite/ld-powerpc/tlsopt5.s: Add extra call.
* testsuite/ld-powerpc/tlsopt5.wf: Adjust expected output.
* testsuite/ld-powerpc/tlsopt5.d: Likewise.
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