This is an archive of the discontinued LLVM Phabricator instance.

[JITLink][ELF/AARCH64] Implement R_AARCH64_ADR_GOT_PAGE and R_AARCH64_LD64_GOT_LO12_NC
ClosedPublic

Authored by sunho on Jun 4 2022, 5:23 PM.

Details

Summary

This patch implements two most commonly used Global Offset Table relocations in ELF/AARCH64: R_AARCH64_ADR_GOT_PAGE and R_AARCH64_LD64_GOT_LO12_NC. It implements the GOT table manager by extending the existing PerGraphGOTAndPLTStubsBuilder. I brought a lot of code from Macho/ARM64 backend's GOT manager and it looks very possible to unify them to generic aarch64 got table manager.

I thought it's better to unify them in the later patch to focus changes on ELF backend, but I can do it in this patch if that's preferred.

Diff Detail

Event Timeline

sunho created this revision.Jun 4 2022, 5:23 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 4 2022, 5:23 PM
sunho requested review of this revision.Jun 4 2022, 5:23 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 4 2022, 5:23 PM
sunho updated this revision to Diff 434987.Jun 7 2022, 4:09 PM

Fix msvc build

lhames accepted this revision.Jun 7 2022, 6:09 PM

LGTM.

I brought a lot of code from Macho/ARM64 backend's GOT manager and it looks very possible to unify them to generic aarch64 got table manager.

Absolutely -- it would be great to unify these.

I thought it's better to unify them in the later patch to focus changes on ELF backend, but I can do it in this patch if that's preferred.

I think it makes sense to land this as-is, then unify support in a follow-up patch.

This revision is now accepted and ready to land.Jun 7 2022, 6:09 PM
This revision was automatically updated to reflect the committed changes.