#include <dlfcn.h>
typedef struct {
const char |
dladdr is the inverse of dlsym.
If address is successfully located inside a
module, dladdr returns a nonzero
value, otherwise, it returns a 0.
On success, dladdr fills in the fields of
dlip as follows:
the pathname of the module
the base address of the module
the name of the highest addressed symbol whose address precedes the given address
the address of that symbol
Shared objects shall be linked using the -shared option to the linker ld(1). The linker flag -rpath may be used to add a directory to the default search path for shared objects and shared libraries. The linker flag -E or the C compiler flag -rdynamic should be used to cause the application to export its symbols to the shared objects.