1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-25 12:12:47 +01:00

linkage fix for weak functions

llvm-svn: 25976
This commit is contained in:
Andrew Lenharth 2006-02-04 19:13:09 +00:00
parent 4f433dafa5
commit b28db2290a

View File

@ -173,9 +173,22 @@ bool AlphaAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
EmitConstantPool(MF.getConstantPool());
// Print out labels for the function.
SwitchSection("\t.section .text", MF.getFunction());
EmitAlignment(4);
O << "\t.globl " << CurrentFnName << "\n";
const Function *F = MF.getFunction();
SwitchSection(".text", F);
EmitAlignment(4, F);
switch (F->getLinkage()) {
default: assert(0 && "Unknown linkage type!");
case Function::InternalLinkage: // Symbols default to internal.
break;
case Function::ExternalLinkage:
O << "\t.globl " << CurrentFnName << "\n";
break;
case Function::WeakLinkage:
case Function::LinkOnceLinkage:
O << "\t.weak " << CurrentFnName << "\n";
break;
}
O << "\t.ent " << CurrentFnName << "\n";
O << CurrentFnName << ":\n";