Support fusion for ELFv2 stubs
authorAlan Modra <amodra@gmail.com>
Tue, 3 Jun 2014 01:25:29 +0000 (10:55 +0930)
committerAlan Modra <amodra@gmail.com>
Tue, 3 Jun 2014 01:25:29 +0000 (10:55 +0930)
commit397998fc32a34d3c8993ef46da45c3957a4dd402
tree2dba3305c8567097b13505879d970299d2b9ad08
parent61f5c66f62502f33e1f2441a043bd29bb3ad6ea5
Support fusion for ELFv2 stubs

Power8 fuses addis,addi and addis,ld sequences when the target of the
addis is the same as the addi/ld.  Thus
    addis r12,r2,xxx@ha
    addi r12,r12,xxx@l / ld r12,xxx@l(r12)
is faster than
    addis r11,r2,xxx@ha
    addi r12,r11,xxx@l / ld r12,xxx@l(r11)
So use the form that allows fusion in plt call and branch stubs.

bfd/
* elf64-ppc.c (ADDIS_R12_R2): Define.
(build_plt_stub): Support fusion on ELFv2 stub.
(ppc_build_one_stub): Likewise for plt branch stubs.
gold/
* powerpc.cc (addis_12_2): Define.
(Stub_table::do_write): Support fusion on ELFv2 stubs.
ld/testsuite/
* ld-powerpc/elfv2exe.d: Update for changed plt call stubs.
gdb/
* ppc64-tdep.c (ppc64_standard_linkage8): New.
(ppc64_skip_trampoline_code): Recognise ELFv2 stub supporting fusion.
bfd/ChangeLog
bfd/elf64-ppc.c
gdb/ChangeLog
gdb/ppc64-tdep.c
gold/ChangeLog
gold/powerpc.cc
ld/testsuite/ChangeLog
ld/testsuite/ld-powerpc/elfv2exe.d