HomePhabricator

[llvm-readelf] - Don't crash when e_shstrndx==SHN_XINDEX, but there is no…

Authored by grimar on Jun 23 2020, 5:55 AM.

Description

[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