summaryrefslogtreecommitdiff
path: root/lib/DebugInfo/DWARF/DWARFDataExtractor.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2017-07-01 13:22:02 +0000
committerDimitry Andric <dim@FreeBSD.org>2017-07-01 13:22:02 +0000
commit9df3605dea17e84f8183581f6103bd0c79e2a606 (patch)
tree70a2f36ce9eb9bb213603cd7f2f120af53fc176f /lib/DebugInfo/DWARF/DWARFDataExtractor.cpp
parent08bbd35a80bf7765fe0d3043f9eb5a2f2786b649 (diff)
Diffstat (limited to 'lib/DebugInfo/DWARF/DWARFDataExtractor.cpp')
-rw-r--r--lib/DebugInfo/DWARF/DWARFDataExtractor.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/lib/DebugInfo/DWARF/DWARFDataExtractor.cpp b/lib/DebugInfo/DWARF/DWARFDataExtractor.cpp
new file mode 100644
index 0000000000000..001097e56c716
--- /dev/null
+++ b/lib/DebugInfo/DWARF/DWARFDataExtractor.cpp
@@ -0,0 +1,24 @@
+//===- DWARFDataExtractor.cpp ---------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#include "llvm/DebugInfo/DWARF/DWARFDataExtractor.h"
+
+using namespace llvm;
+
+uint64_t DWARFDataExtractor::getRelocatedValue(uint32_t Size, uint32_t *Off,
+ uint64_t *SecNdx) const {
+ if (!RelocMap)
+ return getUnsigned(Off, Size);
+ RelocAddrMap::const_iterator AI = RelocMap->find(*Off);
+ if (AI == RelocMap->end())
+ return getUnsigned(Off, Size);
+ if (SecNdx)
+ *SecNdx = AI->second.SectionIndex;
+ return getUnsigned(Off, Size) + AI->second.Value;
+}