Skip to content

Commit 7432cee

Browse files
committed
Add a flag to enable a darwin linker optimization
llvm-svn: 24130
1 parent 6b63e0c commit 7432cee

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -567,6 +567,13 @@ bool DarwinAsmPrinter::doFinalization(Module &M) {
567567
<< "\t.long\t" << *i << '\n';
568568
}
569569

570+
// Funny Darwin hack: This flag tells the linker that no global symbols
571+
// contain code that falls through to other global symbols (e.g. the obvious
572+
// implementation of multiple entry points). If this doesn't occur, the
573+
// linker can safely perform dead code stripping. Since LLVM never generates
574+
// code that does this, it is always safe to set.
575+
O << "\t.subsections_via_symbols\n";
576+
570577
AsmPrinter::doFinalization(M);
571578
return false; // success
572579
}
@@ -711,7 +718,6 @@ bool AIXAsmPrinter::doFinalization(Module &M) {
711718
O << "_section_.text:\n"
712719
<< "\t.csect .data[RW],3\n"
713720
<< "\t.llong _section_.text\n";
714-
715721
delete Mang;
716722
return false; // success
717723
}

0 commit comments

Comments
 (0)