This is an archive of the discontinued LLVM Phabricator instance.

[ELF/AArch64] Add support for R_AARCH64_ADR_GOT_PAGE and R_AARCH64_LD64_GOT_LO12_NC.
ClosedPublic

Authored by ikudrin on Nov 23 2015, 3:29 AM.

Diff Detail

Event Timeline

ikudrin updated this revision to Diff 40910.Nov 23 2015, 3:29 AM
ikudrin retitled this revision from to [ELF/AArch64] Add support for R_AARCH64_ADR_GOT_PAGE and R_AARCH64_LD64_GOT_LO12_NC..
ikudrin updated this object.
ikudrin added reviewers: ruiu, davide.
ikudrin added a project: lld.
ikudrin added a subscriber: llvm-commits.
emaste added a subscriber: emaste.Nov 23 2015, 5:12 AM
davide added inline comments.Nov 23 2015, 8:38 AM
ELF/Target.cpp
678

cant' this just be a one-liner?
something like
return R_AARCH64_ADR_GOT_PAGE || R_AARCH64_LD64_GOT_LO12_NC || relocNeedsPlt();

742

Please convert to the new overflow checker helper once you commit that.

ikudrin added inline comments.Nov 23 2015, 8:44 AM
ELF/Target.cpp
678

We may have more GOT relocations in the near future, like R_AARCH64_*_GOTOFF_*, R_AARCH64_GOT_LD_PREL19, R_AARCH64_LD64_GOTPAGE_LO15.

742

Sure.

davide added inline comments.Nov 23 2015, 8:46 AM
ELF/Target.cpp
678

If we'll get there, we can switch over. I'm for simplicity until we need something more complicated.

ikudrin updated this revision to Diff 40937.Nov 23 2015, 9:28 AM
  • Rebase to the top.
  • Remove the switch statement in the AArch64TargetInfo::relocNeedsGot() method.
davide accepted this revision.Nov 23 2015, 9:35 AM
davide edited edge metadata.

Looks good, thank you!

This revision is now accepted and ready to land.Nov 23 2015, 9:35 AM
ruiu accepted this revision.Nov 23 2015, 10:09 AM
ruiu edited edge metadata.

LGTM with a nit.

ELF/Target.cpp
672–679

Remove ()s. (We can assume that everybody knows that == takes precedence over ||.)

This revision was automatically updated to reflect the committed changes.