How to get function address by name?
问题 I'd like to get function's address by name. For example, currently I am using dlsym : unsigned long get_func_addr(const char *func_name) { return (unsigned long)dlsym(NULL, func_name); } However, dlsym only works for extern function. It won't work for static function. I know there could multiple static functions with same name in different files. But I need to at least get one static function's address with the name. Sometime static function will be inlned. But it's OK if C file is compiled