[llvm-readobj/readelf] - Don't fail dumping when unable to read the name of the SHT_D...
authorGeorgii Rymar <grimar@accesssoftek.com>
Mon, 20 Jul 2020 14:30:52 +0000 (17:30 +0300)
committerGeorgii Rymar <grimar@accesssoftek.com>
Wed, 22 Jul 2020 10:11:46 +0000 (13:11 +0300)
commit54ef74f738a2750dcf0dc8f97f84c20eab660394
tree923c06c3f5466ffc23e7aeb950d005d73daf3d2c
parentc1d8e3923657a05ffef16ad9039d036924134be7
[llvm-readobj/readelf] - Don't fail dumping when unable to read the name of the SHT_DYNSYM section.

We have an issue currently: we are trying to read the name of the SHT_DYNSYM section
very early and using `unwrapOrError` call for that.

The name is needed only for the GNU output. Because of the current logic, the tool
fails to dump the whole object when something is wrong with the name of the .dynsym section.

This patch delays reading the name and also allows it to be broken.

Differential revision: https://reviews.llvm.org/D84173
llvm/test/tools/llvm-readobj/ELF/dyn-symbols.test
llvm/tools/llvm-readobj/ELFDumper.cpp