Memory manager and symbol resolver for RuntimeDyld and MCJIT clients.

Synopsis

Declared in <llvm/ExecutionEngine/RTDyldMemoryManager.h>

class RTDyldMemoryManager
    : public MCJITMemoryManager
    , public LegacyJITSymbolResolver

Description

RuntimeDyld clients often want to handle the memory management of what gets placed where. For JIT clients, this is the subset of JITMemoryManager required for dynamic loading of binaries.

FIXME: As the RuntimeDyld fills out, additional routines will be needed for the varying types of objects to be allocated.

Base Classes

Name

Description

MCJITMemoryManager

Memory manager interface for MCJIT with ExecutionEngine‐aware callbacks.

LegacyJITSymbolResolver

Legacy symbol resolution interface.

Types

Name

Description

TLSSection

An allocated TLS section

Type Aliases

Name

Description

LookupResult

Map from symbol name to fully resolved evaluated symbol.

LookupSet

Set of symbol names to look up together.

OnResolvedFunction

Callback invoked with the result of an asynchronous symbol lookup.

Member Functions

Name

Description

RTDyldMemoryManager [constructor]

Constructors

~RTDyldMemoryManager [destructor] [virtual]

Destroy the RTDyld memory manager.

operator= [deleted]

Deleted copy assignment operator.

allocateCodeSection [virtual]

Allocate a memory block suitable for executable code.

allocateDataSection [virtual]

Allocate a memory block suitable for data.

allocateTLSSection [virtual]

Allocate a memory block to be used for thread‐local storage (TLS).

allowStubAllocation [virtual]

Return whether stub space may be allocated for this memory manager.

allowsZeroSymbols [virtual]

Specify if this resolver can return valid symbols with zero value.

deregisterEHFrames [virtual]

Deregister previously registered EH frames with the runtime.

finalizeMemory [virtual]

Apply section permissions and cache coherency after loading completes.

findSymbol [virtual]

This method returns a RuntimeDyld::SymbolInfo for the specified function or variable. It is used to resolve symbols during module linking.

findSymbolInLogicalDylib [virtual]

Default to treating all modules as separate.

getPointerToNamedFunction [virtual]

This method returns the address of the specified function. As such it is only useful for resolving library symbols, not code generated symbols.

getResponsibilitySet [virtual]

Performs flags lookup by calling findSymbolInLogicalDylib and returning the flags value for that symbol.

getSymbolAddress [virtual]

Legacy symbol lookup ‐ DEPRECATED! Please override findSymbol instead.

getSymbolAddressInLogicalDylib [virtual]

Legacy symbol lookup ‐‐ DEPRECATED! Please override findSymbolInLogicalDylib instead.

lookup [virtual]

Performs lookup by, for each symbol, first calling findSymbolInLogicalDylib and if that fails calling findSymbol.

needsToReserveAllocationSpace [virtual]

Override to return true to enable the reserveAllocationSpace callback.

notifyObjectLoaded

notifyObjectLoaded overloads

registerEHFrames [virtual]

Register the EH frames with the runtime so that C++ exceptions work.

reserveAllocationSpace [virtual]

Inform the memory manager of total memory needed for all sections.

Static Member Functions

Name

Description

deregisterEHFramesInProcess

Deregister EH frames in the current process.

getSymbolAddressInProcess

This method returns the address of the specified function or variable in the current process.

registerEHFramesInProcess

Register EH frames in the current process.

Using Declarations

Name

Description

notifyObjectLoaded

Bring in RuntimeDyld::MemoryManager::notifyObjectLoaded.

Protected Types

Name

Description

EHFrame

An EH frame section recorded for later registration or deregistration.

Protected Type Aliases

Name

Description

EHFrameInfos

List of EH frame sections managed by this memory manager.

Protected Data Members

Name

Description

EHFrames

EH frame sections registered with this memory manager.

Non-Member Functions

Name

Description

unwrap

C API conversion helpers for RTDyldMemoryManager / LLVMMCJITMemoryManagerRef, including unwrap and wrap.

wrap

C API conversion helpers for RTDyldMemoryManager / LLVMMCJITMemoryManagerRef, including unwrap and wrap.

Derived Classes

Name

Description

SectionMemoryManager

Simple section‐based memory manager for RuntimeDyld and MCJIT.

Created with MrDocs