diff options
-rw-r--r-- | lib/Target/PowerPC/PPC32AsmPrinter.cpp | 4 | ||||
-rw-r--r-- | lib/Target/PowerPC/PPCAsmPrinter.cpp | 4 | ||||
-rw-r--r-- | lib/Target/PowerPC/PowerPCAsmPrinter.cpp | 4 |
3 files changed, 9 insertions, 3 deletions
diff --git a/lib/Target/PowerPC/PPC32AsmPrinter.cpp b/lib/Target/PowerPC/PPC32AsmPrinter.cpp index 636b1c413d..322122a28b 100644 --- a/lib/Target/PowerPC/PPC32AsmPrinter.cpp +++ b/lib/Target/PowerPC/PPC32AsmPrinter.cpp @@ -427,7 +427,9 @@ void Printer::printOp(const MachineOperand &MO, return; case MachineOperand::MO_GlobalAddress: if (!elideOffsetKeyword) { - if (isa<Function>(MO.getGlobal())) { + // Dynamically-resolved functions need a stub for the function + Function *F = dyn_cast<Function>(MO.getGlobal()); + if (F && F->isExternal()) { Stubs.insert(Mang->getValueName(MO.getGlobal())); O << "L" << Mang->getValueName(MO.getGlobal()) << "$stub"; } else { diff --git a/lib/Target/PowerPC/PPCAsmPrinter.cpp b/lib/Target/PowerPC/PPCAsmPrinter.cpp index 636b1c413d..322122a28b 100644 --- a/lib/Target/PowerPC/PPCAsmPrinter.cpp +++ b/lib/Target/PowerPC/PPCAsmPrinter.cpp @@ -427,7 +427,9 @@ void Printer::printOp(const MachineOperand &MO, return; case MachineOperand::MO_GlobalAddress: if (!elideOffsetKeyword) { - if (isa<Function>(MO.getGlobal())) { + // Dynamically-resolved functions need a stub for the function + Function *F = dyn_cast<Function>(MO.getGlobal()); + if (F && F->isExternal()) { Stubs.insert(Mang->getValueName(MO.getGlobal())); O << "L" << Mang->getValueName(MO.getGlobal()) << "$stub"; } else { diff --git a/lib/Target/PowerPC/PowerPCAsmPrinter.cpp b/lib/Target/PowerPC/PowerPCAsmPrinter.cpp index 636b1c413d..322122a28b 100644 --- a/lib/Target/PowerPC/PowerPCAsmPrinter.cpp +++ b/lib/Target/PowerPC/PowerPCAsmPrinter.cpp @@ -427,7 +427,9 @@ void Printer::printOp(const MachineOperand &MO, return; case MachineOperand::MO_GlobalAddress: if (!elideOffsetKeyword) { - if (isa<Function>(MO.getGlobal())) { + // Dynamically-resolved functions need a stub for the function + Function *F = dyn_cast<Function>(MO.getGlobal()); + if (F && F->isExternal()) { Stubs.insert(Mang->getValueName(MO.getGlobal())); O << "L" << Mang->getValueName(MO.getGlobal()) << "$stub"; } else { |