This doesn't handle ELF, but neither did the previous code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273677
91177308-0d34-0410-b5e6-
96231b3b80d8
MCSymbol *SymToPrint;
// External or weakly linked global variables need non-lazily-resolved stubs
- if (TM.getRelocationModel() != Reloc::Static &&
- !GV->isStrongDefinitionForLinker() &&
- (!GV->hasHiddenVisibility() ||
- (GV->isDeclaration() || GV->hasCommonLinkage() ||
- GV->hasAvailableExternallyLinkage()))) {
+ if (Subtarget->hasLazyResolverStub(GV)) {
SymToPrint = getSymbolWithGlobalValueBase(GV, "$non_lazy_ptr");
MachineModuleInfoImpl::StubValueTy &StubSym =
MMI->getObjFileInfo<MachineModuleInfoMachO>().getGVStubEntry(