Skip to content

Commit b755295

Browse files
committed
Merge from mainline.
Revert the part of 45848 that treated weak globals 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/branches/release_22@46167 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent 707e8b8 commit b755295

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

lib/Target/PowerPC/PPCAsmPrinter.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -917,7 +917,8 @@ bool DarwinAsmPrinter::doFinalization(Module &M) {
917917

918918
if (C->isNullValue() && /* FIXME: Verify correct */
919919
!I->hasSection() &&
920-
(I->hasInternalLinkage() || I->hasExternalLinkage())) {
920+
(I->hasInternalLinkage() || I->hasWeakLinkage() ||
921+
I->hasLinkOnceLinkage() || I->hasExternalLinkage())) {
921922
if (Size == 0) Size = 1; // .comm Foo, 0 is undefined, avoid it.
922923
if (I->hasExternalLinkage()) {
923924
O << "\t.globl " << name << '\n';

lib/Target/X86/X86AsmPrinter.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -181,9 +181,8 @@ bool X86SharedAsmPrinter::doFinalization(Module &M) {
181181
}
182182

183183
if (!I->isThreadLocal() &&
184-
(I->hasInternalLinkage() ||
185-
(!Subtarget->isTargetDarwin() &&
186-
(I->hasWeakLinkage() || I->hasLinkOnceLinkage())))) {
184+
(I->hasInternalLinkage() || I->hasWeakLinkage() ||
185+
I->hasLinkOnceLinkage())) {
187186
if (Size == 0) Size = 1; // .comm Foo, 0 is undefined, avoid it.
188187
if (!NoZerosInBSS && TAI->getBSSSection())
189188
SwitchToDataSection(TAI->getBSSSection(), I);

0 commit comments

Comments
 (0)