2004-09-02 00:55:40 +02:00
|
|
|
//===-- llvm/Support/DynamicLinker.h - Portable Dynamic Linker --*- C++ -*-===//
|
2005-04-21 22:48:15 +02:00
|
|
|
//
|
2003-10-20 21:46:57 +02:00
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
2007-12-29 20:59:42 +01:00
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
2005-04-21 22:48:15 +02:00
|
|
|
//
|
2003-10-20 21:46:57 +02:00
|
|
|
//===----------------------------------------------------------------------===//
|
2003-10-10 18:55:42 +02:00
|
|
|
//
|
|
|
|
// Lightweight interface to dynamic library linking and loading, and dynamic
|
|
|
|
// symbol lookup functionality, in whatever form the operating system
|
|
|
|
// provides it.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2004-09-02 00:55:40 +02:00
|
|
|
#ifndef LLVM_SUPPORT_DYNAMICLINKER_H
|
|
|
|
#define LLVM_SUPPORT_DYNAMICLINKER_H
|
2003-10-10 18:55:42 +02:00
|
|
|
|
|
|
|
#include <string>
|
|
|
|
|
2003-11-11 23:41:34 +01:00
|
|
|
namespace llvm {
|
|
|
|
|
2003-10-10 18:55:42 +02:00
|
|
|
/// LinkDynamicObject - Load the named file as a dynamic library
|
|
|
|
/// and link it with the currently running process. Returns false
|
|
|
|
/// on success, true if there is an error (and sets ErrorMessage
|
|
|
|
/// if it is not NULL). Analogous to dlopen().
|
|
|
|
///
|
|
|
|
bool LinkDynamicObject (const char *filename, std::string *ErrorMessage);
|
|
|
|
|
|
|
|
/// GetAddressOfSymbol - Returns the address of the named symbol in
|
|
|
|
/// the currently running process, as reported by the dynamic linker,
|
|
|
|
/// or NULL if the symbol does not exist or some other error has
|
|
|
|
/// occurred.
|
2005-04-21 22:48:15 +02:00
|
|
|
///
|
2003-10-10 18:55:42 +02:00
|
|
|
void *GetAddressOfSymbol (const char *symbolName);
|
|
|
|
void *GetAddressOfSymbol (const std::string &symbolName);
|
|
|
|
|
2003-11-11 23:41:34 +01:00
|
|
|
} // End llvm namespace
|
|
|
|
|
2003-10-10 18:55:42 +02:00
|
|
|
#endif // SUPPORT_DYNAMICLINKER_H
|