[PATCH] D48090: [PPC64] global dynamic to initial exec relaxation

Sean Fertile via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 12 12:55:17 PDT 2018


sfertile created this revision.
sfertile added reviewers: syzaara, ruiu, rdhindsa.
Herald added subscribers: kbarton, arichardson, nemanjai, emaste.
Herald added a reviewer: espindola.

Patch adds support for relaxing the global-dynamic tls sequence to initial-exec tls sequence.

the relaxation performs the following transformation:
addis r3, r2, x at got@tlsgd at ha --> addis r3, r2, x at got@tprel at ha
addi r3, r3, x at got@tlsgd at l      --> ld r3, x at got@tprel at l(r3)
bl __tls_get_addr(x at tlsgd)        --> nop
nop                                                  --> add r3, r3, r13

and instead of emitting a DTPMOD64/DTPREL64 pair for `x`, we emit a  single R_PPC64_TPREL64.


Repository:
  rLLD LLVM Linker

https://reviews.llvm.org/D48090

Files:
  ELF/Arch/PPC64.cpp
  ELF/InputSection.cpp
  ELF/Relocations.cpp
  ELF/Relocations.h
  test/ELF/ppc64-gd-to-ie.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D48090.150999.patch
Type: text/x-patch
Size: 7209 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180612/dc71cd39/attachment.bin>


More information about the llvm-commits mailing list