[PATCH] D35544: [COFF, ARM64] Force ADRP relocations

Martin Storsjö via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 19 03:47:15 PDT 2017


mstorsjo added a comment.

In https://reviews.llvm.org/D35544#813711, @t.p.northover wrote:

>




>> Actually, when I try to move the function from ELFAArch64AsmBackend to AArch64AsmBackend, I suddenly started getting the following errors when assembling your test snippet:
> 
> Ah, interesting! I actually think that's correct behaviour. The MachO adrp always has a textual tag for the kind of relocation you want. For example `adrp x0, Lthere at PAGE`. So without that function we silently miscompiled invalid code instead of diagnosing it; with your change it survives to the relocation phase to be reported.
> 
> Technically we should probably diagnose it earlier (AsmParser), but for your purposes just checking that there is an error in the MachO case is probably the right thing to do.

Oh, indeed, I forgot that MachO has a different syntax for these. I'll update with tests for both of these cases.


https://reviews.llvm.org/D35544





More information about the llvm-commits mailing list