[PATCH] D41657: Do not look up symbol names when n_strx == 0

Davide Italiano via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 2 06:25:00 PST 2018

davide added a comment.

I wonder whether you can use something like `yaml2obj` to craft the object? (or, assuming it's valid, `llvm-mc`)?
That would improve the readability a lot IMHO.
If not, can you at least add comments to the test (e.g. source file + compiler/linker version etc..) in case we need to regenerate this in the future?

Comment at: lib/Object/MachOObjectFile.cpp:1662-1665
+  if (Entry.n_strx == 0) {
+    // contents of the StringTable at n_strx 0 are not defined
+    return StringRef();
+  }
No `{}` around single line ifs.

Comment at: test/tools/llvm-nm/X86/macho-dwarf.test:2
+# RUN: llvm-nm -ap %p/Inputs/macho-dwarf-x86_64 | cat -e | FileCheck %s
Do you need `cat` ? Can't you just pipe the nm output to `FileCheck`?


More information about the llvm-commits mailing list