This is an archive of the discontinued LLVM Phabricator instance.

[PPC64] Add support for R_PPC64_GOT_DTPREL16* relocations
ClosedPublic

Authored by syzaara on Jun 22 2018, 6:55 AM.

Details

Summary

The local dynamic TLS access on PPC64 ELF v2 ABI uses R_PPC64_GOT_DTPREL16* relocations when a TLS variables falls outside 2 GB of the thread storage block. This patch adds support for these relocations by adding a new RelExpr called R_TLSLD_GOT_OFF which emits a got entry for the TLS variable relative to the dynamic thread pointer using the relocation R_PPC64_DTPREL64. It then evaluates the R_PPC64_GOT_DTPREL16* relocations as the got offset for the R_PPC64_DTPREL64 got entries.

Diff Detail

Repository
rL LLVM

Event Timeline

syzaara created this revision.Jun 22 2018, 6:55 AM
ruiu added inline comments.Jun 24 2018, 11:10 PM
lld/ELF/Relocations.cpp
214 ↗(On Diff #152463)

Expr == R_TLSLD_GOT_OFF is perhaps better.

lld/ELF/Relocations.h
85–86 ↗(On Diff #152463)

Sort

This revision was not accepted when it landed; it landed in state Needs Review.Jun 27 2018, 7:00 AM
This revision was automatically updated to reflect the committed changes.