From f88c81e332a46e1e41761577067d5597535b06b9 Mon Sep 17 00:00:00 2001 From: Dale Johannesen Date: Fri, 16 May 2008 00:52:06 +0000 Subject: [PATCH] Treat common as distinct from weak global on Darwin x86. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51172 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/X86/X86AsmPrinter.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/Target/X86/X86AsmPrinter.cpp b/lib/Target/X86/X86AsmPrinter.cpp index 3898a9ee465..a99588b13b3 100644 --- a/lib/Target/X86/X86AsmPrinter.cpp +++ b/lib/Target/X86/X86AsmPrinter.cpp @@ -211,6 +211,16 @@ bool X86SharedAsmPrinter::doFinalization(Module &M) { O << TAI->getLCOMMDirective() << name << "," << Size; if (Subtarget->isTargetDarwin()) O << "," << Align; + } else if (Subtarget->isTargetDarwin() && !I->hasCommonLinkage()) { + O << "\t.globl " << name << "\n" + << TAI->getWeakDefDirective() << name << "\n"; + SwitchToDataSection("\t.section __DATA,__datacoal_nt,coalesced", I); + EmitAlignment(Align, I); + O << name << ":\t\t\t\t" << TAI->getCommentString() << " "; + PrintUnmangledNameSafely(I, O); + O << "\n"; + EmitGlobalConstant(C); + continue; } else { O << TAI->getCOMMDirective() << name << "," << Size; -- 2.34.1