Add a comment about ELF spec and the symbol table's sh_info.

llvm-svn: 327645
This commit is contained in:
Rui Ueyama 2018-03-15 17:10:50 +00:00
parent 96cf00d01d
commit 8e53917a26

View File

@ -866,6 +866,10 @@ template <class ELFT> void SharedFile<ELFT>::parseRest() {
continue;
}
// ELF spec requires that all local symbols precede weak or global
// symbols in each symbol table, and the index of first non-local symbol
// is stored to sh_info. If a local symbol appears after some non-local
// symbol, that's a violation of the spec.
if (Sym.getBinding() == STB_LOCAL) {
warn("found local symbol '" + Name +
"' in global part of symbol table in file " + toString(this));