You are not logged in.

#1 2012-08-27 13:37:07

From: Italy
Registered: 2009-01-13
Posts: 706

List of symbols in a shared library

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


#2 2012-08-27 14:18:51

Registered: 2010-10-04
Posts: 95

Re: List of symbols in a shared library

@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)


Board footer

Powered by FluxBB