summaryrefslogtreecommitdiffstats
path: root/llvm/include
diff options
context:
space:
mode:
authorJim Grosbach <grosbach@apple.com>2012-01-16 23:50:55 +0000
committerJim Grosbach <grosbach@apple.com>2012-01-16 23:50:55 +0000
commit0ddb3a4963996bbb6bace4c2af71d9e3094d7c16 (patch)
tree6571c95881461014160105a93f1e5b27414d2e82 /llvm/include
parent9df6cc8f4f9005012ead32fa0be0e8a9c8089508 (diff)
downloadbcm5719-llvm-0ddb3a4963996bbb6bace4c2af71d9e3094d7c16.tar.gz
bcm5719-llvm-0ddb3a4963996bbb6bace4c2af71d9e3094d7c16.zip
ExecutionEngine interface to re-map addresses for engines that support it.
llvm-svn: 148264
Diffstat (limited to 'llvm/include')
-rw-r--r--llvm/include/llvm/ExecutionEngine/ExecutionEngine.h8
-rw-r--r--llvm/include/llvm/ExecutionEngine/RuntimeDyld.h14
2 files changed, 19 insertions, 3 deletions
diff --git a/llvm/include/llvm/ExecutionEngine/ExecutionEngine.h b/llvm/include/llvm/ExecutionEngine/ExecutionEngine.h
index 9f77ebeb9e6..62adb5546cc 100644
--- a/llvm/include/llvm/ExecutionEngine/ExecutionEngine.h
+++ b/llvm/include/llvm/ExecutionEngine/ExecutionEngine.h
@@ -239,6 +239,14 @@ public:
virtual void *getPointerToNamedFunction(const std::string &Name,
bool AbortOnFailure = true) = 0;
+ /// mapSectionAddress - 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.
+ virtual void mapSectionAddress(void *LocalAddress, uint64_t TargetAddress) {
+ assert(0 && "Re-mapping of section addresses not supported with this EE!");
+ }
+
/// runStaticConstructorsDestructors - This method is used to execute all of
/// the static constructors or destructors for a program.
///
diff --git a/llvm/include/llvm/ExecutionEngine/RuntimeDyld.h b/llvm/include/llvm/ExecutionEngine/RuntimeDyld.h
index d937ab49f4e..8ad316bc3f9 100644
--- a/llvm/include/llvm/ExecutionEngine/RuntimeDyld.h
+++ b/llvm/include/llvm/ExecutionEngine/RuntimeDyld.h
@@ -64,6 +64,10 @@ class RuntimeDyld {
// interface.
RuntimeDyldImpl *Dyld;
RTDyldMemoryManager *MM;
+protected:
+ // Change the address associated with a section when resolving relocations.
+ // Any relocations already associated with the symbol will be re-resolved.
+ void reassignSectionAddress(unsigned SectionID, uint64_t Addr);
public:
RuntimeDyld(RTDyldMemoryManager*);
~RuntimeDyld();
@@ -75,9 +79,13 @@ public:
void *getSymbolAddress(StringRef Name);
// Resolve the relocations for all symbols we currently know about.
void resolveRelocations();
- // Change the address associated with a section when resolving relocations.
- // Any relocations already associated with the symbol will be re-resolved.
- void reassignSectionAddress(unsigned SectionID, uint64_t Addr);
+
+ /// mapSectionAddress - 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.
+ void mapSectionAddress(void *LocalAddress, uint64_t TargetAddress);
+
StringRef getErrorString();
};
OpenPOWER on IntegriCloud