aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/DebugInfo/DWARFFormValue.cpp
diff options
context:
space:
mode:
authorEric Christopher <echristo@gmail.com>2013-04-07 03:43:09 +0000
committerEric Christopher <echristo@gmail.com>2013-04-07 03:43:09 +0000
commit55863befd157512db0c3b0ac857975a2f7e0af64 (patch)
tree7df29779d6809356514fa20b47b7993d9693af16 /llvm/lib/DebugInfo/DWARFFormValue.cpp
parentc1c01d5313c123e9955888952b9c3fbb7c7fa1ac (diff)
downloadllvm-55863befd157512db0c3b0ac857975a2f7e0af64.zip
llvm-55863befd157512db0c3b0ac857975a2f7e0af64.tar.gz
llvm-55863befd157512db0c3b0ac857975a2f7e0af64.tar.bz2
DW_FORM_sec_offset should be a relocation on platforms that use
a relocation across sections. Do this for DW_AT_stmt list in the skeleton CU and check the relocations in the debug_info section. Add a FIXME for multiple CUs. llvm-svn: 178969
Diffstat (limited to 'llvm/lib/DebugInfo/DWARFFormValue.cpp')
-rw-r--r--llvm/lib/DebugInfo/DWARFFormValue.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/llvm/lib/DebugInfo/DWARFFormValue.cpp b/llvm/lib/DebugInfo/DWARFFormValue.cpp
index 9f807aa..d29af35 100644
--- a/llvm/lib/DebugInfo/DWARFFormValue.cpp
+++ b/llvm/lib/DebugInfo/DWARFFormValue.cpp
@@ -172,10 +172,17 @@ DWARFFormValue::extractValue(DataExtractor data, uint32_t *offset_ptr,
Form = data.getULEB128(offset_ptr);
indirect = true;
break;
- case DW_FORM_sec_offset:
+ case DW_FORM_sec_offset: {
// FIXME: This is 64-bit for DWARF64.
- Value.uval = data.getU32(offset_ptr);
+ RelocAddrMap::const_iterator AI
+ = cu->getRelocMap()->find(*offset_ptr);
+ if (AI != cu->getRelocMap()->end()) {
+ const std::pair<uint8_t, int64_t> &R = AI->second;
+ Value.uval = data.getU32(offset_ptr) + R.second;
+ } else
+ Value.uval = data.getU32(offset_ptr);
break;
+ }
case DW_FORM_flag_present:
Value.uval = 1;
break;