Assume main.c uses symbols from shared libs and local functions declared in main.c.
Is there a nice and elegant way to print a list of all
On dynamic-linked ELF-based systems, you may have a function dl_iterate_phdr available. If so, it can be used to gather information on each loaded shared library file, and the information you get is sufficient to examine the symbol tables. The process is basically:
dl_phdr_info structure passed back to you.PT_DYNAMIC program header to find the _DYNAMIC table for the module.DT_SYMTAB, DT_STRTAB, and DT_HASH entries of _DYNAMIC to find the list of symbols. DT_HASH is only needed to get the length of the symbol table, since it doesn't seem to be stored anywhere else.The types you need should all be in and .