Revert the part of 45848 that treated weak globals
authorDale Johannesen <dalej@apple.com>
Thu, 17 Jan 2008 23:04:07 +0000 (23:04 +0000)
committerDale Johannesen <dalej@apple.com>
Thu, 17 Jan 2008 23:04:07 +0000 (23:04 +0000)
as weak globals rather than commons.  While not wrong,
this change tickled a latent bug in Darwin's strip,
so revert it for now as a workaround.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46144 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/PowerPC/PPCAsmPrinter.cpp
lib/Target/X86/X86AsmPrinter.cpp

index fb8418157d9674b6ff1072e6132575ae50bf342d..d5367dca3503a48323be7810ccc4cb3799c66af2 100644 (file)
@@ -917,7 +917,8 @@ bool DarwinAsmPrinter::doFinalization(Module &M) {
 
     if (C->isNullValue() && /* FIXME: Verify correct */
         !I->hasSection() &&
-        (I->hasInternalLinkage() || I->hasExternalLinkage())) {
+        (I->hasInternalLinkage() || I->hasWeakLinkage() ||
+         I->hasLinkOnceLinkage() || I->hasExternalLinkage())) {
       if (Size == 0) Size = 1;   // .comm Foo, 0 is undefined, avoid it.
       if (I->hasExternalLinkage()) {
         O << "\t.globl " << name << '\n';
index b0e8165ad1c880b897728c862591185f8b129a2f..f9756f046f6214397e6e715236c1c80652d2096c 100644 (file)
@@ -181,9 +181,8 @@ bool X86SharedAsmPrinter::doFinalization(Module &M) {
       }
       
       if (!I->isThreadLocal() &&
-          (I->hasInternalLinkage() || 
-           (!Subtarget->isTargetDarwin() && 
-            (I->hasWeakLinkage() || I->hasLinkOnceLinkage())))) {
+          (I->hasInternalLinkage() || I->hasWeakLinkage() ||
+           I->hasLinkOnceLinkage())) {
         if (Size == 0) Size = 1;   // .comm Foo, 0 is undefined, avoid it.
         if (!NoZerosInBSS && TAI->getBSSSection())
           SwitchToDataSection(TAI->getBSSSection(), I);