Returning a shared library symbol table
Posted
by joemoe
on Stack Overflow
See other posts from Stack Overflow
or by joemoe
Published on 2010-04-22T20:38:09Z
Indexed on
2010/04/22
20:43 UTC
Read the original article
Hit count: 293
For instance:
void* sdl_library = dlopen("libSDL.so", RTLD_LAZY);
void* initializer = dlsym(sdl_library,"SDL_Init");
Assuming no errors, initializer will point to the function SD_Init in the shared library libSDK.so.
However this requires knowing the symbol "SDL_Init" exists.
Is it possibly to query a library for all its symbols? Eg, in this case it would return SDL_Init, the function pointer, and any other symbols exported by libSDL.so.
© Stack Overflow or respective owner