9b0e749aebacea407de3dc445804239b29fd483c
[oota-llvm.git] / include / Support / DynamicLinker.h
1 //===-- DynamicLinker.h - System-indep. DynamicLinker interface -*- C++ -*-===//
2 //
3 // Lightweight interface to dynamic library linking and loading, and dynamic
4 // symbol lookup functionality, in whatever form the operating system
5 // provides it.
6 //
7 //===----------------------------------------------------------------------===//
8
9 #ifndef SUPPORT_DYNAMICLINKER_H
10 #define SUPPORT_DYNAMICLINKER_H
11
12 #include <string>
13
14 /// LinkDynamicObject - Load the named file as a dynamic library
15 /// and link it with the currently running process. Returns false
16 /// on success, true if there is an error (and sets ErrorMessage
17 /// if it is not NULL). Analogous to dlopen().
18 ///
19 bool LinkDynamicObject (const char *filename, std::string *ErrorMessage);
20
21 /// GetAddressOfSymbol - Returns the address of the named symbol in
22 /// the currently running process, as reported by the dynamic linker,
23 /// or NULL if the symbol does not exist or some other error has
24 /// occurred.
25 /// 
26 void *GetAddressOfSymbol (const char *symbolName);
27 void *GetAddressOfSymbol (const std::string &symbolName);
28
29 #endif // SUPPORT_DYNAMICLINKER_H