diff options
author | Jim Grosbach <grosbach@apple.com> | 2011-03-21 22:15:52 +0000 |
---|---|---|
committer | Jim Grosbach <grosbach@apple.com> | 2011-03-21 22:15:52 +0000 |
commit | 6e56331ed99e5b96de940dfdc53e438eef521a2e (patch) | |
tree | 119dac47b658037637552736c9b634eaa2dcb3ba /include/llvm/ExecutionEngine/RuntimeDyld.h | |
parent | b99462117ebd4be41788346246d7935fc90a11ee (diff) |
Library-ize the dyld components of llvm-rtdyld.
Move the dynamic linking functionality of the llvm-rtdyld program into an
ExecutionEngine support library. Update llvm-rtdyld to just load an object
file into memory, use the library to process it, then run the _main()
function, if one is found.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128031 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/ExecutionEngine/RuntimeDyld.h')
-rw-r--r-- | include/llvm/ExecutionEngine/RuntimeDyld.h | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/include/llvm/ExecutionEngine/RuntimeDyld.h b/include/llvm/ExecutionEngine/RuntimeDyld.h new file mode 100644 index 0000000000..629dccff23 --- /dev/null +++ b/include/llvm/ExecutionEngine/RuntimeDyld.h @@ -0,0 +1,45 @@ +//===-- RuntimeDyld.h - Run-time dynamic linker for MC-JIT ------*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// Interface for the runtime dynamic linker facilities of the MC-JIT. +// +//===----------------------------------------------------------------------===// + +#ifndef LLVM_RUNTIME_DYLD_H +#define LLVM_RUNTIME_DYLD_H + +#include "llvm/ADT/StringRef.h" +#include "llvm/Support/Memory.h" + +namespace llvm { + +class RuntimeDyldImpl; +class MemoryBuffer; + +class RuntimeDyld { + RuntimeDyld(const RuntimeDyld &); // DO NOT IMPLEMENT + void operator=(const RuntimeDyld &); // DO NOT IMPLEMENT + + // RuntimeDyldImpl is the actual class. RuntimeDyld is just the public + // interface. + RuntimeDyldImpl *Dyld; +public: + RuntimeDyld(); + ~RuntimeDyld(); + + bool loadObject(MemoryBuffer *InputBuffer); + void *getSymbolAddress(StringRef Name); + // FIXME: Should be parameterized to get the memory block associated with + // a particular loaded object. + sys::MemoryBlock getMemoryBlock(); +}; + +} // end namespace llvm + +#endif |