Hi, I need to extract the list of symbols defined in a shared library. My purpose is to load a plugin library at runtime using dlopen, scan the library to find which functions are defined inside and load them using dlsym. I found no dl routine that tells me the content of a library, but something like this must be feasible since this is what nm does.
Can anyone give me some hint? Thanks
@snack If "nm" does what you want to do, then read the source of nm.
If libc doesn't provide a function, though, I doubt that there is a simple way to do this. You likely need to decode the object code yourself to extract the symbols, and identify function symbols (for by far not all symbols mark callable functions).
Last edited by lunar (2012-08-27 14:19:43)