Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion llvm/lib/DWARFLinker/Classic/DWARFLinker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3129,7 +3129,6 @@ Error DWARFLinker::link() {
// Emit everything that's global.
if (TheDwarfEmitter != nullptr) {
TheDwarfEmitter->emitAbbrevs(Abbreviations, Options.TargetDWARFVersion);
TheDwarfEmitter->emitStrings(DebugStrPool);
TheDwarfEmitter->emitStringOffsets(StringOffsetPool.getValues(),
Options.TargetDWARFVersion);
TheDwarfEmitter->emitLineStrings(DebugLineStrPool);
Expand All @@ -3150,6 +3149,7 @@ Error DWARFLinker::link() {
break;
}
}
TheDwarfEmitter->emitStrings(DebugStrPool);
}
};

Expand Down
17 changes: 17 additions & 0 deletions llvm/test/tools/dsymutil/X86/swift-ast-section-order.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Check that the __debug_str section is last in the output

# RUN: rm -rf %t && mkdir %t
# RUN: dsymutil -oso-prepend-path %p/.. %p/../Inputs/swift-ast.macho.x86_64 -o %t/swift-ast.dSYM -verbose -no-swiftmodule-timestamp
# RUN: llvm-dwarfdump --show-section-sizes %t/swift-ast.dSYM/Contents/Resources/DWARF/swift-ast.macho.x86_64 | FileCheck %s

# This test verifies that the __debug_str section appears last in the section list.

# CHECK: SECTION
# CHECK: __swift_ast
# CHECK: __debug_abbrev
# CHECK: __apple_namespac
# CHECK: __apple_names
# CHECK: __apple_types
# CHECK: __apple_objc
# CHECK-NOT: __apple
# CHECK: __debug_str