aboutsummaryrefslogtreecommitdiff
path: root/llvm/tools/llvm-objdump/llvm-objdump.cpp
diff options
context:
space:
mode:
authorFangrui Song <maskray@google.com>2019-05-23 16:01:59 +0000
committerFangrui Song <maskray@google.com>2019-05-23 16:01:59 +0000
commit6aebd8394a2bb9e514d0eaf8c8124b79974a2ba8 (patch)
tree6b12cede537fe3b7b366712e14d69de3e2ce5c21 /llvm/tools/llvm-objdump/llvm-objdump.cpp
parent8cffa848509f3a16a863a31ce51e226fcf79875e (diff)
downloadllvm-6aebd8394a2bb9e514d0eaf8c8124b79974a2ba8.zip
llvm-6aebd8394a2bb9e514d0eaf8c8124b79974a2ba8.tar.gz
llvm-6aebd8394a2bb9e514d0eaf8c8124b79974a2ba8.tar.bz2
[Object] object::ELFObjectFile::symbol_begin(): skip symbol index 0
For clients iterating the symbol table, none expects to handle index 0 (STN_UNDEF). Skip it to improve consistency with other binary formats. Clients that need STN_UNDEF (e.g. lld) can use getSectionContentsAsArray(). A test will be added in D62148. Reviewed By: mtrent Differential Revision: https://reviews.llvm.org/D62296 llvm-svn: 361506
Diffstat (limited to 'llvm/tools/llvm-objdump/llvm-objdump.cpp')
-rw-r--r--llvm/tools/llvm-objdump/llvm-objdump.cpp5
1 files changed, 0 insertions, 5 deletions
diff --git a/llvm/tools/llvm-objdump/llvm-objdump.cpp b/llvm/tools/llvm-objdump/llvm-objdump.cpp
index 318e0ad..1312ea8 100644
--- a/llvm/tools/llvm-objdump/llvm-objdump.cpp
+++ b/llvm/tools/llvm-objdump/llvm-objdump.cpp
@@ -1643,11 +1643,6 @@ void printSymbolTable(const ObjectFile *O, StringRef ArchiveName,
const StringRef FileName = O->getFileName();
for (auto I = O->symbol_begin(), E = O->symbol_end(); I != E; ++I) {
- // Skip printing the special zero symbol when dumping an ELF file.
- // This makes the output consistent with the GNU objdump.
- if (I == O->symbol_begin() && isa<ELFObjectFileBase>(O))
- continue;
-
const SymbolRef &Symbol = *I;
uint64_t Address = unwrapOrError(Symbol.getAddress(), ArchiveName, FileName,
ArchitectureName);