Right now all of the relocations are 32-bit dwarf, and the relocation

information doesn't return an addend for Rel relocations. Go ahead
and use this information to fix relocation handling inside dwarfdump
for 32-bit ELF REL.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171126 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Eric Christopher
2012-12-27 01:07:07 +00:00
parent 5dd839430c
commit 32b3768ec1
3 changed files with 41 additions and 7 deletions

View File

@@ -108,8 +108,8 @@ DWARFFormValue::extractValue(DataExtractor data, uint32_t *offset_ptr,
= cu->getContext().relocMap().find(*offset_ptr);
if (AI != cu->getContext().relocMap().end()) {
const std::pair<uint8_t, int64_t> &R = AI->second;
Value.uval = R.second;
*offset_ptr += R.first;
Value.uval = data.getUnsigned(offset_ptr, cu->getAddressByteSize()) +
R.second;
} else
Value.uval = data.getUnsigned(offset_ptr, cu->getAddressByteSize());
break;
@@ -156,8 +156,7 @@ DWARFFormValue::extractValue(DataExtractor data, uint32_t *offset_ptr,
= cu->getContext().relocMap().find(*offset_ptr);
if (AI != cu->getContext().relocMap().end()) {
const std::pair<uint8_t, int64_t> &R = AI->second;
Value.uval = R.second;
*offset_ptr += R.first;
Value.uval = data.getU32(offset_ptr) + R.second;
} else
Value.uval = data.getU32(offset_ptr);
break;