[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 07:29:54 PDT 2020


Higuoxing added a comment.

In D76081#1939029 <https://reviews.llvm.org/D76081#1939029>, @grimar wrote:

> In D76081#1939002 <https://reviews.llvm.org/D76081#1939002>, @Higuoxing wrote:
>
> > - Make `llvm-nm` imitate `gnu-nm`'s behavior.
> >
> >   To make `llvm-nm` behave like `gnu-nm`, I have to remove `sh_size % sizeof(Elf_Sym)` check in `dynamic_symbol_begin()`, I'm wondering if @grimar is happy with this, since you are concerned about this.
>
>
> Probably I am not, because this is the patch for Object and not for `llvm-nm`. What is good for `llvm-nm` might not work for other tools.
>  When  `sh_size % sizeof(Elf_Sym) != 0` it means we have a error. 
>  I guess such things should be fixed on `llvm-nm` side and not in libObject. We can probably adjust this later though as this patch is still an improvement.
>
> @jhenderson, what do you think?


Thanks a lot. IMHO, we could let `dynamic_symbol_begin()` return these symbols, and do error checking/handling in clients. Or, it's not very easy to regain these symbols in client side (Feel free to ignore this)?


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