1321369Sdim//===- DWARFRelocMap.h ------------------------------------------*- C++ -*-===// 2283625Sdim// 3353358Sdim// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4353358Sdim// See https://llvm.org/LICENSE.txt for license information. 5353358Sdim// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6283625Sdim// 7283625Sdim//===----------------------------------------------------------------------===// 8283625Sdim 9321369Sdim#ifndef LLVM_DEBUGINFO_DWARF_DWARFRELOCMAP_H 10321369Sdim#define LLVM_DEBUGINFO_DWARF_DWARFRELOCMAP_H 11283625Sdim 12283625Sdim#include "llvm/ADT/DenseMap.h" 13353358Sdim#include "llvm/Object/RelocationResolver.h" 14321369Sdim#include <cstdint> 15283625Sdim 16283625Sdimnamespace llvm { 17283625Sdim 18321369Sdim/// RelocAddrEntry contains relocated value and section index. 19321369Sdim/// Section index is -1LL if relocation points to absolute symbol. 20321369Sdimstruct RelocAddrEntry { 21321369Sdim uint64_t SectionIndex; 22353358Sdim object::RelocationRef Reloc; 23353358Sdim uint64_t SymbolValue; 24353358Sdim Optional<object::RelocationRef> Reloc2; 25353358Sdim uint64_t SymbolValue2; 26353358Sdim object::RelocationResolver Resolver; 27321369Sdim}; 28283625Sdim 29321369Sdim/// In place of applying the relocations to the data we've read from disk we use 30321369Sdim/// a separate mapping table to the side and checking that at locations in the 31321369Sdim/// dwarf where we expect relocated values. This adds a bit of complexity to the 32321369Sdim/// dwarf parsing/extraction at the benefit of not allocating memory for the 33321369Sdim/// entire size of the debug info sections. 34321369Sdimusing RelocAddrMap = DenseMap<uint64_t, RelocAddrEntry>; 35283625Sdim 36321369Sdim} // end namespace llvm 37283625Sdim 38321369Sdim#endif // LLVM_DEBUGINFO_DWARF_DWARFRELOCMAP_H 39