|
LLVM
4.0.0
|
#include <RTDyldMemoryManager.h>
Public Member Functions | |
| RTDyldMemoryManager ()=default | |
| RTDyldMemoryManager (const RTDyldMemoryManager &)=delete | |
| void | operator= (const RTDyldMemoryManager &)=delete |
| ~RTDyldMemoryManager () override | |
| void | registerEHFrames (uint8_t *Addr, uint64_t LoadAddr, size_t Size) override |
| Register the EH frames with the runtime so that c++ exceptions work. More... | |
| void | deregisterEHFrames (uint8_t *Addr, uint64_t LoadAddr, size_t Size) override |
| virtual uint64_t | getSymbolAddress (const std::string &Name) |
| Legacy symbol lookup - DEPRECATED! Please override findSymbol instead. More... | |
| JITSymbol | findSymbol (const std::string &Name) override |
| This method returns a RuntimeDyld::SymbolInfo for the specified function or variable. More... | |
| virtual uint64_t | getSymbolAddressInLogicalDylib (const std::string &Name) |
| Legacy symbol lookup – DEPRECATED! Please override findSymbolInLogicalDylib instead. More... | |
| JITSymbol | findSymbolInLogicalDylib (const std::string &Name) override |
| Default to treating all modules as separate. More... | |
| virtual void * | getPointerToNamedFunction (const std::string &Name, bool AbortOnFailure=true) |
| This method returns the address of the specified function. More... | |
Public Member Functions inherited from llvm::MCJITMemoryManager | |
| virtual void | notifyObjectLoaded (ExecutionEngine *EE, const object::ObjectFile &) |
| This method is called after an object has been loaded into memory but before relocations are applied to the loaded sections. More... | |
Public Member Functions inherited from llvm::RuntimeDyld::MemoryManager | |
| MemoryManager ()=default | |
| virtual | ~MemoryManager ()=default |
| virtual uint8_t * | allocateCodeSection (uintptr_t Size, unsigned Alignment, unsigned SectionID, StringRef SectionName)=0 |
| Allocate a memory block of (at least) the given size suitable for executable code. More... | |
| virtual uint8_t * | allocateDataSection (uintptr_t Size, unsigned Alignment, unsigned SectionID, StringRef SectionName, bool IsReadOnly)=0 |
| Allocate a memory block of (at least) the given size suitable for data. More... | |
| virtual void | reserveAllocationSpace (uintptr_t CodeSize, uint32_t CodeAlign, uintptr_t RODataSize, uint32_t RODataAlign, uintptr_t RWDataSize, uint32_t RWDataAlign) |
Inform the memory manager about the total amount of memory required to allocate all sections to be loaded: CodeSize - the total size of all code sections DataSizeRO - the total size of all read-only data sections DataSizeRW - the total size of all read-write data sections. More... | |
| virtual bool | needsToReserveAllocationSpace () |
| Override to return true to enable the reserveAllocationSpace callback. More... | |
| virtual bool | finalizeMemory (std::string *ErrMsg=nullptr)=0 |
| This method is called when object loading is complete and section page permissions can be applied. More... | |
| virtual void | notifyObjectLoaded (RuntimeDyld &RTDyld, const object::ObjectFile &Obj) |
| This method is called after an object has been loaded into memory but before relocations are applied to the loaded sections. More... | |
Public Member Functions inherited from llvm::JITSymbolResolver | |
| virtual | ~JITSymbolResolver ()=default |
Static Public Member Functions | |
| static void | registerEHFramesInProcess (uint8_t *Addr, size_t Size) |
| Register EH frames in the current process. More... | |
| static void | deregisterEHFramesInProcess (uint8_t *Addr, size_t Size) |
| Deregister EH frames in the current proces. More... | |
| static uint64_t | getSymbolAddressInProcess (const std::string &Name) |
| This method returns the address of the specified function or variable in the current process. More... | |
Definition at line 58 of file RTDyldMemoryManager.h.
|
default |
|
delete |
|
override |
Definition at line 33 of file RTDyldMemoryManager.cpp.
|
inlineoverridevirtual |
Implements llvm::RuntimeDyld::MemoryManager.
Definition at line 76 of file RTDyldMemoryManager.h.
References deregisterEHFramesInProcess().
|
static |
Deregister EH frames in the current proces.
Definition at line 130 of file RTDyldMemoryManager.cpp.
References llvm::__deregister_frame().
Referenced by deregisterEHFrames().
This method returns a RuntimeDyld::SymbolInfo for the specified function or variable.
It is used to resolve symbols during module linking.
By default this falls back on the legacy lookup method: 'getSymbolAddress'. The address returned by getSymbolAddress is treated as a strong, exported symbol, consistent with historical treatment by RuntimeDyld.
Clients writing custom RTDyldMemoryManagers are encouraged to override this method and return a SymbolInfo with the flags set correctly. This is necessary for RuntimeDyld to correctly handle weak and non-exported symbols.
Implements llvm::JITSymbolResolver.
Definition at line 103 of file RTDyldMemoryManager.h.
References llvm::JITSymbolFlags::Exported, and getSymbolAddress().
|
inlineoverridevirtual |
Default to treating all modules as separate.
By default this falls back on the legacy lookup method: 'getSymbolAddressInLogicalDylib'. The address returned by getSymbolAddressInLogicalDylib is treated as a strong, exported symbol, consistent with historical treatment by RuntimeDyld.
Clients writing custom RTDyldMemoryManagers are encouraged to override this method and return a SymbolInfo with the flags set correctly. This is necessary for RuntimeDyld to correctly handle weak and non-exported symbols.
Implements llvm::JITSymbolResolver.
Definition at line 126 of file RTDyldMemoryManager.h.
References llvm::JITSymbolFlags::Exported, and getSymbolAddressInLogicalDylib().
|
virtual |
This method returns the address of the specified function.
As such it is only useful for resolving library symbols, not code generated symbols.
If AbortOnFailure is false and no function with the given name is found, this function returns a null pointer. Otherwise, it prints a message to stderr and aborts.
This function is deprecated for memory managers to be used with MCJIT or RuntimeDyld. Use getSymbolAddress instead.
Definition at line 278 of file RTDyldMemoryManager.cpp.
References getSymbolAddress(), and llvm::report_fatal_error().
|
inlinevirtual |
Legacy symbol lookup - DEPRECATED! Please override findSymbol instead.
This method returns the address of the specified function or variable. It is used to resolve symbols during module linking.
Definition at line 88 of file RTDyldMemoryManager.h.
References getSymbolAddressInProcess().
Referenced by findSymbol(), and getPointerToNamedFunction().
|
inlinevirtual |
Legacy symbol lookup – DEPRECATED! Please override findSymbolInLogicalDylib instead.
Default to treating all modules as separate.
Definition at line 111 of file RTDyldMemoryManager.h.
Referenced by findSymbolInLogicalDylib().
|
static |
This method returns the address of the specified function or variable in the current process.
Definition at line 217 of file RTDyldMemoryManager.cpp.
References llvm::jit_noop(), and llvm::sys::DynamicLibrary::SearchForAddressOfSymbol().
Referenced by getSymbolAddress().
|
delete |
|
inlineoverridevirtual |
Register the EH frames with the runtime so that c++ exceptions work.
Addr parameter provides the local address of the EH frame section data, while LoadAddr provides the address of the data in the target address space. If the section has not been remapped (which will usually be the case for local execution) these two values will be the same.
Implements llvm::RuntimeDyld::MemoryManager.
Definition at line 72 of file RTDyldMemoryManager.h.
References registerEHFramesInProcess().
|
static |
Register EH frames in the current process.
Definition at line 120 of file RTDyldMemoryManager.cpp.
References llvm::__register_frame().
Referenced by registerEHFrames().
1.8.6