blob: 001097e56c716ac8d4fb0a3fad731934c8c7d83f [file] [log] [blame]
Paul Robinson17536b92017-06-29 16:52:08 +00001//===- DWARFDataExtractor.cpp ---------------------------------------------===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9
10#include "llvm/DebugInfo/DWARF/DWARFDataExtractor.h"
11
12using namespace llvm;
13
14uint64_t DWARFDataExtractor::getRelocatedValue(uint32_t Size, uint32_t *Off,
15 uint64_t *SecNdx) const {
16 if (!RelocMap)
17 return getUnsigned(Off, Size);
18 RelocAddrMap::const_iterator AI = RelocMap->find(*Off);
19 if (AI == RelocMap->end())
20 return getUnsigned(Off, Size);
21 if (SecNdx)
22 *SecNdx = AI->second.SectionIndex;
23 return getUnsigned(Off, Size) + AI->second.Value;
24}