//===- OutputSections.h -----------------------------------------*- C++ -*-===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// #ifndef LLVM_LIB_DWARFLINKER_PARALLEL_OUTPUTSECTIONS_H #define LLVM_LIB_DWARFLINKER_PARALLEL_OUTPUTSECTIONS_H #include "ArrayList.h" #include "StringEntryToDwarfStringPoolEntryMap.h" #include "llvm/ADT/SmallString.h" #include "llvm/ADT/StringRef.h" #include "llvm/BinaryFormat/Dwarf.h" #include "llvm/CodeGen/DwarfStringPoolEntry.h" #include "llvm/DWARFLinker/StringPool.h" #include "llvm/DebugInfo/DWARF/DWARFFormValue.h" #include "llvm/DebugInfo/DWARF/DWARFObject.h" #include "llvm/Object/ObjectFile.h" #include "llvm/Support/Endian.h" #include "llvm/Support/Error.h" #include "llvm/Support/FormatVariadic.h" #include "llvm/Support/LEB128.h" #include "llvm/Support/MemoryBufferRef.h" #include "llvm/Support/raw_ostream.h" #include <array> #include <cstdint> namespace llvm { namespace dwarf_linker { namespace parallel { class TypeUnit; /// There are fields(sizes, offsets) which should be updated after /// sections are generated. To remember offsets and related data /// the descendants of SectionPatch structure should be used. struct SectionPatch { … }; /// This structure is used to update strings offsets into .debug_str. struct DebugStrPatch : SectionPatch { … }; /// This structure is used to update strings offsets into .debug_line_str. struct DebugLineStrPatch : SectionPatch { … }; /// This structure is used to update range list offset into /// .debug_ranges/.debug_rnglists. struct DebugRangePatch : SectionPatch { … }; /// This structure is used to update location list offset into /// .debug_loc/.debug_loclists. struct DebugLocPatch : SectionPatch { … }; /// This structure is used to update offset with start of another section. struct SectionDescriptor; struct DebugOffsetPatch : SectionPatch { … }; /// This structure is used to update reference to the DIE. struct DebugDieRefPatch : SectionPatch { … }; /// This structure is used to update reference to the DIE of ULEB128 form. struct DebugULEB128DieRefPatch : SectionPatch { … }; /// This structure is used to update reference to the type DIE. struct DebugDieTypeRefPatch : SectionPatch { … }; /// This structure is used to update reference to the type DIE. struct DebugType2TypeDieRefPatch : SectionPatch { … }; struct DebugTypeStrPatch : SectionPatch { … }; struct DebugTypeLineStrPatch : SectionPatch { … }; struct DebugTypeDeclFilePatch { … }; /// Type for section data. OutSectionDataTy; /// Type for list of pointers to patches offsets. OffsetsPtrVector; class OutputSections; /// This structure is used to keep data of the concrete section. /// Like data bits, list of patches, format. struct SectionDescriptor : SectionDescriptorBase { … }; /// This class keeps contents and offsets to the debug sections. Any objects /// which is supposed to be emitted into the debug sections should use this /// class to track debug sections offsets and keep sections data. class OutputSections { … }; } // end of namespace parallel } // end of namespace dwarf_linker } // end of namespace llvm #endif // LLVM_LIB_DWARFLINKER_PARALLEL_OUTPUTSECTIONS_H