[PATCH] D76081: [Object] object::ELFObjectFile::dynamic_symbol_begin(): skip symbol index 0

James Henderson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 24 03:44:07 PDT 2020


jhenderson added inline comments.


================
Comment at: llvm/test/tools/llvm-nm/dynamic-symbols.test:60-61
+
+## Test llvm-nm dumping ELF file with malformed .dynsym section header
+## whose sh_size doesn't match dynamic symbol entries (sh_size % sizeof(Elf_Sym) != 0).
+# RUN: yaml2obj --docnum=4 -DBITS=32 %s -o %t4-32.o
----------------
Higuoxing wrote:
> jhenderson wrote:
> > What does GNU nm do in this situation?
> `GNU nm` will dump the part `sh_size / sizeof(Elf_Sym)` rather than drop them all.
> 
> I could revert the change in `dynamic_symbol_end()` to imitate this behavior.
I think we should imitate GNU (and show that we are for this case with a slightly modified test case).


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D76081





More information about the llvm-commits mailing list