rld Manual
Using the rld Loader Library
RLD Manual—528857-006
2-6
dlsym()
dlsym()
Summary
The dlsym function obtains the address of an external symbol in a DLL.
Syntax for C/C++ Programmers
Parameters
dlopen_handle
specifies a currently valid library handle previously returned by a call to the
dlopen function. The handle must have not been invalidated using dlclose.
symbol_name
specifies a pointer to a null-terminated character string for a symbol represented in
the dynamic symbol table.
The symbol name must be in the form used by the linker and is always case
sensitive. C++ function identifiers are "mangled" to include template, class, and
parameter information. For simple function names, avoid mangled names by using
the optional extern "C" declarator in the C++ compilation of the loadfile exporting
the symbol when the function is not a class member, a template elaboration, or
overloaded.
Return Values
If the dlsym() function detects that a dlopen_handle value is not valid, or if
symbol_name cannot be found within any of the loadfiles associated with a valid
dlopen_handle, the function returns 0 (zero). If the function returns 0, call the
dlerror() or dlresultcode() function immediately to determine the problem.
Otherwise, the address of the symbol is returned.
#include <dlfcn.h>
void *dlsym (
dlHandle dlopen_handle,
const char *symbol_name
);