summaryrefslogtreecommitdiff
path: root/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
commit9a9e73b47d139ecb6bfc3c934352ab7c7ee9af44 (patch)
treeeafe60a74a31567b9169b095c09ab82061466103 /lib/DebugInfo/DWARFFormValue.cpp
parent16f19693282b41bb6b0a627e417684add6f26de4 (diff)
downloadllvm-9a9e73b47d139ecb6bfc3c934352ab7c7ee9af44.tar.gz
llvm-9a9e73b47d139ecb6bfc3c934352ab7c7ee9af44.tar.bz2
llvm-9a9e73b47d139ecb6bfc3c934352ab7c7ee9af44.tar.xz
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@178969 91177308-0d34-0410-b5e6-96231b3b80d8
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 9f807aac5f..d29af3595f 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;