This is an archive of the discontinued LLVM Phabricator instance.

[lld-macho] Diagnose unaligned arm64 PAGEOFF12 relocations
ClosedPublic

Authored by BertalanD on Sep 4 2022, 12:25 AM.

Details

Summary

The LDR and STR instructions store their immediate offsets as a multiple
of the load/store's size. Therefore, if the target address is not
aligned, the relocation is not representable. We now emit an error if
that happens.

This commit removes a test case from loh-adrp-ldr.s that contained an
unaligned LDR.

Diff Detail

Event Timeline

BertalanD created this revision.Sep 4 2022, 12:25 AM
Herald added projects: Restricted Project, Restricted Project. · View Herald Transcript
BertalanD requested review of this revision.Sep 4 2022, 12:25 AM
int3 accepted this revision.Sep 4 2022, 6:23 PM
int3 added a subscriber: int3.

lgtm

This revision is now accepted and ready to land.Sep 4 2022, 6:23 PM
Herald added a project: Restricted Project. · View Herald TranscriptSep 5 2022, 8:00 AM