From 970dda295e708a54df1c9516c365a915ba68e96c Mon Sep 17 00:00:00 2001 From: Rui Ueyama Date: Wed, 19 Nov 2014 02:07:10 +0000 Subject: 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. llvm-svn: 222299 --- llvm/lib/Object/COFFObjectFile.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'llvm/lib/Object/COFFObjectFile.cpp') diff --git a/llvm/lib/Object/COFFObjectFile.cpp b/llvm/lib/Object/COFFObjectFile.cpp index c5d7c409519..d5ff7d6439c 100644 --- a/llvm/lib/Object/COFFObjectFile.cpp +++ b/llvm/lib/Object/COFFObjectFile.cpp @@ -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 -- cgit v1.2.3