diff options
| author | George Rimar <grimar@accesssoftek.com> | 2016-10-07 15:16:27 +0000 |
|---|---|---|
| committer | George Rimar <grimar@accesssoftek.com> | 2016-10-07 15:16:27 +0000 |
| commit | 9397cf953cd02ede85e84b37360ad87748fcefe0 (patch) | |
| tree | f408df3e7490578f7e0726ee02a20d0c83855f29 /lld/ELF/InputFiles.cpp | |
| parent | e513e17b238298b79c1ea055d37ab91bdcef6dd9 (diff) | |
| download | bcm5719-llvm-9397cf953cd02ede85e84b37360ad87748fcefe0.tar.gz bcm5719-llvm-9397cf953cd02ede85e84b37360ad87748fcefe0.zip | |
[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
Diffstat (limited to 'lld/ELF/InputFiles.cpp')
| -rw-r--r-- | lld/ELF/InputFiles.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lld/ELF/InputFiles.cpp b/lld/ELF/InputFiles.cpp index dda18aa8a4c..d9630790e2c 100644 --- a/lld/ELF/InputFiles.cpp +++ b/lld/ELF/InputFiles.cpp @@ -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) |

