[llvm-readelf] - Don't crash when e_shstrndx==SHN_XINDEX, but there is no section...
authorGeorgii Rymar <grimar@accesssoftek.com>
Tue, 23 Jun 2020 12:55:17 +0000 (15:55 +0300)
committerGeorgii Rymar <grimar@accesssoftek.com>
Wed, 24 Jun 2020 11:09:34 +0000 (14:09 +0300)
commit31fe8c2763a8982e16646f85ac09f2362341306c
treeb2c8206b4fd5cd38e9c2f7ad5da6afc45d02f6d1
parent72131423cc952ccbd6d8e021ff7c04fa22297fe3
[llvm-readelf] - Don't crash when e_shstrndx==SHN_XINDEX, but there is no section header.

Currently we crash when trying to print --sections and the SHN_XINDEX escape value
is used for the e_shstrndx field, but there is no section header at index 0 to
read the value from.

Differential revision: https://reviews.llvm.org/D82374
llvm/include/llvm/Object/ELF.h
llvm/test/tools/llvm-readobj/ELF/many-sections.s