// generated code.
// FIXME: Add a module level metadata for whether intrinsics should be assumed
// local.
- if (!GV) {
- if (TT.isOSBinFormatCOFF())
- return true;
- if (TT.isOSBinFormatELF() && TT.isX86() && RM == Reloc::Static) {
- // For -fno-plt, we cannot assume that intrinsics are local since the
- // linker can convert some direct access to access via plt.
- return !M.getRtLibUseGOT();
- }
-
- return false;
- }
+ if (!GV)
+ return TT.isOSBinFormatCOFF();
// If the IR producer requested that this GV be treated as dso local, obey.
if (GV->isDSOLocal())
(!F && M.getRtLibUseGOT())) &&
is64Bit())
return X86II::MO_GOTPCREL;
+ // Reference ExternalSymbol directly in static relocation model.
+ if (!GV && TM.getRelocationModel() == Reloc::Static)
+ return X86II::MO_NO_FLAG;
return X86II::MO_PLT;
}