|
LLVM 24.0.0git
|
This structure is used to keep data of the concrete section. More...
#include "DWARFLinker/Parallel/OutputSections.h"
Public Member Functions | |
| SectionDescriptor (DebugSectionKind SectionKind, LinkingGlobalData &GlobalData, dwarf::FormParams Format, llvm::endianness Endianess) | |
| void | clearAllSectionData () |
| Erase whole section content(data bits, list of patches). | |
| void | clearSectionContent () |
| Erase only section output data bits. | |
| template<typename T> | |
| void | notePatchWithOffsetUpdate (const T &Patch, OffsetsPtrVector &PatchesOffsetsList) |
| While creating patches, offsets to attributes may be partially unknown(because size of abbreviation number is unknown). | |
| void | setSizesForSectionCreatedByAsmPrinter () |
| Some sections are emitted using AsmPrinter. | |
| StringRef | getContents () override |
| Returns section content. | |
| void | emitUnitLength (uint64_t Length) |
| Emit unit length into the current section contents. | |
| void | maybeEmitDwarf64Mark () |
| Emit DWARF64 mark into the current section contents. | |
| void | emitOffset (uint64_t Val) |
| Emit specified offset value into the current section contents. | |
| void | emitIntVal (uint64_t Val, unsigned Size) |
| Emit specified integer value into the current section contents. | |
| void | emitString (dwarf::Form StringForm, const char *StringVal) |
| void | emitBinaryData (llvm::StringRef Data) |
| void | emitInplaceString (StringRef String) |
| Emit specified inplace string value into the current section contents. | |
| void | emitStringPlaceholder () |
| Emit string placeholder into the current section contents. | |
| void | apply (uint64_t PatchOffset, dwarf::Form AttrForm, uint64_t Val) |
Write specified Value of AttrForm to the PatchOffset. | |
| uint64_t | getIntVal (uint64_t PatchOffset, unsigned Size) |
Returns integer value of Size located by specified PatchOffset. | |
| Public Member Functions inherited from llvm::dwarf_linker::parallel::SectionDescriptorBase | |
| SectionDescriptorBase (DebugSectionKind SectionKind, dwarf::FormParams Format, llvm::endianness Endianess) | |
| virtual | ~SectionDescriptorBase ()=default |
| DebugSectionKind | getKind () |
| Returns section kind. | |
| const StringLiteral & | getName () const |
| Returns section name. | |
| llvm::endianness | getEndianess () const |
| Returns endianess used by section. | |
| dwarf::FormParams | getFormParams () const |
| Returns FormParams used by section. | |
Public Attributes | |
| friend | OutputSections |
| uint64_t | StartOffset = 0 |
| When objects(f.e. | |
| raw_svector_ostream | OS |
| Stream which stores data to the Contents. | |
Protected Member Functions | |
| void | applyIntVal (uint64_t PatchOffset, uint64_t Val, unsigned Size) |
Writes integer value Val of Size by specified PatchOffset. | |
| void | applyULEB128 (uint64_t PatchOffset, uint64_t Val) |
Writes integer value Val of ULEB128 format by specified PatchOffset. | |
| void | applySLEB128 (uint64_t PatchOffset, uint64_t Val) |
Writes integer value Val of SLEB128 format by specified PatchOffset. | |
| void | setOutputFormat (dwarf::FormParams Format, llvm::endianness Endianess) |
| Sets output format. | |
Protected Attributes | |
| OutSectionDataTy | Contents |
| Section data bits. | |
| LinkingGlobalData & | GlobalData |
| size_t | SectionOffsetInsideAsmPrinterOutputStart = 0 |
| Some sections are generated using AsmPrinter. | |
| size_t | SectionOffsetInsideAsmPrinterOutputEnd = 0 |
| Protected Attributes inherited from llvm::dwarf_linker::parallel::SectionDescriptorBase | |
| DebugSectionKind | SectionKind = DebugSectionKind::NumberOfEnumEntries |
| The section kind. | |
| dwarf::FormParams | Format = {4, 4, dwarf::DWARF32} |
| Output format. | |
| llvm::endianness | Endianess = llvm::endianness::little |
This structure is used to keep data of the concrete section.
Like data bits, list of patches, format.
Definition at line 166 of file OutputSections.h.
|
inline |
Definition at line 169 of file OutputSections.h.
References Contents, llvm::dwarf_linker::parallel::SectionDescriptorBase::Endianess, llvm::dwarf_linker::parallel::SectionDescriptorBase::Format, GlobalData, OS, llvm::dwarf_linker::parallel::SectionDescriptorBase::SectionDescriptorBase(), and llvm::dwarf_linker::parallel::SectionDescriptorBase::SectionKind.
| void SectionDescriptor::apply | ( | uint64_t | PatchOffset, |
| dwarf::Form | AttrForm, | ||
| uint64_t | Val ) |
Write specified Value of AttrForm to the PatchOffset.
Definition at line 172 of file OutputSections.cpp.
References applyIntVal(), applySLEB128(), applyULEB128(), llvm::dwarf_linker::parallel::SectionDescriptorBase::Format, and llvm_unreachable.
Referenced by llvm::dwarf_linker::parallel::DwarfUnit::emitDebugStringOffsetSection(), and llvm::dwarf_linker::parallel::DwarfUnit::emitPubAccelerators().
Writes integer value Val of Size by specified PatchOffset.
Definition at line 251 of file OutputSections.cpp.
References assert(), data, llvm::dwarf_linker::parallel::SectionDescriptorBase::Endianess, getContents(), llvm_unreachable, Size, llvm::size(), and llvm::support::endian::write().
Referenced by apply().
Writes integer value Val of SLEB128 format by specified PatchOffset.
Definition at line 293 of file OutputSections.cpp.
References assert(), data, llvm::encodeSLEB128(), llvm::dwarf_linker::parallel::SectionDescriptorBase::Format, getContents(), and llvm::size().
Referenced by apply().
Writes integer value Val of ULEB128 format by specified PatchOffset.
Definition at line 281 of file OutputSections.cpp.
References assert(), data, llvm::encodeULEB128(), llvm::dwarf_linker::parallel::SectionDescriptorBase::Format, getContents(), and llvm::size().
Referenced by apply().
| void SectionDescriptor::clearAllSectionData | ( | ) |
Erase whole section content(data bits, list of patches).
Definition at line 59 of file OutputSections.cpp.
References clearSectionContent(), and StartOffset.
| void SectionDescriptor::clearSectionContent | ( | ) |
Erase only section output data bits.
Definition at line 77 of file OutputSections.cpp.
References Contents.
Referenced by clearAllSectionData().
| void SectionDescriptor::emitBinaryData | ( | llvm::StringRef | Data | ) |
Definition at line 168 of file OutputSections.cpp.
References llvm::Data, and OS.
|
inline |
Emit specified inplace string value into the current section contents.
Definition at line 276 of file OutputSections.h.
References emitIntVal(), OS, and llvm::String.
Referenced by llvm::dwarf_linker::parallel::DwarfUnit::emitPubAcceleratorEntry(), and emitString().
Emit specified integer value into the current section contents.
Definition at line 141 of file OutputSections.cpp.
References llvm::dwarf_linker::parallel::SectionDescriptorBase::Endianess, llvm_unreachable, llvm::native, OS, Size, and llvm::sys::swapByteOrder().
Referenced by llvm::dwarf_linker::parallel::DwarfUnit::emitDebugStringOffsetSection(), emitInplaceString(), emitOffset(), llvm::dwarf_linker::parallel::DwarfUnit::emitPubAcceleratorEntry(), llvm::dwarf_linker::parallel::DwarfUnit::emitPubAccelerators(), emitUnitLength(), and maybeEmitDwarf64Mark().
|
inline |
Emit specified offset value into the current section contents.
Definition at line 264 of file OutputSections.h.
References emitIntVal(), llvm::dwarf_linker::parallel::SectionDescriptorBase::getFormParams(), and uint64_t.
Referenced by llvm::dwarf_linker::parallel::DwarfUnit::emitDebugStringOffsetSection(), llvm::dwarf_linker::parallel::DwarfUnit::emitPubAcceleratorEntry(), and emitStringPlaceholder().
| void SectionDescriptor::emitString | ( | dwarf::Form | StringForm, |
| const char * | StringVal ) |
Definition at line 117 of file OutputSections.cpp.
References assert(), emitInplaceString(), emitStringPlaceholder(), GlobalData, llvm_unreachable, and OS.
|
inline |
Emit string placeholder into the current section contents.
Definition at line 282 of file OutputSections.h.
References emitOffset().
Referenced by emitString().
|
inline |
Emit unit length into the current section contents.
Definition at line 251 of file OutputSections.h.
References emitIntVal(), llvm::dwarf_linker::parallel::SectionDescriptorBase::getFormParams(), llvm::Length, maybeEmitDwarf64Mark(), and uint64_t.
Referenced by llvm::dwarf_linker::parallel::DwarfUnit::emitDebugStringOffsetSection().
|
inlineoverridevirtual |
Returns section content.
Implements llvm::dwarf_linker::parallel::SectionDescriptorBase.
Definition at line 242 of file OutputSections.h.
References Contents, SectionOffsetInsideAsmPrinterOutputEnd, and SectionOffsetInsideAsmPrinterOutputStart.
Referenced by applyIntVal(), applySLEB128(), applyULEB128(), and getIntVal().
Returns integer value of Size located by specified PatchOffset.
Definition at line 227 of file OutputSections.cpp.
References assert(), data, llvm::StringRef::data(), llvm::dwarf_linker::parallel::SectionDescriptorBase::Endianess, getContents(), llvm_unreachable, llvm::support::endian::read16(), llvm::support::endian::read32(), llvm::support::endian::read64(), Size, and llvm::size().
|
inline |
Emit DWARF64 mark into the current section contents.
Definition at line 257 of file OutputSections.h.
References llvm::dwarf::DW_LENGTH_DWARF64, llvm::dwarf::DWARF64, emitIntVal(), llvm::dwarf_linker::parallel::SectionDescriptorBase::Format, and llvm::dwarf_linker::parallel::SectionDescriptorBase::getFormParams().
Referenced by emitUnitLength().
|
inline |
While creating patches, offsets to attributes may be partially unknown(because size of abbreviation number is unknown).
In such case we remember patch itself and pointer to patch application offset to add size of abbreviation number later.
Definition at line 231 of file OutputSections.h.
References llvm::SmallVectorImpl< T >::emplace_back(), and T.
Referenced by llvm::dwarf_linker::parallel::TypeUnit::createDIETree().
|
inlineprotected |
Sets output format.
Definition at line 304 of file OutputSections.h.
References llvm::dwarf_linker::parallel::SectionDescriptorBase::Endianess, and llvm::dwarf_linker::parallel::SectionDescriptorBase::Format.
| void SectionDescriptor::setSizesForSectionCreatedByAsmPrinter | ( | ) |
Some sections are emitted using AsmPrinter.
In that case "Contents" member of SectionDescriptor contains elf file. This method searches for section data inside elf file and remember offset to it.
Definition at line 79 of file OutputSections.cpp.
References llvm::consumeError(), Contents, llvm::object::ObjectFile::createObjectFile(), llvm::Data, llvm::dwarf_linker::parseDebugTableName(), llvm::dwarf_linker::parallel::SectionDescriptorBase::SectionKind, SectionOffsetInsideAsmPrinterOutputEnd, SectionOffsetInsideAsmPrinterOutputStart, and llvm::Expected< T >::takeError().
Referenced by llvm::dwarf_linker::parallel::DWARFLinkerImpl::emitAppleAcceleratorSections(), llvm::dwarf_linker::parallel::DwarfUnit::emitDebugInfo(), and llvm::dwarf_linker::parallel::DWARFLinkerImpl::emitDWARFv5DebugNamesSection().
|
protected |
Section data bits.
Definition at line 201 of file OutputSections.h.
Referenced by clearSectionContent(), getContents(), SectionDescriptor(), and setSizesForSectionCreatedByAsmPrinter().
|
protected |
Definition at line 309 of file OutputSections.h.
Referenced by emitString(), and SectionDescriptor().
| raw_svector_ostream llvm::dwarf_linker::parallel::SectionDescriptor::OS |
Stream which stores data to the Contents.
Definition at line 205 of file OutputSections.h.
Referenced by llvm::dwarf_linker::parallel::DwarfUnit::emitAbbreviations(), llvm::dwarf_linker::parallel::DWARFLinkerImpl::emitAppleAcceleratorSections(), emitBinaryData(), llvm::dwarf_linker::parallel::DWARFLinkerImpl::LinkContext::emitDebugFrame(), llvm::dwarf_linker::parallel::DwarfUnit::emitDebugInfo(), llvm::dwarf_linker::parallel::DwarfUnit::emitDebugStringOffsetSection(), llvm::dwarf_linker::parallel::DwarfUnit::emitDwarfAbbrevEntry(), llvm::dwarf_linker::parallel::DWARFLinkerImpl::emitDWARFv5DebugNamesSection(), emitInplaceString(), emitIntVal(), llvm::dwarf_linker::parallel::DwarfUnit::emitPubAcceleratorEntry(), llvm::dwarf_linker::parallel::DwarfUnit::emitPubAccelerators(), emitString(), and SectionDescriptor().
| friend llvm::dwarf_linker::parallel::SectionDescriptor::OutputSections |
Definition at line 167 of file OutputSections.h.
|
protected |
Definition at line 315 of file OutputSections.h.
Referenced by getContents(), and setSizesForSectionCreatedByAsmPrinter().
|
protected |
Some sections are generated using AsmPrinter.
The real section data located inside elf file in that case. Following fields points to the real section content inside elf file.
Definition at line 314 of file OutputSections.h.
Referenced by getContents(), and setSizesForSectionCreatedByAsmPrinter().
| uint64_t llvm::dwarf_linker::parallel::SectionDescriptor::StartOffset = 0 |
When objects(f.e.
compile units) are glued into the single file, the debug sections corresponding to the concrete object are assigned with offsets inside the whole file. This field keeps offset to the debug section, corresponding to this object.
Definition at line 197 of file OutputSections.h.
Referenced by llvm::dwarf_linker::parallel::OutputSections::applyPatches(), and clearAllSectionData().