mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-05 13:26:55 +00:00
Object/COFF: Fix off-by-one error for object having lots of relocations
llvm-objdump printed out an error message for this off-by-one error, but because it always exits with 0 whether or not it found an error, the test (llvm-objdump/coff-many-relocs.test) succeeded. I made llvm-objdump exit with EXIT_FAILURE when an error is found. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222852 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -414,7 +414,8 @@ static uint32_t getNumberOfRelocations(const coff_section *Sec,
|
||||
if (getObject(FirstReloc, M, reinterpret_cast<const coff_relocation*>(
|
||||
base + Sec->PointerToRelocations)))
|
||||
return 0;
|
||||
return FirstReloc->VirtualAddress;
|
||||
// -1 to exclude this first relocation entry.
|
||||
return FirstReloc->VirtualAddress - 1;
|
||||
}
|
||||
return Sec->NumberOfRelocations;
|
||||
}
|
||||
|
Reference in New Issue
Block a user