[llvm/Object] - Fix the error message reported for a broken SHT_SYMTAB_SHNDX section.
authorgeorgerim <georgerim@gmail.com>
Fri, 25 Oct 2019 08:55:11 +0000 (11:55 +0300)
committergeorgerim <georgerim@gmail.com>
Fri, 25 Oct 2019 09:19:46 +0000 (12:19 +0300)
commit53c164e2216fd705ceadfdec6ac44b5b175d9248
tree9de735b141f6cb4e83a45605cb1094f7fc5fc28b
parent2a3dc6b74f413c423fe66364c383b1c223ecd4fd
[llvm/Object] - Fix the error message reported for a broken SHT_SYMTAB_SHNDX section.

SHT_SYMTAB_SHNDX should have the same number of entries as the symbol table
associated (https://www.sco.com/developers/gabi/latest/ch4.sheader.html)

We currently can report the following message:
"SHT_SYMTAB_SHNDX section has sh_size (24) which is not equal to the number of symbols (2)"

It is just broken. This patch refines/fixes it.

Differential revision: https://reviews.llvm.org/D69305
llvm/include/llvm/Object/ELF.h
llvm/test/Object/invalid.test
llvm/test/tools/obj2yaml/elf-sht-symtab-shndx.yaml