Also add a test for it being unsupported for linux.
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
Can you move the LOH handling into the DarwinAsmParser rather than adding the MachO specific check here please?
DarwinAsmParser seems to be mostly arch independent features at the moment, while this directive only seems to be implemented for aarch64 at the moment.
IMO, linker optimization hints are more an AArch64 thing than a Darwin thing. They were invented entirely to deal with AArch64's ADRP/whatever sequences so I'd prefer the implementation to stay in lib/Target/AArch64 where possible.
@t.p.northover - okay, in that case, we can leave it here. I suppose that this is caused by the pair-wise split relocations à la IMAGE_REL_ARM_MOV32T for PE/COFF?
I suppose that this is caused by the pair-wise split relocations à la IMAGE_REL_ARM_MOV32Tfor PE/COFF
The hints are there so that the linker can turn (non-adjacent) ADRP/ADD sequences, and similar, into ADR/NOP if the referenced symbol ends up close enough; this saves a cycle or so on Apple CPUs. To do that the compiler marks instruction-pairs used to generate a single address and saves that data off in a special MachO load command. I suppose it is sort of a souped-up relocation which specifies two addresses to be relocated instead of just one.
In principle someone could come up with an ELF section type to embed the data and add support to one of those linkers; but no-one has yet.