aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'lld/MachO/Writer.cpp')
-rw-r--r--lld/MachO/Writer.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/lld/MachO/Writer.cpp b/lld/MachO/Writer.cpp
index fa42c1c7e61c..e9d88af90ecc 100644
--- a/lld/MachO/Writer.cpp
+++ b/lld/MachO/Writer.cpp
@@ -578,6 +578,10 @@ void Writer::createOutputSections() {
MapVector<std::pair<StringRef, StringRef>, MergedOutputSection *>
mergedOutputSections;
for (InputSection *isec : inputSections) {
+ // Instead of emitting DWARF sections, we emit STABS symbols to the object
+ // files that contain them.
+ if (isDebugSection(isec->flags) && isec->segname == segment_names::dwarf)
+ continue;
MergedOutputSection *&osec =
mergedOutputSections[{isec->segname, isec->name}];
if (osec == nullptr)
@@ -591,8 +595,9 @@ void Writer::createOutputSections() {
if (unwindInfoSection && segname == segment_names::ld) {
assert(osec->name == section_names::compactUnwind);
unwindInfoSection->setCompactUnwindSection(osec);
- } else
+ } else {
getOrCreateOutputSegment(segname)->addOutputSection(osec);
+ }
}
for (SyntheticSection *ssec : syntheticSections) {