PowerPC GOT_PCREL34 optimisation
authorAlan Modra <amodra@gmail.com>
Tue, 30 Apr 2019 07:03:25 +0000 (16:33 +0930)
committerAlan Modra <amodra@gmail.com>
Fri, 24 May 2019 00:57:53 +0000 (10:27 +0930)
commit4a421c53cf609d68fe956c2e7270d34c0ab8500f
tree8a241a9458a01b131577c6eaf6b5ca98d91d4421
parent5663e321848545857a690f30a780187e3366bd2d
PowerPC GOT_PCREL34 optimisation

bfd/
* elf64-ppc.c (ppc64_elf_check_relocs): Set has_gotrel for
R_PPC64_GOT_PCREL34.
(xlate_pcrel_opt): New function.
(ppc64_elf_edit_toc): Handle R_PPC64_GOT_PCREL34.
(ppc64_elf_relocate_section): Edit GOT indirect to GOT relative
for R_PPC64_GOT_PCREL34.  Implement R_PPC64_PCREL_OPT optimisation.
ld/
* testsuite/ld-powerpc/pcrelopt.s,
* testsuite/ld-powerpc/pcrelopt.d,
* testsuite/ld-powerpc/pcrelopt.sec: New test.
* testsuite/ld-powerpc/powerpc.exp: Run it.
bfd/ChangeLog
bfd/elf64-ppc.c
ld/ChangeLog
ld/testsuite/ld-powerpc/pcrelopt.d [new file with mode: 0644]
ld/testsuite/ld-powerpc/pcrelopt.s [new file with mode: 0644]
ld/testsuite/ld-powerpc/pcrelopt.sec [new file with mode: 0644]
ld/testsuite/ld-powerpc/powerpc.exp