summaryrefslogtreecommitdiffstats
path: root/llvm/lib/DebugInfo
diff options
context:
space:
mode:
authorEric Christopher <echristo@gmail.com>2012-12-27 01:07:07 +0000
committerEric Christopher <echristo@gmail.com>2012-12-27 01:07:07 +0000
commit5a6acfa4c848a67bb60cffa52504c3e35f0a280e (patch)
tree013ad08558fcf4f5e64def53a92751ac64958f40 /llvm/lib/DebugInfo
parentb3cb257b8b0e9d85bd3315e635c51b0bbde6117e (diff)
downloadbcm5719-llvm-5a6acfa4c848a67bb60cffa52504c3e35f0a280e.tar.gz
bcm5719-llvm-5a6acfa4c848a67bb60cffa52504c3e35f0a280e.zip
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. llvm-svn: 171126
Diffstat (limited to 'llvm/lib/DebugInfo')
-rw-r--r--llvm/lib/DebugInfo/DWARFFormValue.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/llvm/lib/DebugInfo/DWARFFormValue.cpp b/llvm/lib/DebugInfo/DWARFFormValue.cpp
index 1d8ea011100..efc2d966130 100644
--- a/llvm/lib/DebugInfo/DWARFFormValue.cpp
+++ b/llvm/lib/DebugInfo/DWARFFormValue.cpp
@@ -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;
OpenPOWER on IntegriCloud