[llvm-readobj/elf] - Change the behavior of handing DT_SONAME.
authorGeorgii Rymar <grimar@accesssoftek.com>
Wed, 14 Oct 2020 11:20:38 +0000 (14:20 +0300)
committerGeorgii Rymar <grimar@accesssoftek.com>
Mon, 19 Oct 2020 12:02:09 +0000 (15:02 +0300)
commit6a5f9503640ff38f537e19ca0be3440b13de3120
tree3ad28b495bc0878343dc1a51bcf763e6838d8851
parent03f3ef221b0257a91182640563440fe8dd104c81
[llvm-readobj/elf] - Change the behavior of handing DT_SONAME.

The current situation/behavior is:
1) llvm-readelf doesn't need a string that is specified by `DT_SONAME`.
2) llvm-readobj/elf always tries to read it, even when there is no `DT_SONAME` tag.
3) Because of that both tools reports a warning for many our test cases.

This patch delays getting a SOName string and changes the behavior (llvm-readobj) to
only report a warning when there is a `DT_SONAME` and a string cab't be read.
Warning is not reported for llvm-readelf, as it never tries to dump it.

Differential revision: https://reviews.llvm.org/D89384
llvm/test/tools/llvm-readobj/ELF/dynamic-malformed.test
llvm/test/tools/llvm-readobj/ELF/dynamic-tags.test
llvm/test/tools/llvm-readobj/ELF/hash-table.test
llvm/test/tools/llvm-readobj/ELF/needed-libs.test
llvm/tools/llvm-readobj/ELFDumper.cpp