OSDN Git Service

This patch improves the 64-bit PowerPC InitialExec TLS support by providing
authorBill Schmidt <wschmidt@linux.vnet.ibm.com>
Fri, 14 Dec 2012 17:02:38 +0000 (17:02 +0000)
committerBill Schmidt <wschmidt@linux.vnet.ibm.com>
Fri, 14 Dec 2012 17:02:38 +0000 (17:02 +0000)
commitb453e16855f347e300f1dc0cd0dfbdd65c27b0d2
treeb743e0bbee0e4509e09b0b4cbc19b2d4e5d14113
parent79c3742620efccf7c36ea1738bb121ad70d644d0
This patch improves the 64-bit PowerPC InitialExec TLS support by providing
for a wider range of GOT entries that can hold thread-relative offsets.
This matches the behavior of GCC, which was not documented in the PPC64 TLS
ABI.  The ABI will be updated with the new code sequence.

Former sequence:

  ld 9,x@got@tprel(2)
  add 9,9,x@tls

New sequence:

  addis 9,2,x@got@tprel@ha
  ld 9,x@got@tprel@l(9)
  add 9,9,x@tls

Note that a linker optimization exists to transform the new sequence into
the shorter sequence when appropriate, by replacing the addis with a nop
and modifying the base register and relocation type of the ld.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170209 91177308-0d34-0410-b5e6-96231b3b80d8
13 files changed:
include/llvm/MC/MCExpr.h
include/llvm/Support/ELF.h
lib/MC/MCExpr.cpp
lib/Target/PowerPC/MCTargetDesc/PPCELFObjectWriter.cpp
lib/Target/PowerPC/MCTargetDesc/PPCMCCodeEmitter.cpp
lib/Target/PowerPC/PPCAsmPrinter.cpp
lib/Target/PowerPC/PPCCodeEmitter.cpp
lib/Target/PowerPC/PPCISelLowering.cpp
lib/Target/PowerPC/PPCISelLowering.h
lib/Target/PowerPC/PPCInstr64Bit.td
lib/Target/PowerPC/PPCInstrInfo.td
test/CodeGen/PowerPC/tls-ie-obj.ll
test/CodeGen/PowerPC/tls-ie.ll