[PATCH] D51452: [MinGW] [AArch64] Add stubs for potential automatic dllimported variables

Martin Storsjö via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 29 12:39:51 PDT 2018


mstorsjo created this revision.
mstorsjo added reviewers: rnk, compnerd, efriedma, t.p.northover, peter.smith.
Herald added a reviewer: javed.absar.
Herald added a subscriber: kristof.beyls.

The runtime pseudo relocations can't handle the AArch64 format PC relative addressing in adrp+add/ldr pairs. By using stubs, the potentially dllimported addresses can be touched up by the runtime pseudo relocation framework.

The MachineOperand TargetFlags range (8 bits) is just about exhausted; this allocates the last bit to MO_COFFSTUB. (In the X86 target, the TargetFlags are just direct values, while most of it is used as a bitfield on ARM and AArch64.) An alternative, to conserve bits, would be to use MO_GOT (which doesn't have much meaning in a COFF context right now).

Currently in the AArch64 target, the MO_GOT flag is set for any indirect access (so we have `MO_GOT | MO_DLLIMPORT` or `MO_GOT | MO_COFFSTUB`).


Repository:
  rL LLVM

https://reviews.llvm.org/D51452

Files:
  lib/Target/AArch64/AArch64ISelLowering.cpp
  lib/Target/AArch64/AArch64InstrInfo.cpp
  lib/Target/AArch64/AArch64MCInstLower.cpp
  lib/Target/AArch64/AArch64Subtarget.cpp
  lib/Target/AArch64/Utils/AArch64BaseInfo.h
  test/CodeGen/AArch64/mingw-refptr.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D51452.163159.patch
Type: text/x-patch
Size: 8761 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180829/2295d82b/attachment.bin>


More information about the llvm-commits mailing list