[PATCH] D29482: Object: Handle files without a dynamic symbol table.
Peter Collingbourne via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Feb 3 09:05:11 PST 2017
This revision was automatically updated to reflect the committed changes.
Closed by commit rL294013: Object: Handle files without a dynamic symbol table. (authored by pcc).
Changed prior to commit:
https://reviews.llvm.org/D29482?vs=86930&id=86976#toc
Repository:
rL LLVM
https://reviews.llvm.org/D29482
Files:
llvm/trunk/include/llvm/Object/ELFObjectFile.h
llvm/trunk/test/Object/nm-shared-object.test
Index: llvm/trunk/include/llvm/Object/ELFObjectFile.h
===================================================================
--- llvm/trunk/include/llvm/Object/ELFObjectFile.h
+++ llvm/trunk/include/llvm/Object/ELFObjectFile.h
@@ -895,6 +895,8 @@
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));
}
Index: llvm/trunk/test/Object/nm-shared-object.test
===================================================================
--- llvm/trunk/test/Object/nm-shared-object.test
+++ llvm/trunk/test/Object/nm-shared-object.test
@@ -29,3 +29,5 @@
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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D29482.86976.patch
Type: text/x-patch
Size: 965 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170203/5907ac5f/attachment.bin>
More information about the llvm-commits
mailing list