LLVM 20.0.0git
|
This implementation is used for RISC-V ELF targets. More...
#include "Target/RISCV/RISCVTargetObjectFile.h"
Additional Inherited Members | |
Static Public Member Functions inherited from llvm::TargetLoweringObjectFile | |
static SectionKind | getKindForGlobal (const GlobalObject *GO, const TargetMachine &TM) |
Classify the specified global variable into a set of target independent categories embodied in SectionKind. | |
virtual MCSection * | SelectSectionForGlobal (const GlobalObject *GO, SectionKind Kind, const TargetMachine &TM) const =0 |
Protected Attributes inherited from llvm::TargetLoweringObjectFileELF | |
MCSymbolRefExpr::VariantKind | PLTRelativeVariantKind |
Protected Attributes inherited from llvm::TargetLoweringObjectFile | |
bool | SupportIndirectSymViaGOTPCRel = false |
bool | SupportGOTPCRelWithOffset = true |
bool | SupportDebugThreadLocalLocation = true |
bool | SupportDSOLocalEquivalentLowering = false |
unsigned | PersonalityEncoding = 0 |
PersonalityEncoding, LSDAEncoding, TTypeEncoding - Some encoding values for EH. | |
unsigned | LSDAEncoding = 0 |
unsigned | TTypeEncoding = 0 |
unsigned | CallSiteEncoding = 0 |
MCSection * | StaticCtorSection = nullptr |
This section contains the static constructor pointer list. | |
MCSection * | StaticDtorSection = nullptr |
This section contains the static destructor pointer list. | |
const TargetMachine * | TM = nullptr |
Protected Attributes inherited from llvm::MCObjectFileInfo | |
bool | SupportsWeakOmittedEHFrame = false |
True if target object file supports a weak_definition of constant 0 for an omitted EH frame. | |
bool | SupportsCompactUnwindWithoutEHFrame = false |
True if the target object file supports emitting a compact unwind section without an associated EH frame section. | |
bool | OmitDwarfIfHaveCompactUnwind = false |
OmitDwarfIfHaveCompactUnwind - True if the target object file supports having some functions with compact unwind and other with dwarf unwind. | |
unsigned | FDECFIEncoding = 0 |
FDE CFI encoding. | |
unsigned | CompactUnwindDwarfEHFrameOnly = 0 |
Compact unwind encoding indicating that we should emit only an EH frame. | |
MCSection * | TextSection = nullptr |
Section directive for standard text. | |
MCSection * | DataSection = nullptr |
Section directive for standard data. | |
MCSection * | BSSSection = nullptr |
Section that is default initialized to zero. | |
MCSection * | ReadOnlySection = nullptr |
Section that is readonly and can contain arbitrary initialized data. | |
MCSection * | LSDASection = nullptr |
If exception handling is supported by the target, this is the section the Language Specific Data Area information is emitted to. | |
MCSection * | CompactUnwindSection = nullptr |
If exception handling is supported by the target and the target can support a compact representation of the CIE and FDE, this is the section to emit them into. | |
MCSection * | DwarfAbbrevSection = nullptr |
MCSection * | DwarfInfoSection = nullptr |
MCSection * | DwarfLineSection = nullptr |
MCSection * | DwarfLineStrSection = nullptr |
MCSection * | DwarfFrameSection = nullptr |
MCSection * | DwarfPubTypesSection = nullptr |
const MCSection * | DwarfDebugInlineSection = nullptr |
MCSection * | DwarfStrSection = nullptr |
MCSection * | DwarfLocSection = nullptr |
MCSection * | DwarfARangesSection = nullptr |
MCSection * | DwarfRangesSection = nullptr |
MCSection * | DwarfMacinfoSection = nullptr |
MCSection * | DwarfMacroSection = nullptr |
MCSection * | DwarfPubNamesSection = nullptr |
MCSection * | DwarfDebugNamesSection = nullptr |
Accelerator table sections. | |
MCSection * | DwarfAccelNamesSection = nullptr |
MCSection * | DwarfAccelObjCSection = nullptr |
MCSection * | DwarfAccelNamespaceSection = nullptr |
MCSection * | DwarfAccelTypesSection = nullptr |
MCSection * | DwarfInfoDWOSection = nullptr |
MCSection * | DwarfTypesDWOSection = nullptr |
MCSection * | DwarfAbbrevDWOSection = nullptr |
MCSection * | DwarfStrDWOSection = nullptr |
MCSection * | DwarfLineDWOSection = nullptr |
MCSection * | DwarfLocDWOSection = nullptr |
MCSection * | DwarfStrOffDWOSection = nullptr |
MCSection * | DwarfMacinfoDWOSection = nullptr |
MCSection * | DwarfMacroDWOSection = nullptr |
MCSection * | DwarfStrOffSection = nullptr |
The DWARF v5 string offset and address table sections. | |
MCSection * | DwarfAddrSection = nullptr |
MCSection * | DwarfRnglistsSection = nullptr |
The DWARF v5 range list section. | |
MCSection * | DwarfLoclistsSection = nullptr |
The DWARF v5 locations list section. | |
MCSection * | DwarfRnglistsDWOSection = nullptr |
The DWARF v5 range and location list sections for fission. | |
MCSection * | DwarfLoclistsDWOSection = nullptr |
MCSection * | DwarfCUIndexSection = nullptr |
MCSection * | DwarfTUIndexSection = nullptr |
MCSection * | DwarfGnuPubNamesSection = nullptr |
Section for newer gnu pubnames. | |
MCSection * | DwarfGnuPubTypesSection = nullptr |
Section for newer gnu pubtypes. | |
MCSection * | DwarfSwiftASTSection = nullptr |
MCSection * | COFFDebugSymbolsSection = nullptr |
MCSection * | COFFDebugTypesSection = nullptr |
MCSection * | COFFGlobalTypeHashesSection = nullptr |
MCSection * | TLSExtraDataSection = nullptr |
Extra TLS Variable Data section. | |
MCSection * | TLSDataSection = nullptr |
Section directive for Thread Local data. ELF, MachO, COFF, and Wasm. | |
MCSection * | TLSBSSSection = nullptr |
Section directive for Thread Local uninitialized data. | |
MCSection * | StackMapSection = nullptr |
StackMap section. | |
MCSection * | FaultMapSection = nullptr |
FaultMap section. | |
MCSection * | RemarksSection = nullptr |
Remarks section. | |
MCSection * | EHFrameSection = nullptr |
EH frame section. | |
MCSection * | StackSizesSection = nullptr |
Section containing metadata on function stack sizes. | |
MCSection * | PseudoProbeSection = nullptr |
Section for pseudo probe information used by AutoFDO. | |
MCSection * | PseudoProbeDescSection = nullptr |
MCSection * | LLVMStatsSection = nullptr |
MCSection * | DataRelROSection = nullptr |
MCSection * | MergeableConst4Section = nullptr |
MCSection * | MergeableConst8Section = nullptr |
MCSection * | MergeableConst16Section = nullptr |
MCSection * | MergeableConst32Section = nullptr |
MCSection * | TLSTLVSection = nullptr |
Section for thread local structure information. | |
const MCSection * | TLSThreadInitSection = nullptr |
Section for thread local data initialization functions. | |
MCSection * | CStringSection = nullptr |
MCSection * | UStringSection = nullptr |
MCSection * | TextCoalSection = nullptr |
MCSection * | ConstTextCoalSection = nullptr |
MCSection * | ConstDataSection = nullptr |
MCSection * | DataCoalSection = nullptr |
MCSection * | ConstDataCoalSection = nullptr |
MCSection * | DataCommonSection = nullptr |
MCSection * | DataBSSSection = nullptr |
MCSection * | FourByteConstantSection = nullptr |
MCSection * | EightByteConstantSection = nullptr |
MCSection * | SixteenByteConstantSection = nullptr |
MCSection * | LazySymbolPointerSection = nullptr |
MCSection * | NonLazySymbolPointerSection = nullptr |
MCSection * | ThreadLocalPointerSection = nullptr |
MCSection * | AddrSigSection = nullptr |
MCSection * | DrectveSection = nullptr |
COFF specific sections. | |
MCSection * | PDataSection = nullptr |
MCSection * | XDataSection = nullptr |
MCSection * | SXDataSection = nullptr |
MCSection * | GEHContSection = nullptr |
MCSection * | GFIDsSection = nullptr |
MCSection * | GIATsSection = nullptr |
MCSection * | GLJMPSection = nullptr |
MCSection * | PPA1Section = nullptr |
MCSection * | PPA2Section = nullptr |
MCSection * | PPA2ListSection = nullptr |
MCSection * | ADASection = nullptr |
MCSection * | IDRLSection = nullptr |
MCSection * | TOCBaseSection = nullptr |
MCSection * | ReadOnly8Section = nullptr |
MCSection * | ReadOnly16Section = nullptr |
std::array< MCSection *, binaryformat::Swift5ReflectionSectionKind::last > | Swift5ReflectionSections = {} |
This implementation is used for RISC-V ELF targets.
Definition at line 17 of file RISCVTargetObjectFile.h.
|
overridevirtual |
Get the target specific PC relative GOT entry relocation.
Reimplemented from llvm::TargetLoweringObjectFile.
Definition at line 48 of file RISCVTargetObjectFile.cpp.
References llvm::MCSymbolRefExpr::create(), llvm::MCConstantExpr::create(), llvm::MCBinaryExpr::createAdd(), llvm::MCValue::getConstant(), llvm::MCObjectFileInfo::getContext(), llvm::Offset, Sym, and llvm::MCSymbolRefExpr::VK_GOTPCREL.
|
overridevirtual |
Get the module-level metadata that the platform cares about.
Reimplemented from llvm::TargetLoweringObjectFileELF.
Definition at line 141 of file RISCVTargetObjectFile.cpp.
References llvm::TargetLoweringObjectFileELF::getModuleMetadata().
|
overridevirtual |
Given a constant with the SectionKind, return a section that it should be placed in.
Given a mergeable constant with the specified size and relocation information, return a section that it should be placed in.
Reimplemented from llvm::TargetLoweringObjectFileELF.
Definition at line 161 of file RISCVTargetObjectFile.cpp.
References llvm::CallingConv::C, DL, llvm::TargetLoweringObjectFileELF::getSectionForConstant(), and isConstantInSmallSection().
|
overridevirtual |
Reimplemented from llvm::MCObjectFileInfo.
Definition at line 20 of file RISCVTargetObjectFile.cpp.
References llvm::MCObjectFileInfo::getContext(), and llvm::RISCVMCObjectFileInfo::getTextSectionAlignment().
|
overridevirtual |
This method must be called before any actual lowering is done.
Initialize - this method must be called before any actual lowering is done.
This specifies the current context for codegen, and gives the lowering implementations a chance to set up their default sections.
Reimplemented from llvm::TargetLoweringObjectFileELF.
Definition at line 25 of file RISCVTargetObjectFile.cpp.
References llvm::MCObjectFileInfo::getContext(), llvm::MCContext::getELFSection(), llvm::TargetLoweringObjectFileELF::Initialize(), llvm::TargetLoweringObjectFileELF::PLTRelativeVariantKind, llvm::ELF::SHF_ALLOC, llvm::ELF::SHF_MERGE, llvm::ELF::SHF_WRITE, llvm::ELF::SHT_NOBITS, llvm::ELF::SHT_PROGBITS, llvm::TargetLoweringObjectFile::SupportIndirectSymViaGOTPCRel, llvm::TargetLoweringObjectFile::TM, and llvm::MCSymbolRefExpr::VK_PLT.
bool RISCVELFTargetObjectFile::isConstantInSmallSection | ( | const DataLayout & | DL, |
const Constant * | CN | ||
) | const |
Return true if this constant should be placed into small data section.
Definition at line 156 of file RISCVTargetObjectFile.cpp.
References DL, llvm::Value::getType(), and isInSmallSection().
Referenced by getSectionForConstant().
bool RISCVELFTargetObjectFile::isGlobalInSmallSection | ( | const GlobalObject * | GO, |
const TargetMachine & | TM | ||
) | const |
Return true if this global address should be placed into small data/bss section.
Definition at line 69 of file RISCVTargetObjectFile.cpp.
References llvm::GlobalValue::getDataLayout(), llvm::GlobalObject::getSection(), llvm::DataLayout::getTypeAllocSize(), llvm::GlobalValue::getValueType(), llvm::GlobalValue::hasCommonLinkage(), llvm::GlobalValue::hasExternalLinkage(), llvm::GlobalObject::hasSection(), llvm::GlobalValue::isDeclaration(), isInSmallSection(), and llvm::Type::isSized().
Referenced by SelectSectionForGlobal().
Definition at line 61 of file RISCVTargetObjectFile.cpp.
References Size.
Referenced by isConstantInSmallSection(), and isGlobalInSmallSection().
|
overridevirtual |
Reimplemented from llvm::TargetLoweringObjectFileELF.
Definition at line 105 of file RISCVTargetObjectFile.cpp.
References llvm::MCObjectFileInfo::getContext(), llvm::TargetMachine::getDataSections(), llvm::MCContext::getELFSection(), llvm::Value::getName(), llvm::GlobalObject::hasSection(), isGlobalInSmallSection(), Name, llvm::TargetLoweringObjectFileELF::SelectSectionForGlobal(), llvm::ELF::SHF_ALLOC, llvm::ELF::SHF_WRITE, llvm::ELF::SHT_NOBITS, llvm::ELF::SHT_PROGBITS, and llvm::TargetLoweringObjectFile::TM.