mirror of
https://github.com/intel/llvm.git
synced 2026-01-27 06:06:34 +08:00
[ELF] - Check that .dynsym is present in DSO if SHT_GNU_versym section is.
When we have SHT_GNU_versym section, it is should be associated with symbol table
section. Usually (and in out implementation) it is .dynsym.
In case when .dynsym is absent (due to broken object for example),
lld crashes in parseVerdefs() when accesses null pointer:
Versym = reinterpret_cast<const Elf_Versym *>(this->ELFObj.base() +
VersymSec->sh_offset) +
this->Symtab->sh_info;
DIfferential revision: https://reviews.llvm.org/D25553
llvm-svn: 285796
This commit is contained in:
@@ -610,6 +610,9 @@ template <class ELFT> void SharedFile<ELFT>::parseSoName() {
|
||||
}
|
||||
}
|
||||
|
||||
if (this->VersymSec && !this->Symtab)
|
||||
error("SHT_GNU_versym should be associated with symbol table");
|
||||
|
||||
this->initStringTable();
|
||||
|
||||
// DSOs are identified by soname, and they usually contain
|
||||
|
||||
Reference in New Issue
Block a user