LLVM: llvm::jitlink::ELFLinkGraphBuilder< ELFT > Class Template Reference (original) (raw)

LinkGraph building code that's specific to the given ELFT, but common across all architectures. More...

#include "[ExecutionEngine/JITLink/ELFLinkGraphBuilder.h](ELFLinkGraphBuilder%5F8h%5Fsource.html)"

Public Member Functions
ELFLinkGraphBuilder (const object::ELFFile< ELFT > &Obj, std::shared_ptr< orc::SymbolStringPool > SSP, Triple TT, SubtargetFeatures Features, StringRef FileName, LinkGraph::GetEdgeKindNameFunction GetEdgeKindName)
ELFLinkGraphBuilder & setProcessDebugSections (bool ProcessDebugSections)
Debug sections are included in the graph by default.
Expected< std::unique_ptr< LinkGraph > > buildGraph ()
Attempt to construct and return the LinkGraph.
virtual Error addRelocations ()=0
Call to derived class to handle relocations.
template
Error forEachRelaRelocation (const typename ELFT::Shdr &RelSect, RelocHandlerFunction &&Func)
template
Error forEachRelRelocation (const typename ELFT::Shdr &RelSect, RelocHandlerFunction &&Func)
Public Member Functions inherited from llvm::jitlink::ELFLinkGraphBuilderBase
ELFLinkGraphBuilderBase (std::unique_ptr< LinkGraph > G)
virtual ~ELFLinkGraphBuilderBase ()
Protected Member Functions
bool isRelocatable () const
void setGraphBlock (ELFSectionIndex SecIndex, Block *B)
Block * getGraphBlock (ELFSectionIndex SecIndex)
void setGraphSymbol (ELFSymbolIndex SymIndex, Symbol &Sym)
Symbol * getGraphSymbol (ELFSymbolIndex SymIndex)
Expected< std::pair< Linkage, Scope > > getSymbolLinkageAndScope (const typename ELFT::Sym &Sym, StringRef Name)
virtual TargetFlagsType makeTargetFlags (const typename ELFT::Sym &Sym)
Set the target flags on the given Symbol.
virtual orc::ExecutorAddrDiff getRawOffset (const typename ELFT::Sym &Sym, TargetFlagsType Flags)
Get the physical offset of the symbol on the target platform.
Error prepare ()
Error graphifySections ()
Error graphifySymbols ()
virtual bool excludeSection (const typename ELFT::Shdr &Sect) const
Override in derived classes to suppress certain sections in the link graph.
template
Error forEachRelaRelocation (const typename ELFT::Shdr &RelSect, RelocHandlerMethod &&Func)
Traverse all matching ELFT::Rela relocation records in the given section.
template
Error forEachRelRelocation (const typename ELFT::Shdr &RelSect, RelocHandlerMethod &&Func)
Traverse all matching ELFT::Rel relocation records in the given section.
template<typename ClassT, typename RelocHandlerMethod>
Error forEachRelaRelocation (const typename ELFT::Shdr &RelSect, ClassT *Instance, RelocHandlerMethod &&Method)
Traverse all matching rela relocation records in the given section.
template<typename ClassT, typename RelocHandlerMethod>
Error forEachRelRelocation (const typename ELFT::Shdr &RelSect, ClassT *Instance, RelocHandlerMethod &&Method)
Traverse all matching rel relocation records in the given section.
Protected Member Functions inherited from llvm::jitlink::ELFLinkGraphBuilderBase
Section & getCommonSection ()
Protected Attributes
const ELFFile & Obj
ELFFile::Elf_Shdr_Range Sections
const ELFFile::Elf_Shdr * SymTabSec = nullptr
StringRef SectionStringTab
bool ProcessDebugSections = true
DenseMap< ELFSectionIndex, Block * > GraphBlocks
DenseMap< ELFSymbolIndex, Symbol * > GraphSymbols
DenseMap< const typename ELFFile::Elf_Shdr *, ArrayRef< typename ELFFile::Elf_Word > > ShndxTables
Protected Attributes inherited from llvm::jitlink::ELFLinkGraphBuilderBase
std::unique_ptr< LinkGraph > G

template
class llvm::jitlink::ELFLinkGraphBuilder< ELFT >

LinkGraph building code that's specific to the given ELFT, but common across all architectures.

Definition at line 57 of file ELFLinkGraphBuilder.h.

ELFSectionIndex

ELFSymbolIndex

addRelocations()

Call to derived class to handle relocations.

These require architecture specific knowledge to map to JITLink edge kinds.

Referenced by buildGraph().

buildGraph()

Attempt to construct and return the LinkGraph.

Definition at line 205 of file ELFLinkGraphBuilder.h.

References addRelocations(), llvm::jitlink::ELFLinkGraphBuilderBase::G, graphifySections(), graphifySymbols(), isRelocatable(), llvm::make_error(), and prepare.

Referenced by llvm::jitlink::createLinkGraphFromELFObject_aarch32(), llvm::jitlink::createLinkGraphFromELFObject_ppc64(), llvm::jitlink::createLinkGraphFromELFObject_riscv(), llvm::jitlink::createLinkGraphFromELFObject_systemz(), llvm::jitlink::createLinkGraphFromELFObject_x86(), and llvm::jitlink::createLinkGraphFromELFObject_x86_64().

excludeSection()

forEachRelaRelocation() [1/3]

template

template<typename ClassT, typename RelocHandlerMethod>

Traverse all matching rela relocation records in the given section.

Convenience wrapper to allow passing a member function for the handler.

Definition at line 153 of file ELFLinkGraphBuilder.h.

References forEachRelaRelocation().

forEachRelaRelocation() [2/3]

template

template

forEachRelaRelocation() [3/3]

template

template

forEachRelRelocation() [1/3]

template

template<typename ClassT, typename RelocHandlerMethod>

Traverse all matching rel relocation records in the given section.

Convenience wrapper to allow passing a member function for the handler.

Definition at line 166 of file ELFLinkGraphBuilder.h.

References forEachRelRelocation().

forEachRelRelocation() [2/3]

template

template

forEachRelRelocation() [3/3]

template

template

getGraphBlock()

getGraphSymbol()

getRawOffset()

getSymbolLinkageAndScope()

Definition at line 226 of file ELFLinkGraphBuilder.h.

References llvm::jitlink::Default, llvm::jitlink::Hidden, llvm::inconvertibleErrorCode(), llvm::jitlink::Local, llvm::make_error(), llvm::ELF::STB_GLOBAL, llvm::ELF::STB_GNU_UNIQUE, llvm::ELF::STB_LOCAL, llvm::ELF::STB_WEAK, llvm::jitlink::Strong, llvm::ELF::STV_DEFAULT, llvm::ELF::STV_HIDDEN, llvm::ELF::STV_INTERNAL, llvm::ELF::STV_PROTECTED, and llvm::jitlink::Weak.

Referenced by graphifySymbols().

graphifySections()

Definition at line 313 of file ELFLinkGraphBuilder.h.

References B(), llvm::Data, llvm::dbgs(), excludeSection(), llvm::orc::Exec, llvm::jitlink::ELFLinkGraphBuilderBase::G, isDwarfSection(), LLVM_DEBUG, llvm::make_error(), llvm::orc::NoAlloc, Obj, ProcessDebugSections, llvm::orc::Read, Sections, SectionStringTab, setGraphBlock(), llvm::ELF::SHF_ALLOC, llvm::ELF::SHF_EXECINSTR, llvm::ELF::SHF_WRITE, llvm::ELF::SHT_ARM_EXIDX, llvm::ELF::SHT_NOBITS, llvm::ELF::SHT_NULL, llvm::Error::success(), and llvm::orc::Write.

Referenced by buildGraph().

graphifySymbols()

Definition at line 413 of file ELFLinkGraphBuilder.h.

References B(), llvm::dbgs(), llvm::jitlink::Default, llvm::formatv(), llvm::jitlink::ELFLinkGraphBuilderBase::G, llvm::jitlink::ELFLinkGraphBuilderBase::getCommonSection(), llvm::object::getExtendedSymbolTableIndex(), getGraphBlock(), getRawOffset(), getSymbolLinkageAndScope(), llvm::orc::ExecutorAddr::getValue(), llvm::inconvertibleErrorCode(), LLVM_DEBUG, llvm::jitlink::Local, llvm::make_error(), makeTargetFlags(), Obj, llvm::Offset, Sections, SectionStringTab, setGraphSymbol(), llvm::ELF::SHN_XINDEX, ShndxTables, llvm::ELF::STB_GLOBAL, llvm::ELF::STB_LOCAL, llvm::ELF::STB_WEAK, llvm::jitlink::Strong, llvm::ELF::STT_FILE, llvm::ELF::STT_FUNC, llvm::ELF::STT_NOTYPE, llvm::ELF::STT_OBJECT, llvm::ELF::STT_SECTION, llvm::ELF::STT_TLS, llvm::Error::success(), SymTabSec, llvm::toString(), and llvm::jitlink::Weak.

Referenced by buildGraph().

isRelocatable()

makeTargetFlags()

prepare()

Definition at line 271 of file ELFLinkGraphBuilder.h.

References llvm::dbgs(), llvm::jitlink::ELFLinkGraphBuilderBase::G, LLVM_DEBUG, llvm::make_error(), Obj, Sections, SectionStringTab, ShndxTables, llvm::ELF::SHT_SYMTAB, llvm::ELF::SHT_SYMTAB_SHNDX, llvm::Error::success(), and SymTabSec.

setGraphBlock()

setGraphSymbol()

setProcessDebugSections()

GraphBlocks

GraphSymbols

Obj

ProcessDebugSections

Sections

SectionStringTab

ShndxTables

SymTabSec


The documentation for this class was generated from the following file: