summaryrefslogtreecommitdiffstats
path: root/contrib/llvm/lib/DebugInfo/DWARF/DWARFDataExtractor.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/llvm/lib/DebugInfo/DWARF/DWARFDataExtractor.cpp')
-rw-r--r--contrib/llvm/lib/DebugInfo/DWARF/DWARFDataExtractor.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/contrib/llvm/lib/DebugInfo/DWARF/DWARFDataExtractor.cpp b/contrib/llvm/lib/DebugInfo/DWARF/DWARFDataExtractor.cpp
new file mode 100644
index 0000000..001097e
--- /dev/null
+++ b/contrib/llvm/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;
+}
OpenPOWER on IntegriCloud