llvm-readobj: fix off-by-one error in COFFDumper

It printed out base relocation table header as table entry.
This patch also makes llvm-readobj to not skip ABSOLUTE entries
becuase it was confusing.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222299 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Rui Ueyama
2014-11-19 02:07:10 +00:00
parent 28b45aa83e
commit 3977e2f696
3 changed files with 23 additions and 22 deletions

View File

@ -1491,7 +1491,7 @@ void BaseRelocRef::moveNext() {
// Header->BlockSize is the size of the current block, including the
// size of the header itself.
uint32_t Size = sizeof(*Header) +
sizeof(coff_base_reloc_block_entry) * Index;
sizeof(coff_base_reloc_block_entry) * (Index + 1);
if (Size == Header->BlockSize) {
// .reloc contains a list of base relocation blocks. Each block
// consists of the header followed by entries. The header contains