mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-27 16:17:17 +00:00
linkage fix for weak functions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25976 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -173,9 +173,22 @@ bool AlphaAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
|
|||||||
EmitConstantPool(MF.getConstantPool());
|
EmitConstantPool(MF.getConstantPool());
|
||||||
|
|
||||||
// Print out labels for the function.
|
// Print out labels for the function.
|
||||||
SwitchSection("\t.section .text", MF.getFunction());
|
const Function *F = MF.getFunction();
|
||||||
EmitAlignment(4);
|
SwitchSection(".text", F);
|
||||||
O << "\t.globl " << CurrentFnName << "\n";
|
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 << "\t.ent " << CurrentFnName << "\n";
|
||||||
|
|
||||||
O << CurrentFnName << ":\n";
|
O << CurrentFnName << ":\n";
|
||||||
|
Reference in New Issue
Block a user