LLVM  4.0.0
Classes | Public Member Functions | Protected Member Functions | Friends | List of all members
llvm::RuntimeDyld Class Reference

#include <RuntimeDyld.h>

Classes

class  LoadedObjectInfo
 Information about the loaded object. More...
 
struct  LoadedObjectInfoHelper
 
class  MemoryManager
 Memory Management. More...
 

Public Member Functions

 RuntimeDyld (MemoryManager &MemMgr, JITSymbolResolver &Resolver)
 Construct a RuntimeDyld instance. More...
 
 RuntimeDyld (const RuntimeDyld &)=delete
 
void operator= (const RuntimeDyld &)=delete
 
 ~RuntimeDyld ()
 
std::unique_ptr< LoadedObjectInfoloadObject (const object::ObjectFile &O)
 Add the referenced object file to the list of objects to be loaded and relocated. More...
 
void * getSymbolLocalAddress (StringRef Name) const
 Get the address of our local copy of the symbol. More...
 
JITEvaluatedSymbol getSymbol (StringRef Name) const
 Get the target address and flags for the named symbol. More...
 
void resolveRelocations ()
 Resolve the relocations for all symbols we currently know about. More...
 
void mapSectionAddress (const void *LocalAddress, uint64_t TargetAddress)
 Map a section to its target address space value. More...
 
void registerEHFrames ()
 Register any EH frame sections that have been loaded but not previously registered with the memory manager. More...
 
void deregisterEHFrames ()
 
bool hasError ()
 
StringRef getErrorString ()
 
void setProcessAllSections (bool ProcessAllSections)
 By default, only sections that are "required for execution" are passed to the RTDyldMemoryManager, and other sections are discarded. More...
 
void finalizeWithMemoryManagerLocking ()
 Perform all actions needed to make the code owned by this RuntimeDyld instance executable: More...
 

Protected Member Functions

void reassignSectionAddress (unsigned SectionID, uint64_t Addr)
 

Friends

class RuntimeDyldCheckerImpl
 

Detailed Description

Definition at line 57 of file RuntimeDyld.h.

Constructor & Destructor Documentation

llvm::RuntimeDyld::RuntimeDyld ( RuntimeDyld::MemoryManager MemMgr,
JITSymbolResolver Resolver 
)

Construct a RuntimeDyld instance.

Definition at line 998 of file RuntimeDyld.cpp.

llvm::RuntimeDyld::RuntimeDyld ( const RuntimeDyld )
delete
llvm::RuntimeDyld::~RuntimeDyld ( )

Definition at line 1012 of file RuntimeDyld.cpp.

Member Function Documentation

void llvm::RuntimeDyld::deregisterEHFrames ( )

Definition at line 1118 of file RuntimeDyld.cpp.

Referenced by llvm::MCJIT::~MCJIT().

void llvm::RuntimeDyld::finalizeWithMemoryManagerLocking ( )

Perform all actions needed to make the code owned by this RuntimeDyld instance executable:

1) Apply relocations. 2) Register EH frames. 3) Update memory permissions*.

  • Finalization is potentially recursive**, and the 3rd step will only be applied by the outermost call to finalize. This allows different RuntimeDyld instances to share a memory manager without the innermost finalization locking the memory and causing relocation fixup errors in outer instances.

** Recursive finalization occurs when one RuntimeDyld instances needs the address of a symbol owned by some other instance in order to apply relocations.

Definition at line 1102 of file RuntimeDyld.cpp.

References llvm::RuntimeDyld::MemoryManager::finalizeMemory(), registerEHFrames(), and resolveRelocations().

StringRef llvm::RuntimeDyld::getErrorString ( )
JITEvaluatedSymbol llvm::RuntimeDyld::getSymbol ( StringRef  Name) const

Get the target address and flags for the named symbol.

This address is the one used for relocation.

Definition at line 1081 of file RuntimeDyld.cpp.

Referenced by llvm::MCJIT::findExistingSymbol(), and llvm::MCJIT::getPointerToFunction().

void * llvm::RuntimeDyld::getSymbolLocalAddress ( StringRef  Name) const

Get the address of our local copy of the symbol.

This may or may not be the address used for relocation (clients can copy the data around and resolve relocatons based on where they put it).

Definition at line 1075 of file RuntimeDyld.cpp.

bool llvm::RuntimeDyld::hasError ( )
std::unique_ptr< RuntimeDyld::LoadedObjectInfo > llvm::RuntimeDyld::loadObject ( const object::ObjectFile O)
void llvm::RuntimeDyld::mapSectionAddress ( const void *  LocalAddress,
uint64_t  TargetAddress 
)

Map a section to its target address space value.

Map the address of a JIT section as returned from the memory manager to the address in the target process as the running code will see it. This is the address which will be used for relocation resolution.

Definition at line 1093 of file RuntimeDyld.cpp.

Referenced by llvm::MCJIT::mapSectionAddress(), and llvm::orc::remote::OrcRemoteTargetClient< ChannelT >::RCMemoryManager::notifyObjectLoaded().

void llvm::RuntimeDyld::operator= ( const RuntimeDyld )
delete
void llvm::RuntimeDyld::reassignSectionAddress ( unsigned  SectionID,
uint64_t  Addr 
)
protected

Definition at line 1089 of file RuntimeDyld.cpp.

void llvm::RuntimeDyld::registerEHFrames ( )

Register any EH frame sections that have been loaded but not previously registered with the memory manager.

Note, RuntimeDyld is responsible for identifying the EH frame and calling the memory manager with the EH frame section data. However, the memory manager itself will handle the actual target-specific EH frame registration.

Definition at line 1113 of file RuntimeDyld.cpp.

Referenced by llvm::MCJIT::finalizeLoadedModules(), and finalizeWithMemoryManagerLocking().

void llvm::RuntimeDyld::resolveRelocations ( )

Resolve the relocations for all symbols we currently know about.

Definition at line 1087 of file RuntimeDyld.cpp.

Referenced by llvm::MCJIT::finalizeLoadedModules(), and finalizeWithMemoryManagerLocking().

void llvm::RuntimeDyld::setProcessAllSections ( bool  ProcessAllSections)
inline

By default, only sections that are "required for execution" are passed to the RTDyldMemoryManager, and other sections are discarded.

Passing 'true' to this method will cause RuntimeDyld to pass all sections to its memory manager regardless of whether they are "required to execute" in the usual sense. This is useful for inspecting metadata sections that may not contain relocations, E.g. Debug info, stackmaps.

Must be called before the first object file is loaded.

Definition at line 235 of file RuntimeDyld.h.

References assert().

Referenced by llvm::MCJIT::setProcessAllSections().

Friends And Related Function Documentation

friend class RuntimeDyldCheckerImpl
friend

Definition at line 58 of file RuntimeDyld.h.


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