aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/MachineBasicBlock.cpp
diff options
context:
space:
mode:
authorStefan Pintilie <stefanp@ca.ibm.com>2020-10-01 05:59:19 -0500
committerStefan Pintilie <stefanp@ca.ibm.com>2020-10-01 13:00:37 -0500
commit79122868f9a3909cfd94d51e9bfe960917a1be05 (patch)
treeae185247ab50369374c000ee1479f3a7474e2788 /llvm/lib/CodeGen/MachineBasicBlock.cpp
parentc1b209cc61290f1ce1243470b825e0994645cb7d (diff)
downloadllvm-79122868f9a3909cfd94d51e9bfe960917a1be05.zip
llvm-79122868f9a3909cfd94d51e9bfe960917a1be05.tar.gz
llvm-79122868f9a3909cfd94d51e9bfe960917a1be05.tar.bz2
[LLD][PowerPC] Add support for R_PPC64_GOT_TLSGD_PCREL34 used in TLS General Dynamic
Add Thread Local Storage support for the 34 bit relocation R_PPC64_GOT_TLSGD_PCREL34 used in General Dynamic. The compiler will produce code that looks like: ``` pla r3, x@got@tlsgd@pcrel R_PPC64_GOT_TLSGD_PCREL34 bl __tls_get_addr@notoc(x@tlsgd) R_PPC64_TLSGD R_PPC64_REL24_NOTOC ``` LLD should be able to correctly compute the relocation for R_PPC64_GOT_TLSGD_PCREL34 as well as do the following two relaxations where possible: General Dynamic to Local Exec: ``` paddi r3, r13, x@tprel nop ``` and General Dynamic to Initial Exec: ``` pld r3, x@got@tprel@pcrel add r3, r3, r13 ``` Note: This patch adds support for the PC Relative (no TOC) version of General Dynamic on top of the existing support for the TOC version of General Dynamic. The ABI does not provide any way to tell by looking only at the relocation `R_PPC64_TLSGD` when it is being used in a TOC instruction sequence or and when it is being used in a no TOC sequence. The TOC sequence should always be 4 byte aligned. This patch adds one to the offset of the relocation when it is being used in a no TOC sequence. In this way LLD can tell by looking at the alignment of the offset of `R_PPC64_TLSGD` whether or not it is being used as part of a TOC or no TOC sequence. Reviewed By: NeHuang, sfertile, MaskRay Differential Revision: https://reviews.llvm.org/D87318
Diffstat (limited to 'llvm/lib/CodeGen/MachineBasicBlock.cpp')
0 files changed, 0 insertions, 0 deletions