This is an archive of the discontinued LLVM Phabricator instance.

[PPC64] Add TLS global dynamic to local exec relaxation
ClosedPublic

Authored by syzaara on Jun 12 2018, 8:42 AM.

Diff Detail

Repository
rL LLVM

Event Timeline

syzaara created this revision.Jun 12 2018, 8:42 AM
lld/ELF/Arch/PPC64.cpp
171 ↗(On Diff #150951)

minor nit: Could use a ternary here instead of an if.

lld/ELF/Relocations.cpp
936 ↗(On Diff #150951)

This comment should be updated to reflect that we are only skipping the non-tls hints since the tls hints need the following processing.

lld/ELF/Relocations.h
47 ↗(On Diff #150951)

I think we are better off to call it R_TLSGD_HINT and add it with the other General dynamic relocation below.

syzaara updated this revision to Diff 151177.Jun 13 2018, 8:23 AM
ruiu added inline comments.Jun 13 2018, 3:18 PM
lld/ELF/Arch/PPC64.cpp
162 ↗(On Diff #151177)

I found this comment a bit confusing. Does this mean the first instruction is one of

addis r3, r2, a@got@tlsgd@ha [R_PPC64_GOT_TLSGD16_HA]

addi r3, r3, a@got@tlsgd@l [R_PPC64_GOT_TLSGD16_LO]

bl __tls_get_addr(a@tlsgd) [R_PPC64_TLSGD]

followed by a nop? Or, do we expect the following four instructions?

addis r3, r2, a@got@tlsgd@ha [R_PPC64_GOT_TLSGD16_HA]
addi r3, r3, a@got@tlsgd@l [R_PPC64_GOT_TLSGD16_LO]
bl __tls_get_addr(a@tlsgd) [R_PPC64_TLSGD]
nop
syzaara updated this revision to Diff 151398.Jun 14 2018, 12:09 PM
syzaara updated this revision to Diff 152941.Jun 26 2018, 12:24 PM
ruiu accepted this revision.Jun 26 2018, 9:52 PM

LGTM

lld/ELF/Arch/PPC64.cpp
187–188 ↗(On Diff #152941)

I believe clang-format would vertically align these comments.

This revision is now accepted and ready to land.Jun 26 2018, 9:52 PM
This revision was automatically updated to reflect the committed changes.