mirror of
https://github.com/RPCS3/llvm.git
synced 2024-12-03 17:32:59 +00:00
Avoid SEGFAULT if a requested symbol section is absent.
Patch by Igor Kudrin! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@248194 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
a2259fcf68
commit
82ede2f136
2
test/Object/readobj-absent.test
Normal file
2
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