mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-11-23 22:00:10 +00:00
Avoid SEGFAULT if a requested symbol section is absent.
Patch by Igor Kudrin! llvm-svn: 248194
This commit is contained in:
parent
98a98cffb6
commit
8055ed0c12
2
llvm/test/Object/readobj-absent.test
Normal file
2
llvm/test/Object/readobj-absent.test
Normal file
@ -0,0 +1,2 @@
|
||||
// Don't crash if required information is absent
|
||||
RUN: llvm-readobj -dyn-symbols %p/Inputs/trivial-object-test.elf-x86-64
|
@ -1152,6 +1152,8 @@ void ELFDumper<ELFT>::printRelocation(Elf_Rela Rel, const Elf_Shdr *SymTab) {
|
||||
template<class ELFT>
|
||||
void ELFDumper<ELFT>::printSymbolsHelper(bool IsDynamic) {
|
||||
const Elf_Shdr *Symtab = (IsDynamic) ? DotDynSymSec : DotSymtabSec;
|
||||
if (!Symtab)
|
||||
return;
|
||||
ErrorOr<StringRef> StrTableOrErr = Obj->getStringTableForSymtab(*Symtab);
|
||||
error(StrTableOrErr.getError());
|
||||
StringRef StrTable = *StrTableOrErr;
|
||||
|
Loading…
Reference in New Issue
Block a user