OSDN Git Service

[Object] object::ELFObjectFile::symbol_begin(): skip symbol index 0
authorFangrui Song <maskray@google.com>
Thu, 23 May 2019 16:01:59 +0000 (16:01 +0000)
committerFangrui Song <maskray@google.com>
Thu, 23 May 2019 16:01:59 +0000 (16:01 +0000)
commite48c7bddaea835f376635446d16cc7b4c356047c
tree1452d857ab3978035d542f028bca11bb897150b6
parentd36337c5f7c60a3d739c7bf1ea4b241a9fc2bafe
[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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@361506 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Object/ELFObjectFile.h
tools/llvm-objdump/llvm-objdump.cpp