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

Xing GUO via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 24 03:12:17 PDT 2020


Higuoxing marked an inline comment as done.
Higuoxing 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
----------------
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.


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