class ELFLinkGraphBuilder

Declaration

template <typename ELFT>
class ELFLinkGraphBuilder : public ELFLinkGraphBuilderBase { /* full declaration omitted */ };

Description

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

Declared at: llvm/lib/ExecutionEngine/JITLink/ELFLinkGraphBuilder.h:57

Inherits from: ELFLinkGraphBuilderBase

Templates

ELFT

Member Variables

protected const llvm::jitlink::ELFLinkGraphBuilder::ELFFile& Obj
protected typename ELFFile::Elf_Shdr_Range Sections
protected const typename ELFFile::Elf_Shdr* SymTabSec = nullptr
protected llvm::StringRef SectionStringTab
protected DenseMap<llvm::jitlink::ELFLinkGraphBuilder:: ELFSectionIndex, llvm::jitlink::Block*> GraphBlocks
protected DenseMap<llvm::jitlink::ELFLinkGraphBuilder:: ELFSymbolIndex, llvm::jitlink::Symbol*> GraphSymbols
protected DenseMap<const typename ELFFile::Elf_Shdr*, ArrayRef<typename ELFFile::Elf_Word>> ShndxTables

Inherited from ELFLinkGraphBuilderBase:

protected G

Method Overview

  • public ELFLinkGraphBuilder<ELFT>(const object::ELFFile<ELFT> & Obj, llvm::Triple TT, llvm::StringRef FileName, LinkGraph::GetEdgeKindNameFunction GetEdgeKindName)
  • public virtual llvm::Error addRelocations()
  • public Expected<std::unique_ptr<LinkGraph>> buildGraph()
  • protected template <typename RelocHandlerFunction>llvm::Error forEachRelocation(const typename ELFT::Shdr & RelSect, RelocHandlerFunction && Func, bool ProcessDebugSections = false)
  • protected template <typename ClassT, typename RelocHandlerMethod>llvm::Error forEachRelocation(const typename ELFT::Shdr & RelSect, ClassT * Instance, RelocHandlerMethod && Method, bool ProcessDebugSections = false)
  • protected llvm::jitlink::Block * getGraphBlock(llvm::jitlink::ELFLinkGraphBuilder::ELFSectionIndex SecIndex)
  • protected llvm::jitlink::Symbol * getGraphSymbol(llvm::jitlink::ELFLinkGraphBuilder::ELFSymbolIndex SymIndex)
  • protected Expected<std::pair<Linkage, Scope>> getSymbolLinkageAndScope(const typename ELFT::Sym & Sym, llvm::StringRef Name)
  • protected llvm::Error graphifySections()
  • protected llvm::Error graphifySymbols()
  • protected bool isRelocatable() const
  • protected llvm::Error prepare()
  • protected void setGraphBlock(llvm::jitlink::ELFLinkGraphBuilder::ELFSectionIndex SecIndex, llvm::jitlink::Block * B)
  • protected void setGraphSymbol(llvm::jitlink::ELFLinkGraphBuilder::ELFSymbolIndex SymIndex, llvm::jitlink::Symbol & Sym)

Inherited from ELFLinkGraphBuilderBase:

Methods

ELFLinkGraphBuilder<ELFT>(
    const object::ELFFile<ELFT>& Obj,
    llvm::Triple TT,
    llvm::StringRef FileName,
    LinkGraph::GetEdgeKindNameFunction
        GetEdgeKindName)

Declared at: llvm/lib/ExecutionEngine/JITLink/ELFLinkGraphBuilder.h:61

Parameters

const object::ELFFile<ELFT>& Obj
llvm::Triple TT
llvm::StringRef FileName
LinkGraph::GetEdgeKindNameFunction GetEdgeKindName

virtual llvm::Error addRelocations()

Description

Call to derived class to handle relocations. These require architecture specific knowledge to map to JITLink edge kinds.

Declared at: llvm/lib/ExecutionEngine/JITLink/ELFLinkGraphBuilder.h:70

Expected<std::unique_ptr<LinkGraph>> buildGraph()

Description

Attempt to construct and return the LinkGraph.

Declared at: llvm/lib/ExecutionEngine/JITLink/ELFLinkGraphBuilder.h:66

template <typename RelocHandlerFunction>
llvm::Error forEachRelocation(
    const typename ELFT::Shdr& RelSect,
    RelocHandlerFunction&& Func,
    bool ProcessDebugSections = false)

Description

Traverse all matching relocation records in the given section. The handler function Func should be callable with this signature: Error(const typename ELFT::Rela & , const typename ELFT::Shdr & , Section & )

Declared at: llvm/lib/ExecutionEngine/JITLink/ELFLinkGraphBuilder.h:117

Templates

RelocHandlerFunction

Parameters

const typename ELFT::Shdr& RelSect
RelocHandlerFunction&& Func
bool ProcessDebugSections = false

template <typename ClassT,
          typename RelocHandlerMethod>
llvm::Error forEachRelocation(
    const typename ELFT::Shdr& RelSect,
    ClassT* Instance,
    RelocHandlerMethod&& Method,
    bool ProcessDebugSections = false)

Description

Traverse all matching relocation records in the given section. Convenience wrapper to allow passing a member function for the handler.

Declared at: llvm/lib/ExecutionEngine/JITLink/ELFLinkGraphBuilder.h:125

Templates

ClassT
RelocHandlerMethod

Parameters

const typename ELFT::Shdr& RelSect
ClassT* Instance
RelocHandlerMethod&& Method
bool ProcessDebugSections = false

llvm::jitlink::Block* getGraphBlock(
    llvm::jitlink::ELFLinkGraphBuilder::
        ELFSectionIndex SecIndex)

Declared at: llvm/lib/ExecutionEngine/JITLink/ELFLinkGraphBuilder.h:85

Parameters

llvm::jitlink::ELFLinkGraphBuilder:: ELFSectionIndex SecIndex

llvm::jitlink::Symbol* getGraphSymbol(
    llvm::jitlink::ELFLinkGraphBuilder::
        ELFSymbolIndex SymIndex)

Declared at: llvm/lib/ExecutionEngine/JITLink/ELFLinkGraphBuilder.h:97

Parameters

llvm::jitlink::ELFLinkGraphBuilder::ELFSymbolIndex SymIndex

Expected<std::pair<Linkage, Scope>>
getSymbolLinkageAndScope(
    const typename ELFT::Sym& Sym,
    llvm::StringRef Name)

Declared at: llvm/lib/ExecutionEngine/JITLink/ELFLinkGraphBuilder.h:105

Parameters

const typename ELFT::Sym& Sym
llvm::StringRef Name

llvm::Error graphifySections()

Declared at: llvm/lib/ExecutionEngine/JITLink/ELFLinkGraphBuilder.h:108

llvm::Error graphifySymbols()

Declared at: llvm/lib/ExecutionEngine/JITLink/ELFLinkGraphBuilder.h:109

bool isRelocatable() const

Declared at: llvm/lib/ExecutionEngine/JITLink/ELFLinkGraphBuilder.h:76

llvm::Error prepare()

Declared at: llvm/lib/ExecutionEngine/JITLink/ELFLinkGraphBuilder.h:107

void setGraphBlock(
    llvm::jitlink::ELFLinkGraphBuilder::
        ELFSectionIndex SecIndex,
    llvm::jitlink::Block* B)

Declared at: llvm/lib/ExecutionEngine/JITLink/ELFLinkGraphBuilder.h:80

Parameters

llvm::jitlink::ELFLinkGraphBuilder:: ELFSectionIndex SecIndex
llvm::jitlink::Block* B

void setGraphSymbol(
    llvm::jitlink::ELFLinkGraphBuilder::
        ELFSymbolIndex SymIndex,
    llvm::jitlink::Symbol& Sym)

Declared at: llvm/lib/ExecutionEngine/JITLink/ELFLinkGraphBuilder.h:92

Parameters

llvm::jitlink::ELFLinkGraphBuilder::ELFSymbolIndex SymIndex
llvm::jitlink::Symbol& Sym