(I know this isn’t a Fedora-specific question, but it’d be appreciated if anyone can shed some light.)
void *h_so=dlopen(“liba.so”, RTLD_GLOBAL|RTLD_NOW);
void *p_symbol=dlsym(so, “symbol”);
- I want to recover the value of h_so from p_symbol, is there a portable (POSIX-compliant if possible) way?
- If I should be using dladdr(), is Dl_info::dli_fbase suitable for subsequent dlsym() calls?
- Or should I be dlopen()ing the same file path again, hoping it will return the exact same value (representing the loaded instance of that so)?