diff options
Diffstat (limited to 'llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp')
| -rw-r--r-- | llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp b/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp index a5910a67d6c..9849ef3efda 100644 --- a/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp +++ b/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp @@ -201,7 +201,9 @@ void PPCAsmPrinter::printOperand(const MachineInstr *MI, unsigned OpNo, // External or weakly linked global variables need non-lazily-resolved stubs if (TM.getRelocationModel() != Reloc::Static && !GV->isStrongDefinitionForLinker()) { - if (!GV->hasHiddenVisibility()) { + if (!GV->hasHiddenVisibility() || + (GV->isDeclaration() || GV->hasCommonLinkage() || + GV->hasAvailableExternallyLinkage())) { SymToPrint = getSymbolWithGlobalValueBase(GV, "$non_lazy_ptr"); MachineModuleInfoImpl::StubValueTy &StubSym = MMI->getObjFileInfo<MachineModuleInfoMachO>().getGVStubEntry( @@ -209,16 +211,6 @@ void PPCAsmPrinter::printOperand(const MachineInstr *MI, unsigned OpNo, if (!StubSym.getPointer()) StubSym = MachineModuleInfoImpl::StubValueTy( getSymbol(GV), !GV->hasInternalLinkage()); - } else if (GV->isDeclaration() || GV->hasCommonLinkage() || - GV->hasAvailableExternallyLinkage()) { - SymToPrint = getSymbolWithGlobalValueBase(GV, "$non_lazy_ptr"); - - MachineModuleInfoImpl::StubValueTy &StubSym = - MMI->getObjFileInfo<MachineModuleInfoMachO>().getGVStubEntry( - SymToPrint); - if (!StubSym.getPointer()) - StubSym = MachineModuleInfoImpl::StubValueTy( - getSymbol(GV), !GV->hasInternalLinkage()); } else { SymToPrint = getSymbol(GV); } |

