mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-25 20:23:11 +01:00
llvm-objdump: don't assert if ELF file has no sections
FreeBSD core files, for example, have no sections (only program headers). llvm.org/pr20139 Differential Revision: http://reviews.llvm.org/D4323 llvm-svn: 211904
This commit is contained in:
parent
3be4bd19cf
commit
2e5df25fce
@ -602,7 +602,7 @@ void ELFFile<ELFT>::VerifyStrTab(const Elf_Shdr *sh) const {
|
||||
template <class ELFT>
|
||||
uint64_t ELFFile<ELFT>::getNumSections() const {
|
||||
assert(Header && "Header not initialized!");
|
||||
if (Header->e_shnum == ELF::SHN_UNDEF) {
|
||||
if (Header->e_shnum == ELF::SHN_UNDEF && Header->e_shoff > 0) {
|
||||
assert(SectionHeaderTable && "SectionHeaderTable not initialized!");
|
||||
return SectionHeaderTable->sh_size;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user