This is an archive of the discontinued LLVM Phabricator instance.

[ELF/AArch64] - Implemented R_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21 and R_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC relocations
ClosedPublic

Authored by grimar on Jan 12 2016, 9:42 AM.

Details

Summary
  • R_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21 is calculated as Page(G(GTPREL(S+A))) – Page(P), set an ADRP immediate field to bits [32:12] of X; check –2^32 ≤ X < 2^32;
  • R_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC is calculated as G(GTPREL(S+A)), set an LD offset field to bits [11:3] of X. No overflow check; check that X&7 = 0.

Diff Detail

Repository
rL LLVM

Event Timeline

grimar updated this revision to Diff 44649.Jan 12 2016, 9:42 AM
grimar retitled this revision from to [ELF/AArch64] - Implemented R_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21 and R_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC relocations.
grimar updated this object.
grimar added reviewers: ruiu, rafael.
grimar added subscribers: llvm-commits, grimar.
ruiu accepted this revision.Jan 12 2016, 10:40 AM
ruiu edited edge metadata.

LGTM

ELF/Target.cpp
1280–1283 ↗(On Diff #44649)

This is probably more readable as we have many expressions here.

switch (Type) {
case R_AARCH64_...:
case R_AARCH64_...:
case R_AARCH64_...:
case R_AARCH64_...:
  return true;
default:
 return relocNeedsPlt(Type, S);
}
This revision is now accepted and ready to land.Jan 12 2016, 10:40 AM
This revision was automatically updated to reflect the committed changes.
grimar marked an inline comment as done.
grimar added inline comments.Jan 13 2016, 3:41 AM
ELF/Target.cpp
1280–1283 ↗(On Diff #44649)

Done.