[llvm-readobj] - Don't crash when dumping .stack_sizes and unable to find a relocatio...
commit6f5d497396c7d135866cd41d2d89998b70a52322
authorGeorge Rimar <grimar@accesssoftek.com>
Wed, 25 Sep 2019 10:14:50 +0000 (25 10:14 +0000)
committerGeorge Rimar <grimar@accesssoftek.com>
Wed, 25 Sep 2019 10:14:50 +0000 (25 10:14 +0000)
tree4b291e0436d56cba62a8b08abe8f4b7460f5b336
parent76844b64afddd33ff33bc44a8400fa94160fe7bb
[llvm-readobj] - Don't crash when dumping .stack_sizes and unable to find a relocation resolver.

The crash might happen when we have either a broken or unsupported object
and trying to resolve relocations when dumping the .stack_sizes section.

For the test case I used a 32-bits ELF header and a 64-bit relocation.
In this case a null pointer is returned by the code instead of the relocation
resolver function and then we crash.

Differential revision: https://reviews.llvm.org/D67962

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372838 91177308-0d34-0410-b5e6-96231b3b80d8
test/tools/llvm-readobj/stack-sizes.test
tools/llvm-readobj/ELFDumper.cpp