Generate correct stubs for weak-linked symbols

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17101 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Nate Begeman 2004-10-17 23:01:34 +00:00
parent cfbf9faaa4
commit fcf4a42cdf

View File

@ -366,8 +366,9 @@ void PowerPCAsmPrinter::printOp(const MachineOperand &MO,
return;
}
// External global variables need a non-lazily-resolved stub
if (GV->isExternal() && getTM().AddressTaken.count(GV)) {
// External or weakly linked global variables need non-lazily-resolved stubs
if ((GV->isExternal() || GV->hasWeakLinkage()) &&
getTM().AddressTaken.count(GV)) {
GVStubs.insert(Name);
O << "L" << Name << "$non_lazy_ptr";
return;