mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-28 06:32:09 +00:00
Darwin PPC external weak linkage support.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32068 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
6d7d310519
commit
1c45a66873
@ -52,6 +52,9 @@ namespace {
|
||||
std::set<std::string> FnStubs, GVStubs;
|
||||
const PPCSubtarget &Subtarget;
|
||||
|
||||
// Necessary for external weak linkage support
|
||||
std::set<std::string> ExtWeakSymbols;
|
||||
|
||||
PPCAsmPrinter(std::ostream &O, TargetMachine &TM, const TargetAsmInfo *T)
|
||||
: AsmPrinter(O, TM, T), Subtarget(TM.getSubtarget<PPCSubtarget>()) {
|
||||
}
|
||||
@ -159,6 +162,8 @@ namespace {
|
||||
std::string Name = Mang->getValueName(GV);
|
||||
FnStubs.insert(Name);
|
||||
O << "L" << Name << "$stub";
|
||||
if (GV->hasExternalWeakLinkage())
|
||||
ExtWeakSymbols.insert(Name);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -330,8 +335,10 @@ void PPCAsmPrinter::printOp(const MachineOperand &MO) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
O << Name;
|
||||
|
||||
if (GV->hasExternalWeakLinkage())
|
||||
ExtWeakSymbols.insert(Name);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -633,6 +640,13 @@ bool DarwinAsmPrinter::doFinalization(Module &M) {
|
||||
}
|
||||
}
|
||||
|
||||
if (ExtWeakSymbols.begin() != ExtWeakSymbols.end())
|
||||
SwitchToDataSection("");
|
||||
for (std::set<std::string>::iterator i = ExtWeakSymbols.begin(),
|
||||
e = ExtWeakSymbols.end(); i != e; ++i) {
|
||||
O << "\t.weak_reference " << *i << "\n";
|
||||
}
|
||||
|
||||
bool isPPC64 = TD->getPointerSizeInBits() == 64;
|
||||
|
||||
// Output stubs for dynamically-linked functions
|
||||
|
Loading…
x
Reference in New Issue
Block a user