blob: cd022e7882c59338901f203a319f2543a356c494 [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"
Andrew Walbran3d2c1972020-04-07 12:24:26 +010013#include "llvm/Object/RelocationResolver.h"
Andrew Scull5e1ddfa2018-08-14 10:06:54 +010014#include <cstdint>
15
16namespace llvm {
17
18/// RelocAddrEntry contains relocated value and section index.
19/// Section index is -1LL if relocation points to absolute symbol.
20struct RelocAddrEntry {
21 uint64_t SectionIndex;
Andrew Walbran3d2c1972020-04-07 12:24:26 +010022 object::RelocationRef Reloc;
23 object::RelocationResolver Resolver;
24 uint64_t SymbolValue;
Andrew Scull5e1ddfa2018-08-14 10:06:54 +010025};
26
27/// In place of applying the relocations to the data we've read from disk we use
28/// a separate mapping table to the side and checking that at locations in the
29/// dwarf where we expect relocated values. This adds a bit of complexity to the
30/// dwarf parsing/extraction at the benefit of not allocating memory for the
31/// entire size of the debug info sections.
32using RelocAddrMap = DenseMap<uint64_t, RelocAddrEntry>;
33
34} // end namespace llvm
35
36#endif // LLVM_DEBUGINFO_DWARF_DWARFRELOCMAP_H