External weak linkage is supported by recent binutils on mingw32.
authorAnton Korobeynikov <asl@math.spbu.ru>
Fri, 23 Feb 2007 01:58:50 +0000 (01:58 +0000)
committerAnton Korobeynikov <asl@math.spbu.ru>
Fri, 23 Feb 2007 01:58:50 +0000 (01:58 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34519 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/X86/X86ATTAsmPrinter.cpp
lib/Target/X86/X86TargetAsmInfo.cpp

index 91b22d1981c97bc12228d44df8a98c24cd0280a5..d864c75dd4c626cf8ce755e40cbfb35be0ad5c5f 100755 (executable)
@@ -117,8 +117,8 @@ bool X86ATTAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
       O << "\t.weak_definition\t" << CurrentFnName << "\n";
     } else if (Subtarget->isTargetCygMing()) {
       EmitAlignment(4, F);     // FIXME: This should be parameterized somewhere.
-      O << "\t.linkonce discard\n";
       O << "\t.globl " << CurrentFnName << "\n";
+      O << "\t.linkonce discard\n";
     } else {
       EmitAlignment(4, F);     // FIXME: This should be parameterized somewhere.
       O << "\t.weak " << CurrentFnName << "\n";
index 20e0f195fcf0c4c4900f7f40bd783ae41a91f727..23cab9dff7758ba7da9553ad42cf8ff6f6b8ed15 100644 (file)
@@ -131,6 +131,7 @@ X86TargetAsmInfo::X86TargetAsmInfo(const X86TargetMachine &TM) {
     // Set up DWARF directives
     HasLEB128 = true;  // Target asm supports leb128 directives (little-endian)
     PrivateGlobalPrefix = "L";  // Prefix for private global symbols
+    WeakRefDirective = "\t.weak\t";
     DwarfRequiresFrameSection = false;
     DwarfAbbrevSection =  "\t.section\t.debug_abbrev,\"dr\"";
     DwarfInfoSection =    "\t.section\t.debug_info,\"dr\"";