[ELF.h] - Check the case when e_shstrndx=SHN_XINDEX, but the corresponding sh_link...
commit0b2c2aa3adc5ff2e14cb267cd5728383ea55f5d0
authorGeorge Rimar <grimar@accesssoftek.com>
Wed, 7 Aug 2019 09:29:42 +0000 (7 09:29 +0000)
committerGeorge Rimar <grimar@accesssoftek.com>
Wed, 7 Aug 2019 09:29:42 +0000 (7 09:29 +0000)
treed7067ad802f6d84b2f86e4bf11e6eb7dc8945fc5
parent11c16984ac9a4bcb09e4898f55aba87fbedb3d95
[ELF.h] - Check the case when e_shstrndx=SHN_XINDEX, but the corresponding sh_link is broken.

When e_shstrndx is equal to SHN_XINDEX,
the index of the section string table section should
be taken from the sh_link field of the section
header at index 0.

If sh_link is broken, e.g. contains an index that is
larger than number of sections, then error is reported.

This error message was untested before.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368139 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Object/ELF.h
test/Object/invalid.test