This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[PATCH 0/9] PowerPC64 ELFv2 ABI support.
- From: Alan Modra <amodra at gmail dot com>
- To: binutils at sourceware dot org
- Date: Wed, 30 Oct 2013 12:49:05 +1030
- Subject: [PATCH 0/9] PowerPC64 ELFv2 ABI support.
- Authentication-results: sourceware.org; auth=none
This patch series makes the changes necessary in binutils to support
the updated PowerPC64 ABI, which we're calling ELFv2. Two major
changes from the previous ABI are
- No function descriptors.
Functions set up their got/toc pointer as necessary on entry. The
plt consists of single dword addresses. Function pointers point at
the function code. To make this work efficiently with static
linking, functions have *two* entry points, one we call the "global
entry" and another we call the "local entry". The global entry
point is the address stored in function pointers, and it is a
requirement that calls to the global entry point have that address
in r12. This is no hardship since calls via function pointers or
the plt will always use a sequence that loads the address into a
general purpose register, moves it to the count register, then
branches to the count register. We just needed to make sure r12 was
the gpr used. The "local entry" is used when the toc pointer is
known to already be valid for the function, typically true for
static linking, allowing the toc pointer setup to be skipped.
- Reduced stack frame size.
We removed the compiler and linker save words, and removed the
parameter save area for most functions. This means the minimum
stack frame overhead is reduced from 112 bytes to 32 bytes (for
functions that need a frame), and many functions will used just the
minimum. After some debate, we decided to keep the stack back-chain
word.
The ABI's are incompatible. It won't be possible to link old objects
with new except in rare cases, or to use old shared libraries with new
executables at run time.
The first two patches in this series make changes that affect the old
ABI too, the first one fixing a hole in the PowerPC64 ABI, and the
second one makes all stubs conform with the ELFv2 ABI requirement on
r12.
--
Alan Modra
Australia Development Lab, IBM
Report overflow on PowerPC64 @h and @ha relocations.
Change plt stubs to have destination in r12.
Add .abiversion related support for ELFv2
Add ELFv2 .localentry support.
ELFv2 stub, plt and glink changes
Support ELFv2 stack frame.
Replace DT_PPC_TLSOPT with DT_PPC_OPT.
Add PowerPC64 ELFv2 tests.
PowerPC64 ELFv2 support for gold.
bfd/ChangeLog | 82 ++++
bfd/bfd-in2.h | 6 +
bfd/elf32-ppc.c | 2 +-
bfd/elf64-ppc.c | 884 +++++++++++++++++++++++++----------
bfd/libbfd.h | 6 +
bfd/reloc.c | 12 +
binutils/ChangeLog | 14 +
binutils/readelf.c | 30 +-
elfcpp/ChangeLog | 13 +
elfcpp/powerpc.h | 61 ++-
gas/ChangeLog | 27 ++
gas/config/tc-ppc.c | 284 +++++++++--
gas/config/tc-ppc.h | 3 +
gold/ChangeLog | 47 ++
gold/powerpc.cc | 668 +++++++++++++++++++-------
include/elf/ChangeLog | 24 +
include/elf/ppc.h | 3 +-
include/elf/ppc64.h | 73 ++-
ld/testsuite/ChangeLog | 29 ++
ld/testsuite/ld-powerpc/elfv2.s | 32 ++
ld/testsuite/ld-powerpc/elfv2exe.d | 40 ++
ld/testsuite/ld-powerpc/elfv2so.d | 82 ++++
ld/testsuite/ld-powerpc/powerpc.exp | 2 +
ld/testsuite/ld-powerpc/relbrlt.d | 8 +-
ld/testsuite/ld-powerpc/tls.d | 4 +-
ld/testsuite/ld-powerpc/tls.g | 6 +-
ld/testsuite/ld-powerpc/tls.s | 7 +-
ld/testsuite/ld-powerpc/tlsexe.d | 23 +-
ld/testsuite/ld-powerpc/tlsexe.g | 2 +-
ld/testsuite/ld-powerpc/tlsexe.r | 56 +--
ld/testsuite/ld-powerpc/tlsexetoc.d | 23 +-
ld/testsuite/ld-powerpc/tlsexetoc.g | 2 +-
ld/testsuite/ld-powerpc/tlsexetoc.r | 58 +--
ld/testsuite/ld-powerpc/tlsso.d | 25 +-
ld/testsuite/ld-powerpc/tlsso.g | 2 +-
ld/testsuite/ld-powerpc/tlsso.r | 60 +--
ld/testsuite/ld-powerpc/tlstoc.d | 4 +-
ld/testsuite/ld-powerpc/tlstoc.g | 12 +-
ld/testsuite/ld-powerpc/tlstoc.s | 7 +-
ld/testsuite/ld-powerpc/tlstocso.d | 25 +-
ld/testsuite/ld-powerpc/tlstocso.g | 2 +-
ld/testsuite/ld-powerpc/tlstocso.r | 62 +--
42 files changed, 2166 insertions(+), 646 deletions(-)
create mode 100644 ld/testsuite/ld-powerpc/elfv2.s
create mode 100644 ld/testsuite/ld-powerpc/elfv2exe.d
create mode 100644 ld/testsuite/ld-powerpc/elfv2so.d