Get functions names in a shared library programmatically
问题 Can I get list of all functions names from a shared library (Linux only) programmatically when I am using dl_open() ? I want something like this: std::vector<std::string> list_all_functions(void *dl) { //... what can I do here? } int main() { void * dl = dl_open("./mylib.so", RTLD_NOW); auto functions = list_all_functions(dl); //... dl_close(dl); return 0; } Example library (mylib.so) Header (.h): extern "C" { int sum (int a, int b); } Source (.c): int sum (int a, int b) { return a + b; }