The runtime pseudo relocations can't handle the ARM format embedded addresses in movw/movt 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).
Maybe we should just pass true here instead of !GV->hasInternalLinkage(). We should never use .refptr stubs to access internal symbols, right? They will always be DSO local, and should be accessible with other means.
We don't even use Stub.second.getInt() in the generic AsmPrinter.cpp code that emits the stub globals.