blob: a8f5b2840c648cbe2ad5091298ba50582c109309 [file] [log] [blame]
Andrew Scull5e1ddfa2018-08-14 10:06:54 +01001//===- DWARFRelocMap.h ------------------------------------------*- C++ -*-===//
2//
Andrew Walbran16937d02019-10-22 13:54:20 +01003// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
Andrew Scull5e1ddfa2018-08-14 10:06:54 +01006//
7//===----------------------------------------------------------------------===//
8
9#ifndef LLVM_DEBUGINFO_DWARF_DWARFRELOCMAP_H
10#define LLVM_DEBUGINFO_DWARF_DWARFRELOCMAP_H
11
12#include "llvm/ADT/DenseMap.h"
13#include <cstdint>
14
15namespace llvm {
16
17/// RelocAddrEntry contains relocated value and section index.
18/// Section index is -1LL if relocation points to absolute symbol.
19struct RelocAddrEntry {
20 uint64_t SectionIndex;
21 uint64_t Value;
22};
23
24/// In place of applying the relocations to the data we've read from disk we use
25/// a separate mapping table to the side and checking that at locations in the
26/// dwarf where we expect relocated values. This adds a bit of complexity to the
27/// dwarf parsing/extraction at the benefit of not allocating memory for the
28/// entire size of the debug info sections.
29using RelocAddrMap = DenseMap<uint64_t, RelocAddrEntry>;
30
31} // end namespace llvm
32
33#endif // LLVM_DEBUGINFO_DWARF_DWARFRELOCMAP_H