LLVM API Documentation

Public Member Functions | Protected Member Functions | Friends
llvm::RuntimeDyld Class Reference

#include <RuntimeDyld.h>

List of all members.

Public Member Functions

 RuntimeDyld (RTDyldMemoryManager *)
 ~RuntimeDyld ()
std::unique_ptr< ObjectImageloadObject (std::unique_ptr< ObjectBuffer > InputBuffer)
std::unique_ptr< ObjectImageloadObject (std::unique_ptr< object::ObjectFile > InputObject)
void * getSymbolAddress (StringRef Name) const
uint64_t getSymbolLoadAddress (StringRef Name) const
void resolveRelocations ()
 Resolve the relocations for all symbols we currently know about.
void mapSectionAddress (const void *LocalAddress, uint64_t TargetAddress)
void registerEHFrames ()
void deregisterEHFrames ()
bool hasError ()
StringRef getErrorString ()
void setProcessAllSections (bool ProcessAllSections)

Protected Member Functions

void reassignSectionAddress (unsigned SectionID, uint64_t Addr)

Friends

class RuntimeDyldCheckerImpl

Detailed Description

Definition at line 32 of file RuntimeDyld.h.


Constructor & Destructor Documentation

llvm::RuntimeDyld::RuntimeDyld ( RTDyldMemoryManager mm)

Definition at line 766 of file RuntimeDyld.cpp.

Definition at line 779 of file RuntimeDyld.cpp.


Member Function Documentation

Definition at line 904 of file RuntimeDyld.cpp.

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

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 872 of file RuntimeDyld.cpp.

Get the address of the target copy of the symbol. This is the address used for relocation.

Definition at line 878 of file RuntimeDyld.cpp.

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

Definition at line 895 of file RuntimeDyld.cpp.

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

std::unique_ptr< ObjectImage > llvm::RuntimeDyld::loadObject ( std::unique_ptr< ObjectBuffer InputBuffer)

Prepare the object contained in the input buffer for execution. Ownership of the input buffer is transferred to the ObjectImage instance returned from this function if successful. In the case of load failure, the input buffer will be deleted.

Definition at line 825 of file RuntimeDyld.cpp.

References llvm::sys::fs::file_magic::archive, llvm::sys::fs::file_magic::bitcode, llvm::sys::fs::file_magic::coff_import_library, llvm::sys::fs::file_magic::coff_object, llvm::RuntimeDyldMachO::createObjectImage(), llvm::RuntimeDyldELF::createObjectImage(), llvm::createRuntimeDyldELF(), llvm::createRuntimeDyldMachO(), llvm::sys::fs::file_magic::elf_core, llvm::sys::fs::file_magic::elf_executable, llvm::sys::fs::file_magic::elf_relocatable, llvm::sys::fs::file_magic::elf_shared_object, llvm::sys::fs::identify_magic(), llvm::sys::fs::file_magic::macho_bundle, llvm::sys::fs::file_magic::macho_core, llvm::sys::fs::file_magic::macho_dsym_companion, llvm::sys::fs::file_magic::macho_dynamic_linker, llvm::sys::fs::file_magic::macho_dynamically_linked_shared_lib, llvm::sys::fs::file_magic::macho_dynamically_linked_shared_lib_stub, llvm::sys::fs::file_magic::macho_executable, llvm::sys::fs::file_magic::macho_fixed_virtual_memory_shared_lib, llvm::sys::fs::file_magic::macho_object, llvm::sys::fs::file_magic::macho_preload_executable, llvm::sys::fs::file_magic::macho_universal_binary, llvm::sys::fs::file_magic::pecoff_executable, llvm::report_fatal_error(), llvm::sys::fs::file_magic::unknown, and llvm::sys::fs::file_magic::windows_resource.

Referenced by llvm::MCJIT::addObjectFile(), and llvm::MCJIT::generateCodeForModule().

std::unique_ptr<ObjectImage> llvm::RuntimeDyld::loadObject ( std::unique_ptr< object::ObjectFile InputObject)

Prepare the referenced object file for execution. Ownership of the input object is transferred to the ObjectImage instance returned from this function if successful. In the case of load failure, the input object will be deleted.

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 890 of file RuntimeDyld.cpp.

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

void llvm::RuntimeDyld::reassignSectionAddress ( unsigned  SectionID,
uint64_t  Addr 
) [protected]

Definition at line 886 of file RuntimeDyld.cpp.

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 899 of file RuntimeDyld.cpp.

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

Resolve the relocations for all symbols we currently know about.

Definition at line 884 of file RuntimeDyld.cpp.

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

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 104 of file RuntimeDyld.h.

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


Friends And Related Function Documentation

friend class RuntimeDyldCheckerImpl [friend]

Definition at line 33 of file RuntimeDyld.h.


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