[llvm-readobj] - Do not skip building of the GNU hash table histogram.
authorGeorgii Rymar <grimar@accesssoftek.com>
Tue, 19 May 2020 12:31:25 +0000 (15:31 +0300)
committerGeorgii Rymar <grimar@accesssoftek.com>
Wed, 27 May 2020 10:46:41 +0000 (13:46 +0300)
commitfc98447af65f5a51d3b62a7e76a056d2556be59d
tree06e1fd15eabefaf5d56897e3ccfefc3c7846d874
parent019bd6485c52a62c008eacfdf0d13a26ca6b0a6f
[llvm-readobj] - Do not skip building of the GNU hash table histogram.

When the `--elf-hash-histogram` is used, the code first tries to build
a histogram for the .hash table and then for the .gnu.hash table.

The problem is that dumper might return early when unable or do not need to
build a histogram for the .hash.

This patch reorders the code slightly to fix the issue and adds a test case.

Differential revision: https://reviews.llvm.org/D80204
llvm/test/tools/llvm-readobj/ELF/hash-histogram.test
llvm/tools/llvm-readobj/ELFDumper.cpp