Skip to content

Commit f2190a5

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. llvm-svn: 46167
1 parent 93f7a28 commit f2190a5

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

llvm/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';

llvm/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)