diff options
author | Pavel Labath <pavel@labath.sk> | 2018-12-18 15:56:45 +0000 |
---|---|---|
committer | Pavel Labath <pavel@labath.sk> | 2018-12-18 15:56:45 +0000 |
commit | 0d38e4fd2c0ed5d9a579cf40e2ab8634f9a779f6 (patch) | |
tree | efead9d3e1fffceb7e917e53f5b1ec1f8a3babe1 /lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.h | |
parent | 94d2d09c7626dd6642d322da0bb2faf629447a62 (diff) | |
download | llvm-0d38e4fd2c0ed5d9a579cf40e2ab8634f9a779f6.zip llvm-0d38e4fd2c0ed5d9a579cf40e2ab8634f9a779f6.tar.gz llvm-0d38e4fd2c0ed5d9a579cf40e2ab8634f9a779f6.tar.bz2 |
ELF: Don't create sections for section header index 0
Summary:
The first section header does not define a real section. Instead it is
used for various elf extensions. This patch skips creation of a section
for index 0.
This has one furtunate side-effect, in that it allows us to use the section
header index as the Section ID (where 0 is also invalid). This way, we
can get rid of a lot of spurious +1s in the ObjectFileELF code.
Reviewers: clayborg, krytarowski, joerg, espindola
Subscribers: emaste, lldb-commits, arichardson
Differential Revision: https://reviews.llvm.org/D55757
llvm-svn: 349498
Diffstat (limited to 'lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.h')
-rw-r--r-- | lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.h b/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.h index 0ad4f42..2e6478a 100644 --- a/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.h +++ b/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.h @@ -220,10 +220,10 @@ private: /// The address class for each symbol in the elf file FileAddressToAddressClassMap m_address_class_map; - /// Returns a 1 based index of the given section header. + /// Returns the index of the given section header. size_t SectionIndex(const SectionHeaderCollIter &I); - /// Returns a 1 based index of the given section header. + /// Returns the index of the given section header. size_t SectionIndex(const SectionHeaderCollConstIter &I) const; // Parses the ELF program headers. |