diff options
author | Bill Schmidt <wschmidt@linux.vnet.ibm.com> | 2012-12-14 17:02:38 +0000 |
---|---|---|
committer | Bill Schmidt <wschmidt@linux.vnet.ibm.com> | 2012-12-14 17:02:38 +0000 |
commit | b453e16855f347e300f1dc0cd0dfbdd65c27b0d2 (patch) | |
tree | b743e0bbee0e4509e09b0b4cbc19b2d4e5d14113 /include | |
parent | 79c3742620efccf7c36ea1738bb121ad70d644d0 (diff) |
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
Diffstat (limited to 'include')
-rw-r--r-- | include/llvm/MC/MCExpr.h | 3 | ||||
-rw-r--r-- | include/llvm/Support/ELF.h | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/include/llvm/MC/MCExpr.h b/include/llvm/MC/MCExpr.h index 882cf7d181..475981fa90 100644 --- a/include/llvm/MC/MCExpr.h +++ b/include/llvm/MC/MCExpr.h @@ -183,7 +183,8 @@ public: VK_PPC_DTPREL16_LO, // symbol@dtprel@l VK_PPC_TOC16_HA, // symbol@toc@ha VK_PPC_TOC16_LO, // symbol@toc@l - VK_PPC_GOT_TPREL16_DS, // symbol@got@tprel + VK_PPC_GOT_TPREL16_HA, // symbol@got@tprel@ha + VK_PPC_GOT_TPREL16_LO, // symbol@got@tprel@l VK_PPC_TLS, // symbol@tls VK_PPC_GOT_TLSGD16_HA, // symbol@got@tlsgd@ha VK_PPC_GOT_TLSGD16_LO, // symbol@got@tlsgd@l diff --git a/include/llvm/Support/ELF.h b/include/llvm/Support/ELF.h index 813d630b03..d0422b3bfa 100644 --- a/include/llvm/Support/ELF.h +++ b/include/llvm/Support/ELF.h @@ -484,7 +484,8 @@ enum { R_PPC64_GOT_TLSGD16_HA = 82, R_PPC64_GOT_TLSLD16_LO = 84, R_PPC64_GOT_TLSLD16_HA = 86, - R_PPC64_GOT_TPREL16_DS = 87, + R_PPC64_GOT_TPREL16_LO_DS = 88, + R_PPC64_GOT_TPREL16_HA = 90, R_PPC64_TLSGD = 107, R_PPC64_TLSLD = 108 }; |