[all-commits] [llvm/llvm-project] c00718: [PowerPC] Add support for R_PPC64_GOT_TPREL_PCREL3...

stefanp-ibm via All-commits all-commits at lists.llvm.org
Tue Sep 22 03:49:53 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: c0071862bb426689acef09491b01b1edca9d747e
      https://github.com/llvm/llvm-project/commit/c0071862bb426689acef09491b01b1edca9d747e
  Author: Stefan Pintilie <stefanp at ca.ibm.com>
  Date:   2020-09-22 (Tue, 22 Sep 2020)

  Changed paths:
    M lld/ELF/Arch/PPC64.cpp
    A lld/test/ELF/ppc64-tls-pcrel-ie.s

  Log Message:
  -----------
  [PowerPC] Add support for R_PPC64_GOT_TPREL_PCREL34 used in TLS Initial Exec

Add Thread Local Storage Initial Exec support to LLD.

This patch adds the computation for the relocations as well as the relaxation from Initial Exec to Local Exec.

Initial Exec:
```
pld r9, x at got@tprel at pcrel
add r9, r9, x at tls@pcrel
```
or
```
pld r9, x at got@tprel at pcrel
lbzx r10, r9, x at tls@pcrel
```
Note that @tls at pcrel is actually encoded as R_PPC64_TLS with a one byte displacement.

For the above examples relaxing Intitial Exec to Local Exec:
```
paddi r9, r9, x at tprel
nop
```
or
```
paddi r9, r13, x at tprel
lbz r10, 0(r9)
```

Reviewed By: nemanjai, MaskRay, #powerpc

Differential Revision: https://reviews.llvm.org/D86893




More information about the All-commits mailing list