mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-15 20:29:48 +00:00
Adding linkonce linkage codegeneration support for mingw32\cygwin
targets. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31011 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
278dbaa17f
commit
b7188b1684
@ -89,8 +89,20 @@ bool X86ATTAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
|
||||
EmitAlignment(4, F); // FIXME: This should be parameterized somewhere.
|
||||
O << "\t.globl\t" << CurrentFnName << "\n";
|
||||
break;
|
||||
case Function::WeakLinkage:
|
||||
case Function::LinkOnceLinkage:
|
||||
if (Subtarget->isTargetDarwin()) {
|
||||
O << "\t.globl\t" << CurrentFnName << "\n";
|
||||
O << "\t.weak_definition\t" << CurrentFnName << "\n";
|
||||
} else if (Subtarget->isTargetCygwin()) {
|
||||
EmitAlignment(4, F); // FIXME: This should be parameterized somewhere.
|
||||
O << "\t.linkonce discard\n";
|
||||
O << "\t.globl " << CurrentFnName << "\n";
|
||||
} else {
|
||||
EmitAlignment(4, F); // FIXME: This should be parameterized somewhere.
|
||||
O << "\t.weak " << CurrentFnName << "\n";
|
||||
}
|
||||
break;
|
||||
case Function::WeakLinkage:
|
||||
if (Subtarget->isTargetDarwin()) {
|
||||
O << "\t.globl\t" << CurrentFnName << "\n";
|
||||
O << "\t.weak_definition\t" << CurrentFnName << "\n";
|
||||
|
@ -174,6 +174,19 @@ bool X86SharedAsmPrinter::doFinalization(Module &M) {
|
||||
} else {
|
||||
switch (I->getLinkage()) {
|
||||
case GlobalValue::LinkOnceLinkage:
|
||||
if (Subtarget->isTargetDarwin()) {
|
||||
O << "\t.globl " << name << "\n"
|
||||
<< "\t.weak_definition " << name << "\n";
|
||||
SwitchToDataSection(".section __DATA,__const_coal,coalesced", I);
|
||||
} else if (Subtarget->isTargetCygwin()) {
|
||||
O << "\t.section\t.llvm.linkonce.d." << name << ",\"aw\"\n"
|
||||
<< "\t.globl " << name << "\n"
|
||||
<< "\t.linkonce same_size\n";
|
||||
} else {
|
||||
O << "\t.section\t.llvm.linkonce.d." << name << ",\"aw\",@progbits\n"
|
||||
<< "\t.weak " << name << "\n";
|
||||
}
|
||||
break;
|
||||
case GlobalValue::WeakLinkage:
|
||||
if (Subtarget->isTargetDarwin()) {
|
||||
O << "\t.globl " << name << "\n"
|
||||
|
Loading…
Reference in New Issue
Block a user