[PATCH] D81205: [dsymutil] Don't emit N_AST symbol entries in the Mach-O companion file

Jonas Devlieghere via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 5 08:55:20 PDT 2020


This revision was automatically updated to reflect the committed changes.
Closed by commit rGfe82d3a3ae32: [dsymutil] Don't emit N_AST symbol entries in the Mach-O companion file (authored by JDevlieghere).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D81205/new/

https://reviews.llvm.org/D81205

Files:
  llvm/test/tools/dsymutil/X86/swift-ast-x86_64.test
  llvm/tools/dsymutil/MachOUtils.cpp


Index: llvm/tools/dsymutil/MachOUtils.cpp
===================================================================
--- llvm/tools/dsymutil/MachOUtils.cpp
+++ llvm/tools/dsymutil/MachOUtils.cpp
@@ -163,7 +163,15 @@
   if ((NList.n_type & MachO::N_TYPE) == MachO::N_UNDF)
     return false;
 
+  // Do not transfer N_AST symbols as their content is copied into a section of
+  // the Mach-O companion file.
+  if (NList.n_type == MachO::N_AST)
+    return false;
+
   StringRef Name = StringRef(Strings.begin() + NList.n_strx);
+
+  // An N_SO with a filename opens a debugging scope and another one without a
+  // name closes it. Don't transfer anything in the debugging scope.
   if (InDebugNote) {
     InDebugNote =
         (NList.n_type != MachO::N_SO) || (!Name.empty() && Name[0] != '\0');
Index: llvm/test/tools/dsymutil/X86/swift-ast-x86_64.test
===================================================================
--- llvm/test/tools/dsymutil/X86/swift-ast-x86_64.test
+++ 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


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D81205.268827.patch
Type: text/x-patch
Size: 1366 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200605/3ac73b69/attachment.bin>


More information about the llvm-commits mailing list