[llvm-commits] [llvm] r51201 - /llvm/trunk/lib/Target/PowerPC/PPCAsmPrinter.cpp
Dale Johannesen
dalej at apple.com
Fri May 16 13:09:25 PDT 2008
Author: johannes
Date: Fri May 16 15:09:25 2008
New Revision: 51201
URL: http://llvm.org/viewvc/llvm-project?rev=51201&view=rev
Log:
Record weak external linkage in a case where we were
missing it. gcc.dg/darwin-weakimport-2.c.
Handle common and weak differently for darwin ppc32.
Modified:
llvm/trunk/lib/Target/PowerPC/PPCAsmPrinter.cpp
Modified: llvm/trunk/lib/Target/PowerPC/PPCAsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCAsmPrinter.cpp?rev=51201&r1=51200&r2=51201&view=diff
==============================================================================
--- llvm/trunk/lib/Target/PowerPC/PPCAsmPrinter.cpp (original)
+++ llvm/trunk/lib/Target/PowerPC/PPCAsmPrinter.cpp Fri May 16 15:09:25 2008
@@ -393,6 +393,8 @@
GV->hasLinkOnceLinkage() || GV->hasCommonLinkage()))) {
GVStubs.insert(Name);
O << "L" << Name << "$non_lazy_ptr";
+ if (GV->hasExternalWeakLinkage())
+ ExtWeakSymbols.insert(GV);
return;
}
}
@@ -948,6 +950,16 @@
} else if (I->hasInternalLinkage()) {
SwitchToDataSection("\t.data", I);
O << TAI->getLCOMMDirective() << name << "," << Size << "," << Align;
+ } else if (!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 {
SwitchToDataSection("\t.data", I);
O << ".comm " << name << "," << Size;
More information about the llvm-commits
mailing list