This is an archive of the discontinued LLVM Phabricator instance.

[AArch64] Diagnose large adrp offset on Windows.
ClosedPublic

Authored by efriedma on Nov 2 2021, 1:59 PM.

Details

Summary

On Windows, this relocation can only encode a 21-bit offset. Make sure we emit an error, instead of silently truncating the offset.

Found investigating https://bugs.llvm.org/show_bug.cgi?id=52378

Diff Detail

Event Timeline

efriedma created this revision.Nov 2 2021, 1:59 PM
efriedma requested review of this revision.Nov 2 2021, 1:59 PM
Herald added a project: Restricted Project. · View Herald TranscriptNov 2 2021, 1:59 PM
mstorsjo accepted this revision.Nov 2 2021, 2:07 PM

LGTM

llvm/lib/Target/AArch64/MCTargetDesc/AArch64AsmBackend.cpp
164

Nit: It's not entirely obvious to the reader that these decimal numbers map to the limits of a signed 21 bit number corresponding to the mask below (although that's the main thing one would guess that they mean).

This revision is now accepted and ready to land.Nov 2 2021, 2:07 PM
This revision was automatically updated to reflect the committed changes.