public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [PATCH 0/9] PowerPC64 ELFv2 ABI support.
@ 2013-10-30  2:19 Alan Modra
  2013-10-30  2:21 ` [PATCH 1/9] Report overflow on PowerPC64 @h and @ha relocations Alan Modra
                   ` (10 more replies)
  0 siblings, 11 replies; 17+ messages in thread
From: Alan Modra @ 2013-10-30  2:19 UTC (permalink / raw)
  To: binutils

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

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2013-11-01 17:33 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-10-30  2:19 [PATCH 0/9] PowerPC64 ELFv2 ABI support Alan Modra
2013-10-30  2:21 ` [PATCH 1/9] Report overflow on PowerPC64 @h and @ha relocations Alan Modra
2013-10-30  2:22 ` [PATCH 2/9] Change plt stubs to have destination in r12 Alan Modra
2013-10-30  2:23 ` [PATCH 3/9] Add .abiversion related support for ELFv2 Alan Modra
2013-10-30  2:25 ` [PATCH 4/9] Add ELFv2 .localentry support Alan Modra
2013-10-30 19:08   ` Richard Henderson
2013-10-31  8:40     ` Alan Modra
2013-10-30  2:26 ` [PATCH 5/9] ELFv2 stub, plt and glink changes Alan Modra
2013-10-30  2:29 ` [PATCH 6/9] Support ELFv2 stack frame Alan Modra
2013-10-30  2:30 ` [PATCH 7/9] Replace DT_PPC_TLSOPT with DT_PPC_OPT Alan Modra
2013-10-30  2:31 ` [PATCH 8/9] Add PowerPC64 ELFv2 tests Alan Modra
2013-10-30  2:44 ` [PATCH 9/9] PowerPC64 ELFv2 support for gold Alan Modra
2013-10-30 17:25 ` [PATCH 0/9] PowerPC64 ELFv2 ABI support Joseph S. Myers
2013-10-31  7:47   ` Alan Modra
2013-11-01 17:33     ` Joseph S. Myers
2013-10-31  7:50 ` Matt Thomas
2013-10-31 12:55   ` Alan Modra

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).