1//===-- llvm/MC/MCObjectFileInfo.h - Object File Info -----------*- C++ -*-===// 3// 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 7//===----------------------------------------------------------------------===// 9// This file describes common object file formats. 11//===----------------------------------------------------------------------===// 13#ifndef LLVM_MC_MCOBJECTFILEINFO_H 14#define LLVM_MC_MCOBJECTFILEINFO_H 30 /// True if target object file supports a weak_definition of constant 0 for an 34 /// True if the target object file supports emitting a compact unwind section 35 /// without an associated EH frame section. 38 /// OmitDwarfIfHaveCompactUnwind - True if the target object file 39 /// supports having some functions with compact unwind and other with 43 /// FDE CFI encoding. Controls the encoding of the begin label in the 44 /// .eh_frame section. Unlike the LSDA encoding, personality encoding, and 45 /// type encodings, this is something that the assembler just "knows" about 49 /// Compact unwind encoding indicating that we should emit only an EH frame. 52 /// Section directive for standard text. 55 /// Section directive for standard data. 58 /// Section that is default initialized to zero. 61 /// Section that is readonly and can contain arbitrary initialized data. 62 /// Targets are not required to have a readonly section. If they don't, 63 /// various bits of code will fall back to using the data section for 67 /// If exception handling is supported by the target, this is the section the 68 /// Language Specific Data Area information is emitted to. 71 /// If exception handling is supported by the target and the target can 72 /// support a compact representation of the CIE and FDE, this is the section 73 /// to emit them into. 76 /// If import call optimization is supported by the target, this is the 77 /// section to emit import call data to. 80// Dwarf sections for debug info. If a target supports debug info, these must 95// The pubnames section is no longer generated by default. The generation 96// can be enabled by a compiler flag. 99 /// Accelerator table sections. DwarfDebugNamesSection is the DWARF v5 100 /// accelerator table, while DwarfAccelNamesSection, DwarfAccelObjCSection, 101 /// DwarfAccelNamespaceSection, DwarfAccelTypesSection are pre-DWARF v5 109// These are used for the Fission separate debug information files. 120 /// The DWARF v5 string offset and address table sections. 123 /// The DWARF v5 range list section. 125 /// The DWARF v5 locations list section. 128 /// The DWARF v5 range and location list sections for fission. 132// These are for Fission DWP files. 136 /// Section for newer gnu pubnames. 138 /// Section for newer gnu pubtypes. 141// Section for Swift AST 148 /// Extra TLS Variable Data section. 150 /// If the target needs to put additional information for a TLS variable, 154 /// Section directive for Thread Local data. ELF, MachO, COFF, and Wasm. 157 /// Section directive for Thread Local uninitialized data. 159 /// Null if this target doesn't support a BSS section. ELF and MachO only. 162 /// StackMap section. 165 /// FaultMap section. 171 /// EH frame section. 173 /// It is initialized on demand so it can be overwritten (with uniquing). 176 /// Section containing metadata on function stack sizes. 179 /// Section for pseudo probe information used by AutoFDO 183// Section for metadata of llvm statistics. 186// ELF specific sections. 193// MachO specific sections. 195 /// Section for thread local structure information. 197 /// Contains the source code name of the variable, visibility and a pointer to 198 /// the initial value (.tdata or .tbss). 201 /// Section for thread local data initialization functions. 202// Defaults to ".thread_init_func". 222 /// COFF specific sections. 232// GOFF specific sections. 239// XCOFF specific sections 244// Swift5 Reflection Data Sections 245 std::array<MCSection *, binaryformat::Swift5ReflectionSectionKind::last>
250bool LargeCodeModel =
false);
281return getDwarfComdatSection(
".debug_info", Hash);
321return getDwarfComdatSection(
".debug_types", Hash);
377// ELF specific sections. 392// MachO specific sections. 430// COFF specific sections. 440// GOFF specific sections. 447// XCOFF specific sections 454// Swift5 Reflection Data Sections 457return ReflSectionKind !=
464bool PositionIndependent =
false;
467void initMachOMCObjectFileInfo(
constTriple &
T);
468void initELFMCObjectFileInfo(
constTriple &
T,
bool Large);
469void initGOFFMCObjectFileInfo(
constTriple &
T);
470void initCOFFMCObjectFileInfo(
constTriple &
T);
471void initSPIRVMCObjectFileInfo(
constTriple &
T);
472void initWasmMCObjectFileInfo(
constTriple &
T);
473void initXCOFFMCObjectFileInfo(
constTriple &
T);
474void initDXContainerObjectFileInfo(
constTriple &
T);
478}
// end namespace llvm PassInstrumentationCallbacks PIC
Defines the llvm::VersionTuple class, which represents a version in the form major[....
Context object for machine code objects.
MCSection * getTLSBSSSection() const
MCSection * getDataRelROSection() const
MCSection * NonLazySymbolPointerSection
MCSection * TLSBSSSection
Section directive for Thread Local uninitialized data.
MCSection * DwarfDebugNamesSection
Accelerator table sections.
MCSection * DwarfAddrSection
const MCSection * TLSThreadInitSection
Section for thread local data initialization functions.
MCSection * GEHContSection
MCSection * DwarfStrOffSection
The DWARF v5 string offset and address table sections.
MCSection * getDwarfLoclistsSection() const
MCSection * DwarfARangesSection
MCSection * getDwarfAccelTypesSection() const
MCSection * DwarfStrSection
MCSection * MergeableConst16Section
const MCSection * getMergeableConst4Section() const
MCSection * COFFGlobalTypeHashesSection
const MCSection * getMergeableConst16Section() const
MCSection * DwarfLocDWOSection
const MCSection * getMergeableConst32Section() const
MCSection * MergeableConst4Section
MCSection * DwarfMacinfoSection
MCSection * DwarfPubNamesSection
MCSection * DwarfGnuPubTypesSection
Section for newer gnu pubtypes.
MCSection * getLLVMStatsSection() const
MCSection * DwarfCUIndexSection
MCSection * TextSection
Section directive for standard text.
MCSection * getDwarfGnuPubNamesSection() const
MCSection * ConstDataCoalSection
MCSection * getDwarfStrOffDWOSection() const
MCSection * LLVMStatsSection
MCSection * ConstTextCoalSection
MCSection * getAddrSigSection() const
MCSection * TLSDataSection
Section directive for Thread Local data. ELF, MachO, COFF, and Wasm.
const MCSection * getTLSTLVSection() const
MCSection * MergeableConst8Section
MCSection * AddrSigSection
MCSection * getEHFrameSection() const
MCSection * getDwarfRangesSection() const
MCSection * getADASection() const
MCSection * getPDataSection() const
MCSection * DwarfInfoSection
MCSection * ThreadLocalPointerSection
MCSection * getDwarfInfoSection(uint64_t Hash) const
MCSection * getDwarfAccelNamespaceSection() const
MCSection * LSDASection
If exception handling is supported by the target, this is the section the Language Specific Data Area...
MCSection * getFaultMapSection() const
MCSection * CompactUnwindSection
If exception handling is supported by the target and the target can support a compact representation ...
MCSection * getDwarfLineDWOSection() const
bool getSupportsWeakOmittedEHFrame() const
MCSection * COFFDebugSymbolsSection
MCSection * getDwarfStrOffSection() const
MCSection * getDwarfInfoDWOSection() const
const MCSection * getConstTextCoalSection() const
MCSection * getGEHContSection() const
MCSection * DwarfStrDWOSection
MCSection * getPseudoProbeDescSection(StringRef FuncName) const
std::array< MCSection *, binaryformat::Swift5ReflectionSectionKind::last > Swift5ReflectionSections
MCSection * getDwarfTypesDWOSection() const
MCSection * DwarfLoclistsSection
The DWARF v5 locations list section.
MCSection * getDwarfPubNamesSection() const
bool getSupportsCompactUnwindWithoutEHFrame() const
MCSection * getDwarfMacroSection() const
MCSection * ReadOnly16Section
MCSection * getSXDataSection() const
MCSection * getTextCoalSection() const
MCSection * DwarfLocSection
MCSection * PseudoProbeSection
Section for pseudo probe information used by AutoFDO.
MCSection * getDwarfStrSection() const
MCSection * getDwarfLineStrSection() const
unsigned getCompactUnwindDwarfEHFrameOnly() const
MCSection * FourByteConstantSection
MCSection * DwarfAccelNamesSection
MCSection * getGFIDsSection() const
MCSection * ReadOnly8Section
MCSection * getStackSizesSection(const MCSection &TextSec) const
MCSection * getDwarfLoclistsDWOSection() const
const MCSection * getConstDataSection() const
const MCSection * getDataCoalSection() const
MCSection * DwarfRnglistsSection
The DWARF v5 range list section.
const MCSection * DwarfDebugInlineSection
MCSection * getBSSSection() const
MCSection * DataBSSSection
MCSection * DwarfAbbrevDWOSection
MCSection * getBBAddrMapSection(const MCSection &TextSec) const
MCSection * COFFDebugTypesSection
MCSection * getDwarfTUIndexSection() const
MCSection * getDwarfDebugNamesSection() const
MCSection * getRemarksSection() const
const MCSection * getConstDataCoalSection() const
MCSection * getDwarfMacinfoDWOSection() const
MCSection * LazySymbolPointerSection
MCSection * getDrectveSection() const
MCSection * getSwift5ReflectionSection(llvm::binaryformat::Swift5ReflectionSectionKind ReflSectionKind)
MCSection * RemarksSection
Remarks section.
MCSection * getLazySymbolPointerSection() const
MCSection * getDwarfRnglistsSection() const
MCSection * getPseudoProbeSection(const MCSection &TextSec) const
MCSection * TextCoalSection
MCSection * getDwarfAddrSection() const
MCSection * PseudoProbeDescSection
MCSection * DwarfPubTypesSection
MCSection * DwarfRangesSection
MCSection * DwarfStrOffDWOSection
MCSection * TLSExtraDataSection
Extra TLS Variable Data section.
MCSection * getDwarfLineSection() const
MCSection * getDwarfInfoSection() const
MCSection * getDwarfFrameSection() const
MCSection * DataRelROSection
MCSection * getTLSExtraDataSection() const
const MCSection * getEightByteConstantSection() const
MCSection * EHFrameSection
EH frame section.
bool OmitDwarfIfHaveCompactUnwind
OmitDwarfIfHaveCompactUnwind - True if the target object file supports having some functions with com...
MCSection * CStringSection
const MCSection * getTLSThreadInitSection() const
MCSection * DrectveSection
COFF specific sections.
MCSection * getPPA2ListSection() const
MCSection * FaultMapSection
FaultMap section.
MCSection * getKCFITrapSection(const MCSection &TextSec) const
MCSection * DwarfAccelObjCSection
MCSection * TLSTLVSection
Section for thread local structure information.
MCSection * getLSDASection() const
MCSection * DwarfSwiftASTSection
MCSection * getDwarfPubTypesSection() const
bool isPositionIndependent() const
MCSection * DwarfMacroSection
unsigned getFDEEncoding() const
const MCSection * getDwarfDebugInlineSection() const
void initMCObjectFileInfo(MCContext &MCCtx, bool PIC, bool LargeCodeModel=false)
MCSection * getDwarfTypesSection(uint64_t Hash) const
MCSection * getDwarfGnuPubTypesSection() const
MCSection * getPPA1Section() const
MCSection * DataCoalSection
MCSection * DwarfFrameSection
MCSection * SXDataSection
MCSection * UStringSection
const MCSection * getMergeableConst8Section() const
MCSection * DwarfRnglistsDWOSection
The DWARF v5 range and location list sections for fission.
MCSection * getDwarfStrDWOSection() const
MCSection * ImportCallSection
If import call optimization is supported by the target, this is the section to emit import call data ...
MCSection * MergeableConst32Section
MCSection * SixteenByteConstantSection
MCSection * getStackMapSection() const
virtual ~MCObjectFileInfo()
MCSection * getDwarfAccelNamesSection() const
MCSection * getReadOnlySection() const
MCSection * getThreadLocalPointerSection() const
MCSection * DataCommonSection
MCSection * getPCSection(StringRef Name, const MCSection *TextSec) const
MCSection * getDwarfAbbrevDWOSection() const
MCSection * getDwarfRnglistsDWOSection() const
const MCSection * getFourByteConstantSection() const
MCSection * DwarfLineStrSection
bool SupportsCompactUnwindWithoutEHFrame
True if the target object file supports emitting a compact unwind section without an associated EH fr...
MCSection * ReadOnlySection
Section that is readonly and can contain arbitrary initialized data.
MCSection * getDwarfAbbrevSection() const
MCSection * getDwarfSwiftASTSection() const
MCSection * getIDRLSection() const
MCSection * DwarfLineDWOSection
MCSection * getCOFFDebugSymbolsSection() const
MCSection * DwarfAbbrevSection
MCSection * getXDataSection() const
bool getOmitDwarfIfHaveCompactUnwind() const
MCSection * getGLJMPSection() const
MCSection * getTOCBaseSection() const
const MCSection * getCStringSection() const
MCSection * DwarfLineSection
const MCSection * getTLSDataSection() const
MCSection * TOCBaseSection
unsigned FDECFIEncoding
FDE CFI encoding.
MCSection * getCOFFDebugTypesSection() const
MCSection * getGIATsSection() const
MCSection * getDwarfCUIndexSection() const
MCSection * getImportCallSection() const
MCSection * DwarfTUIndexSection
bool SupportsWeakOmittedEHFrame
True if target object file supports a weak_definition of constant 0 for an omitted EH frame.
MCSection * getDwarfMacinfoSection() const
MCSection * getDwarfLocDWOSection() const
MCSection * DwarfLoclistsDWOSection
MCSection * getDwarfARangesSection() const
MCSection * getDwarfAccelObjCSection() const
MCSection * DwarfInfoDWOSection
MCSection * BSSSection
Section that is default initialized to zero.
MCSection * getNonLazySymbolPointerSection() const
const MCSection * getSixteenByteConstantSection() const
MCSection * PPA2ListSection
MCSection * getDwarfLocSection() const
virtual unsigned getTextSectionAlignment() const
MCSection * getDataBSSSection() const
MCSection * EightByteConstantSection
MCSection * StackSizesSection
Section containing metadata on function stack sizes.
unsigned CompactUnwindDwarfEHFrameOnly
Compact unwind encoding indicating that we should emit only an EH frame.
const MCSection * getDataCommonSection() const
MCSection * getTextSection() const
MCSection * DwarfTypesDWOSection
MCSection * getCOFFGlobalTypeHashesSection() const
MCSection * DwarfGnuPubNamesSection
Section for newer gnu pubnames.
MCSection * ConstDataSection
MCSection * StackMapSection
StackMap section.
const MCSection * getUStringSection() const
MCSection * DwarfMacroDWOSection
MCSection * getDwarfMacroDWOSection() const
MCSection * DwarfMacinfoDWOSection
MCContext & getContext() const
MCSection * getPPA2Section() const
MCSection * DwarfAccelNamespaceSection
MCSection * getDataSection() const
MCSection * DwarfAccelTypesSection
MCSection * getCompactUnwindSection() const
MCSection * DataSection
Section directive for standard data.
Instances of this class represent a uniqued identifier for a section in the current translation unit.
StringRef - Represent a constant reference to a string, i.e.
Triple - Helper class for working with autoconf configuration names.
Swift5ReflectionSectionKind
This is an optimization pass for GlobalISel generic memory operations.