mirror of
https://github.com/intel/llvm.git
synced 2026-01-26 20:23:39 +08:00
[ELF] - Fixed assert fail when symbol table has zero sh_info value.
When sh_info of sumbol table value was set to zero, lld was asserting. Patch fixes the issue. Differential revision: https://reviews.llvm.org/D25016 llvm-svn: 283562
This commit is contained in:
@@ -81,7 +81,7 @@ typename ELFT::SymRange ELFFileBase<ELFT>::getElfSymbols(bool OnlyGlobals) {
|
||||
Elf_Sym_Range Syms = ELFObj.symbols(Symtab);
|
||||
uint32_t NumSymbols = std::distance(Syms.begin(), Syms.end());
|
||||
uint32_t FirstNonLocal = Symtab->sh_info;
|
||||
if (FirstNonLocal > NumSymbols)
|
||||
if (FirstNonLocal == 0 || FirstNonLocal > NumSymbols)
|
||||
fatal(getFilename(this) + ": invalid sh_info in symbol table");
|
||||
|
||||
if (OnlyGlobals)
|
||||
|
||||
Reference in New Issue
Block a user