summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2018-03-21 21:31:25 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2018-03-21 21:31:25 +0000
commitc51dc906eacd1fea184839bf5a05acff4046e352 (patch)
tree8cef6ce1b2d930669da074f0e1ed316bcac6d2c0 /llvm/lib
parent8a5943f5691920cd1c2dfde975dc1951f7d8e5b4 (diff)
downloadbcm5719-llvm-c51dc906eacd1fea184839bf5a05acff4046e352.tar.gz
bcm5719-llvm-c51dc906eacd1fea184839bf5a05acff4046e352.zip
Handle abbr_offset with relocations.
This is mostly just plumbing to get a DWARFDataExtractor where we compute abbr_offset so we can use getRelocatedValue. This is part of PR36793. llvm-svn: 328154
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/DebugInfo/DWARF/DWARFTypeUnit.cpp2
-rw-r--r--llvm/lib/DebugInfo/DWARF/DWARFUnit.cpp12
2 files changed, 8 insertions, 6 deletions
diff --git a/llvm/lib/DebugInfo/DWARF/DWARFTypeUnit.cpp b/llvm/lib/DebugInfo/DWARF/DWARFTypeUnit.cpp
index 206c12fa403..a0c5c193f6b 100644
--- a/llvm/lib/DebugInfo/DWARF/DWARFTypeUnit.cpp
+++ b/llvm/lib/DebugInfo/DWARF/DWARFTypeUnit.cpp
@@ -18,7 +18,7 @@
using namespace llvm;
-bool DWARFTypeUnit::extractImpl(DataExtractor debug_info,
+bool DWARFTypeUnit::extractImpl(const DWARFDataExtractor &debug_info,
uint32_t *offset_ptr) {
if (!DWARFUnit::extractImpl(debug_info, offset_ptr))
return false;
diff --git a/llvm/lib/DebugInfo/DWARF/DWARFUnit.cpp b/llvm/lib/DebugInfo/DWARF/DWARFUnit.cpp
index f85c0946f8d..c1b82465935 100644
--- a/llvm/lib/DebugInfo/DWARF/DWARFUnit.cpp
+++ b/llvm/lib/DebugInfo/DWARF/DWARFUnit.cpp
@@ -31,7 +31,7 @@ using namespace dwarf;
void DWARFUnitSectionBase::parse(DWARFContext &C, const DWARFSection &Section) {
const DWARFObject &D = C.getDWARFObj();
- parseImpl(C, Section, C.getDebugAbbrev(), &D.getRangeSection(),
+ parseImpl(C, D, Section, C.getDebugAbbrev(), &D.getRangeSection(),
D.getStringSection(), D.getStringOffsetSection(),
&D.getAddrSection(), D.getLineSection(), D.isLittleEndian(), false,
false);
@@ -40,7 +40,7 @@ void DWARFUnitSectionBase::parse(DWARFContext &C, const DWARFSection &Section) {
void DWARFUnitSectionBase::parseDWO(DWARFContext &C,
const DWARFSection &DWOSection, bool Lazy) {
const DWARFObject &D = C.getDWARFObj();
- parseImpl(C, DWOSection, C.getDebugAbbrevDWO(), &D.getRangeDWOSection(),
+ parseImpl(C, D, DWOSection, C.getDebugAbbrevDWO(), &D.getRangeDWOSection(),
D.getStringDWOSection(), D.getStringOffsetDWOSection(),
&D.getAddrSection(), D.getLineDWOSection(), C.isLittleEndian(),
true, Lazy);
@@ -91,7 +91,8 @@ bool DWARFUnit::getStringOffsetSectionItem(uint32_t Index,
return true;
}
-bool DWARFUnit::extractImpl(DataExtractor debug_info, uint32_t *offset_ptr) {
+bool DWARFUnit::extractImpl(const DWARFDataExtractor &debug_info,
+ uint32_t *offset_ptr) {
Length = debug_info.getU32(offset_ptr);
// FIXME: Support DWARF64.
FormParams.Format = DWARF32;
@@ -101,7 +102,7 @@ bool DWARFUnit::extractImpl(DataExtractor debug_info, uint32_t *offset_ptr) {
FormParams.AddrSize = debug_info.getU8(offset_ptr);
AbbrOffset = debug_info.getU32(offset_ptr);
} else {
- AbbrOffset = debug_info.getU32(offset_ptr);
+ AbbrOffset = debug_info.getRelocatedValue(4, offset_ptr);
FormParams.AddrSize = debug_info.getU8(offset_ptr);
}
if (IndexEntry) {
@@ -128,7 +129,8 @@ bool DWARFUnit::extractImpl(DataExtractor debug_info, uint32_t *offset_ptr) {
return true;
}
-bool DWARFUnit::extract(DataExtractor debug_info, uint32_t *offset_ptr) {
+bool DWARFUnit::extract(const DWARFDataExtractor &debug_info,
+ uint32_t *offset_ptr) {
clear();
Offset = *offset_ptr;
OpenPOWER on IntegriCloud