mirror of
https://github.com/RPCS3/llvm.git
synced 2024-12-03 17:32:59 +00:00
Object: Handle files without a dynamic symbol table.
Differential Revision: https://reviews.llvm.org/D29482 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294013 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
4692382fbf
commit
055ebfae9a
@ -895,6 +895,8 @@ elf_symbol_iterator ELFObjectFile<ELFT>::dynamic_symbol_begin() const {
|
||||
template <class ELFT>
|
||||
elf_symbol_iterator ELFObjectFile<ELFT>::dynamic_symbol_end() const {
|
||||
const Elf_Shdr *SymTab = DotDynSymSec;
|
||||
if (!SymTab)
|
||||
return dynamic_symbol_begin();
|
||||
DataRefImpl Sym = toDRI(SymTab, SymTab->sh_size / sizeof(Elf_Sym));
|
||||
return basic_symbol_iterator(SymbolRef(Sym, this));
|
||||
}
|
||||
|
@ -29,3 +29,5 @@ RUN: not llvm-nm -D %p/Inputs/trivial-object-test.coff-i386 2>&1 \
|
||||
RUN: | FileCheck %s -check-prefix ERROR
|
||||
|
||||
ERROR: File format has no dynamic symbol table.
|
||||
|
||||
RUN: llvm-nm -D %p/Inputs/trivial-object-test.elf-i386 | count 0
|
||||
|
Loading…
Reference in New Issue
Block a user