1 //===- DWARFRelocMap.h ------------------------------------------*- C++ -*-===// 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 #ifndef LLVM_DEBUGINFO_DWARF_DWARFRELOCMAP_H 11 #define LLVM_DEBUGINFO_DWARF_DWARFRELOCMAP_H 12 13 #include "llvm/ADT/DenseMap.h" 14 #include <cstdint> 15 #include <utility> 16 17 namespace llvm { 18 19 /// RelocAddrEntry contains relocated value and section index. 20 /// Section index is -1LL if relocation points to absolute symbol. 21 struct RelocAddrEntry { 22 uint64_t SectionIndex; 23 uint64_t Value; 24 }; 25 26 /// In place of applying the relocations to the data we've read from disk we use 27 /// a separate mapping table to the side and checking that at locations in the 28 /// dwarf where we expect relocated values. This adds a bit of complexity to the 29 /// dwarf parsing/extraction at the benefit of not allocating memory for the 30 /// entire size of the debug info sections. 31 typedef DenseMap<uint64_t, RelocAddrEntry> RelocAddrMap; 32 33 } // end namespace llvm 34 35 #endif // LLVM_DEBUGINFO_DWARF_DWARFRELOCMAP_H 36