diff --git a/llvm/test/tools/dsymutil/X86/swift-ast-x86_64.test b/llvm/test/tools/dsymutil/X86/swift-ast-x86_64.test --- a/llvm/test/tools/dsymutil/X86/swift-ast-x86_64.test +++ b/llvm/test/tools/dsymutil/X86/swift-ast-x86_64.test @@ -18,3 +18,6 @@ RUN: dsymutil -oso-prepend-path %p/.. %p/../Inputs/swift-ast.macho.x86_64 -no-output -verbose 2>&1 | FileCheck %s --check-prefix=TIMESTAMP TIMESTAMP: warning: Timestamp mismatch + +RUN: dsymutil -s %T/swift-ast.dSYM/Contents/Resources/DWARF/swift-ast.macho.x86_64 | FileCheck %s --check-prefix=NAST +NAST-NOT: N_AST diff --git a/llvm/tools/dsymutil/MachOUtils.cpp b/llvm/tools/dsymutil/MachOUtils.cpp --- a/llvm/tools/dsymutil/MachOUtils.cpp +++ b/llvm/tools/dsymutil/MachOUtils.cpp @@ -163,6 +163,10 @@ if ((NList.n_type & MachO::N_TYPE) == MachO::N_UNDF) return false; + // Do not transfer AST or OSO symbols as they're only needed by dsymutil. + if (NList.n_type == MachO::N_AST || NList.n_type == MachO::N_OSO) + return false; + StringRef Name = StringRef(Strings.begin() + NList.n_strx); if (InDebugNote) { InDebugNote =