Go to the documentation of this file.
44 if (
T.isMacOSX() && !
T.isMacOSXVersionLT(10, 6))
48 if (
T.isiOS() &&
T.isX86())
54 void MCObjectFileInfo::initMachOMCObjectFileInfo(
const Triple &
T) {
59 "__TEXT",
"__eh_frame",
84 if (
T.isMacOSX() &&
T.isMacOSXVersionLT(10, 5))
322 #define HANDLE_SWIFT_SECTION(KIND, MACHO, ELF, COFF) \
323 Swift5ReflectionSections \
324 [llvm::binaryformat::Swift5ReflectionSectionKind::KIND] = \
325 Ctx->getMachOSection(Ctx->getSwift5ReflectionSegmentName().data(), \
326 MACHO, 0, SectionKind::getMetadata());
327 #include "llvm/BinaryFormat/Swift.def"
333 void MCObjectFileInfo::initELFMCObjectFileInfo(
const Triple &
T,
bool Large) {
334 switch (
T.getArch()) {
341 if (PositionIndependent && !
Large)
496 ".debug_str.dwo", DebugSecType,
527 Ctx->
getELFSection(
".eh_frame", EHSectionType, EHSectionFlags);
536 void MCObjectFileInfo::initGOFFMCObjectFileInfo(
const Triple &
T) {
546 void MCObjectFileInfo::initCOFFMCObjectFileInfo(
const Triple &
T) {
642 ".debug_gnu_pubnames",
647 ".debug_gnu_pubtypes",
657 ".debug_str_offsets",
697 ".debug_macinfo.dwo",
737 ".debug_str_offsets.dwo",
828 void MCObjectFileInfo::initSPIRVMCObjectFileInfo(
const Triple &
T) {
833 void MCObjectFileInfo::initWasmMCObjectFileInfo(
const Triple &
T) {
919 void MCObjectFileInfo::initXCOFFMCObjectFileInfo(
const Triple &
T) {
1023 void MCObjectFileInfo::initDXContainerObjectFileInfo(
const Triple &
T) {
1031 bool LargeCodeModel) {
1032 PositionIndependent =
PIC;
1055 initMachOMCObjectFileInfo(TheTriple);
1058 initCOFFMCObjectFileInfo(TheTriple);
1061 initELFMCObjectFileInfo(TheTriple, LargeCodeModel);
1064 initGOFFMCObjectFileInfo(TheTriple);
1067 initSPIRVMCObjectFileInfo(TheTriple);
1070 initWasmMCObjectFileInfo(TheTriple);
1073 initXCOFFMCObjectFileInfo(TheTriple);
1076 initDXContainerObjectFileInfo(TheTriple);
1081 MCSection *MCObjectFileInfo::getDwarfComdatSection(
const char *
Name,
1086 utostr(Hash),
true);
1098 "format: not implemented.");
1113 GroupName = Group->getName();
1131 GroupName = Group->getName();
1145 const auto *ElfSec =
static_cast<const MCSectionELF *
>(TextSec);
1147 if (
const MCSymbol *Group = ElfSec->getGroup()) {
1151 S->getEntrySize(), Group->getName(),
1175 S->getName() +
"_" + FuncName,
@ S_CSTRING_LITERALS
S_CSTRING_LITERALS - Section with literal C strings.
MCSection * TextCoalSection
MCSection * DwarfLineDWOSection
MCSection * CompactUnwindSection
If exception handling is supported by the target and the target can support a compact representation ...
MCSection * ConstTextCoalSection
MCSection * DwarfSwiftASTSection
unsigned getUniqueID() const
virtual ~MCObjectFileInfo()
unsigned CompactUnwindDwarfEHFrameOnly
Compact unwind encoding indicating that we should emit only an EH frame.
@ GenericSectionID
Pass this value as the UniqueID during section creation to get the generic section with the given nam...
static SectionKind getReadOnlyWithRel()
static SectionKind getMergeable2ByteCString()
This is an optimization pass for GlobalISel generic memory operations.
MCSection * DwarfAbbrevDWOSection
@ SSUBTYP_DWARNGE
DWARF aranges section.
@ IMAGE_SCN_CNT_UNINITIALIZED_DATA
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
MCSection * DwarfRnglistsDWOSection
The DWARF v5 range and location list sections for fission.
bool OmitDwarfIfHaveCompactUnwind
OmitDwarfIfHaveCompactUnwind - True if the target object file supports having some functions with com...
static SectionKind getMetadata()
MCSection * EightByteConstantSection
MCSection * MergeableConst16Section
MCSection * ReadOnlySection
Section that is readonly and can contain arbitrary initialized data.
Context object for machine code objects.
MCSection * NonLazySymbolPointerSection
MCSection * DwarfLineSection
@ SSUBTYP_DWLOC
DWARF loc section.
static const MCConstantExpr * create(int64_t Value, MCContext &Ctx, bool PrintInHex=false, unsigned SizeInBytes=0)
MCSection * DwarfLocDWOSection
MCSymbol * getBeginSymbol()
MCSection * SixteenByteConstantSection
MCSection * DwarfAddrSection
bool CommDirectiveSupportsAlignment
True if .comm supports alignment.
MCSection * FourByteConstantSection
@ IMAGE_SCN_MEM_DISCARDABLE
@ SSUBTYP_DWPBTYP
DWARF pubtypes section.
@ SSUBTYP_DWLINE
DWARF line section.
MCSection * ThreadLocalPointerSection
const MCSymbolELF * getGroup() const
MCSection * DataBSSSection
Triple - Helper class for working with autoconf configuration names.
MCSection * DwarfAbbrevSection
MCSection * AddrSigSection
MCSection * DwarfDebugNamesSection
Accelerator table sections.
static SectionKind getMergeableConst16()
PassInstrumentationCallbacks PIC
MCSection * DwarfTUIndexSection
unsigned getCodePointerSize() const
Get the code pointer size in bytes.
MCSection * getPseudoProbeSection(const MCSection *TextSec) const
@ SSUBTYP_DWRNGES
DWARF ranges section.
@ S_ZEROFILL
S_ZEROFILL - Zero fill on demand section.
MCSection * ConstDataCoalSection
MCSection * LazySymbolPointerSection
MCSection * TLSExtraDataSection
Extra TLS Variable Data section.
This represents a section on linux, lots of unix variants and some bare metal systems.
MCSection * DwarfPubNamesSection
MCSection * DwarfPubTypesSection
@ S_8BYTE_LITERALS
S_8BYTE_LITERALS - Section with 8 byte literals.
MCSection * SXDataSection
@ SSUBTYP_DWMAC
DWARF macinfo section.
MCSection * DwarfFrameSection
MCSection * DwarfARangesSection
MCSection * DwarfStrSection
MCSectionMachO * getMachOSection(StringRef Segment, StringRef Section, unsigned TypeAndAttributes, unsigned Reserved2, SectionKind K, const char *BeginSymName=nullptr)
Return the MCSection for the specified mach-o section.
@ S_ATTR_STRIP_STATIC_SYMS
S_ATTR_STRIP_STATIC_SYMS - Ok to strip static symbols in this section in files with the MY_DYLDLINK f...
MCSection * ReadOnly8Section
static SectionKind getReadOnly()
MCSection * LSDASection
If exception handling is supported by the target, this is the section the Language Specific Data Area...
@ IMAGE_SCN_CNT_INITIALIZED_DATA
@ S_COALESCED
S_COALESCED - Section contains symbols that are to be coalesced.
static SectionKind getThreadBSS()
EmitDwarfUnwindType emitDwarfUnwindInfo() const
@ XMC_RO
Read Only Constant.
MCSectionSPIRV * getSPIRVSection()
@ SSUBTYP_DWPBNMS
DWARF pubnames section.
bool SupportsCompactUnwindWithoutEHFrame
True if the target object file supports emitting a compact unwind section without an associated EH fr...
MCSectionGOFF * getGOFFSection(StringRef Section, SectionKind Kind, MCSection *Parent, const MCExpr *SubsectionId)
MCSection * MergeableConst8Section
unsigned FDECFIEncoding
FDE CFI encoding.
const MCSection * TLSThreadInitSection
Section for thread local data initialization functions.
MCSectionELF * getELFSection(const Twine &Section, unsigned Type, unsigned Flags)
static SectionKind getBSS()
MCSection * DwarfAccelTypesSection
bool supportsCOMDAT() const
Tests whether the target supports comdat.
Environment getObjectFileType() const
MCSection * DwarfStrOffDWOSection
MCSection * getStackSizesSection(const MCSection &TextSec) const
MCSection * DwarfStrDWOSection
ObjectFormatType getObjectFormat() const
Get the object format for this triple.
void report_fatal_error(Error Err, bool gen_crash_diag=true)
Report a serious error, calling any installed error handler.
MCSectionXCOFF * getXCOFFSection(StringRef Section, SectionKind K, Optional< XCOFF::CsectProperties > CsectProp=None, bool MultiSymbolsAllowed=false, const char *BeginSymName=nullptr, Optional< XCOFF::DwarfSectionSubtypeFlags > DwarfSubtypeFlags=None)
MCSectionDXContainer * getDXContainerSection(StringRef Section, SectionKind K)
Get the section for the provided Section name.
static SectionKind getText()
@ XTY_SD
Csect definition for initialized storage.
@ SSUBTYP_DWABREV
DWARF abbrev section.
MCSection * TLSDataSection
Section directive for Thread Local data. ELF, MachO, COFF, and Wasm.
MCSection * DwarfRangesSection
@ S_LAZY_SYMBOL_POINTERS
S_LAZY_SYMBOL_POINTERS - Section with lazy symbol pointers.
const Triple & getTargetTriple() const
MCSection * ConstDataSection
MCSectionWasm * getWasmSection(const Twine &Section, SectionKind K, unsigned Flags=0)
MCSection * DwarfLoclistsSection
The DWARF v5 locations list section.
MCSection * getPseudoProbeDescSection(StringRef FuncName) const
MCSection * COFFGlobalTypeHashesSection
@ S_NON_LAZY_SYMBOL_POINTERS
S_NON_LAZY_SYMBOL_POINTERS - Section with non-lazy symbol pointers.
static SectionKind getMergeable1ByteCString()
MCSection * FaultMapSection
FaultMap section.
MCSection * DwarfMacinfoSection
constexpr LLVM_NODISCARD bool empty() const
empty - Check if the string is empty.
const MCAsmInfo * getAsmInfo() const
MCSection * UStringSection
MCSection * CStringSection
MCSection * DwarfMacroSection
@ XMC_TL
Initialized thread-local variable.
@ S_ATTR_PURE_INSTRUCTIONS
S_ATTR_PURE_INSTRUCTIONS - Section contains only true machine instructions.
bool SupportsWeakOmittedEHFrame
True if target object file supports a weak_definition of constant 0 for an omitted EH frame.
MCSection * DwarfLineStrSection
@ S_4BYTE_LITERALS
S_4BYTE_LITERALS - Section with 4 byte literals.
MCSection * DwarfLocSection
@ S_THREAD_LOCAL_VARIABLES
S_THREAD_LOCAL_VARIABLES - Section with thread local variable structure data.
@ S_THREAD_LOCAL_REGULAR
S_THREAD_LOCAL_REGULAR - Thread local data section.
static SectionKind getThreadData()
void initMCObjectFileInfo(MCContext &MCCtx, bool PIC, bool LargeCodeModel=false)
MCSection * PseudoProbeDescSection
MCSection * DwarfInfoSection
@ S_ATTR_LIVE_SUPPORT
S_ATTR_LIVE_SUPPORT - Blocks are live if they reference live blocks.
MCSection * DwarfMacroDWOSection
MCSection * DwarfLoclistsDWOSection
StringRef - Represent a constant reference to a string, i.e.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
MCSection * getBBAddrMapSection(const MCSection &TextSec) const
@ S_ATTR_NO_TOC
S_ATTR_NO_TOC - Section contains coalesced symbols that are not to be in a ranlib table of contents.
Instances of this class represent a uniqued identifier for a section in the current translation unit.
add sub stmia L5 ldr r0 bl L_printf $stub Instead of a and a wouldn t it be better to do three moves *Return an aggregate type is even return S
MCSectionCOFF * getCOFFSection(StringRef Section, unsigned Characteristics, SectionKind Kind, StringRef COMDATSymName, int Selection, unsigned UniqueID=GenericSectionID, const char *BeginSymName=nullptr)
@ S_16BYTE_LITERALS
S_16BYTE_LITERALS - Section with only 16 byte literals.
MCSection * RemarksSection
Remarks section.
MCSection * DwarfInfoDWOSection
MCSection * GEHContSection
MCSection * DrectveSection
COFF specific sections.
MCSection * DwarfStrOffSection
The DWARF v5 string offset and address table sections.
@ SSUBTYP_DWINFO
DWARF info section.
void setAlignment(Align Value)
MCSection * DataRelROSection
static SectionKind getData()
MCSection * TOCBaseSection
static SectionKind getMergeableConst8()
MCSection * DwarfRnglistsSection
The DWARF v5 range list section.
const StringRef & getSwift5ReflectionSegmentName() const
MCSection * DataSection
Section directive for standard data.
MCSection * DwarfAccelNamespaceSection
@ S_THREAD_LOCAL_VARIABLE_POINTERS
S_THREAD_LOCAL_VARIABLE_POINTERS - Section with pointers to thread local structures.
MCSection * MergeableConst32Section
const MCSection * DwarfDebugInlineSection
MCSection * EHFrameSection
EH frame section.
@ XMC_TC0
TOC Anchor for TOC Addressability.
MCSection * COFFDebugTypesSection
@ S_THREAD_LOCAL_ZEROFILL
S_THREAD_LOCAL_ZEROFILL - Thread local zerofill section.
MCSection * DataCoalSection
MCSection * DwarfAccelObjCSection
MCSection * DwarfGnuPubTypesSection
Section for newer gnu pubtypes.
MCSection * DwarfTypesDWOSection
static SectionKind getMergeableConst4()
MCSection * DwarfAccelNamesSection
MCSection * ReadOnly16Section
MCSection * BSSSection
Section that is default initialized to zero.
MCSection * MergeableConst4Section
MCSection * TLSBSSSection
Section directive for Thread Local uninitialized data.
MCSection * StackSizesSection
Section containing metadata on function stack sizes.
MCSection * DwarfGnuPubNamesSection
Section for newer gnu pubnames.
MCSection * DwarfMacinfoDWOSection
@ SSUBTYP_DWFRAME
DWARF frame section.
@ S_THREAD_LOCAL_INIT_FUNCTION_POINTERS
S_THREAD_LOCAL_INIT_FUNCTION_POINTERS - Section with thread local variable initialization pointers to...
MCSection * StackMapSection
StackMap section.
MCSection * PseudoProbeSection
Section for pseudo probe information used by AutoFDO.
MCSection * DataCommonSection
MCSection * DwarfCUIndexSection
static bool useCompactUnwind(const Triple &T)
MCSection * TLSTLVSection
Section for thread local structure information.
@ SSUBTYP_DWSTR
DWARF str section.
MCSection * COFFDebugSymbolsSection
@ S_ATTR_DEBUG
S_ATTR_DEBUG - A debug section.
MCSection * TextSection
Section directive for standard text.