Skip to content

Commit 277b591

Browse files
author
git apple-llvm automerger
committed
Merge commit '786154a9853d' from apple/stable/20200108 into swift/release/5.3
2 parents ea0202e + 786154a commit 277b591

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

llvm/test/tools/dsymutil/X86/swift-ast-x86_64.test

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,6 @@ READOBJ-NEXT: |.|
1818

1919
RUN: dsymutil -oso-prepend-path %p/.. %p/../Inputs/swift-ast.macho.x86_64 -no-output -verbose 2>&1 | FileCheck %s --check-prefix=TIMESTAMP
2020
TIMESTAMP: warning: Timestamp mismatch
21+
22+
RUN: dsymutil -s %T/swift-ast.dSYM/Contents/Resources/DWARF/swift-ast.macho.x86_64 | FileCheck %s --check-prefix=NAST
23+
NAST-NOT: N_AST

llvm/tools/dsymutil/MachOUtils.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,15 @@ static bool transferSymbol(NListTy NList, bool IsLittleEndian,
163163
if ((NList.n_type & MachO::N_TYPE) == MachO::N_UNDF)
164164
return false;
165165

166+
// Do not transfer N_AST symbols as their content is copied into a section of
167+
// the Mach-O companion file.
168+
if (NList.n_type == MachO::N_AST)
169+
return false;
170+
166171
StringRef Name = StringRef(Strings.begin() + NList.n_strx);
172+
173+
// An N_SO with a filename opens a debugging scope and another one without a
174+
// name closes it. Don't transfer anything in the debugging scope.
167175
if (InDebugNote) {
168176
InDebugNote =
169177
(NList.n_type != MachO::N_SO) || (!Name.empty() && Name[0] != '\0');

0 commit comments

Comments
 (0)