diff options
author | Eric Christopher <echristo@gmail.com> | 2012-12-27 01:07:07 +0000 |
---|---|---|
committer | Eric Christopher <echristo@gmail.com> | 2012-12-27 01:07:07 +0000 |
commit | 32b3768ec1ae95cb05d1f595d31761c510c43251 (patch) | |
tree | 83fe4e23d856304392ba9b04ef62b642a228065c /lib/DebugInfo/DWARFFormValue.cpp | |
parent | 5dd839430c1dbce6cd35dc44f68718a1fc69bfba (diff) | |
download | llvm-32b3768ec1ae95cb05d1f595d31761c510c43251.tar.gz llvm-32b3768ec1ae95cb05d1f595d31761c510c43251.tar.bz2 llvm-32b3768ec1ae95cb05d1f595d31761c510c43251.tar.xz |
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
Diffstat (limited to 'lib/DebugInfo/DWARFFormValue.cpp')
-rw-r--r-- | lib/DebugInfo/DWARFFormValue.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/DebugInfo/DWARFFormValue.cpp b/lib/DebugInfo/DWARFFormValue.cpp index 1d8ea01110..efc2d96613 100644 --- a/lib/DebugInfo/DWARFFormValue.cpp +++ b/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; |