aboutsummaryrefslogtreecommitdiffstats
path: root/lib/DebugInfo/DWARFFormValue.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/DebugInfo/DWARFFormValue.cpp')
-rw-r--r--lib/DebugInfo/DWARFFormValue.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/DebugInfo/DWARFFormValue.cpp b/lib/DebugInfo/DWARFFormValue.cpp
index 9f807aa..d29af35 100644
--- a/lib/DebugInfo/DWARFFormValue.cpp
+++ b/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;