summaryrefslogtreecommitdiffstats
path: root/contrib/llvm/lib/DebugInfo/DWARF/DWARFDataExtractor.cpp
blob: 001097e56c716ac8d4fb0a3fad731934c8c7d83f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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