[llvm-readobj] - Don't crash when checking the number of dynamic symbols.
authorGeorgii Rymar <grimar@accesssoftek.com>
Tue, 30 Jun 2020 14:14:45 +0000 (17:14 +0300)
committerGeorgii Rymar <grimar@accesssoftek.com>
Wed, 1 Jul 2020 09:14:10 +0000 (12:14 +0300)
commit61f967dccabab67f9996a4fb1c6ec4fa4f23f005
tree6cc5801aba22e63833d4bcc409af6e2c5cb76921
parent917bdfaca6df575f617b0f3aa989183ab187e8ac
[llvm-readobj] - Don't crash when checking the number of dynamic symbols.

When we deriving the number of symbols from the DT_HASH table, we can crash when
calculate the number of symbols in the symbol table when SHT_DYNSYM
has sh_entsize == 0.

The patch fixes the issue.

Differential revision: https://reviews.llvm.org/D82877
llvm/test/tools/llvm-readobj/ELF/dyn-symbols-size-from-hash-table.test
llvm/tools/llvm-readobj/ELFDumper.cpp