Can dlsym(RTLD_DEFAULT, "xxx") return the virtual address of an external function in an executable file?
Florian Weimer
fweimer@redhat.com
Tue May 7 08:21:00 GMT 2019
* yhb:
> Can dlsym(RTLD_DEFAULT, "xxx") return the virtual address of an
> external function in an executable file?
It depends on whether the symbol is exported, either explicitly or using
a blanket export with -Wl,-E.
> I did an experiment, and found out dlsym(RTLD_DEFAULT, "xxx") returned NULL.
Does the symbol show up in the .dynsym section, as shown by the command
“readelf -sW”? An occurrence in the .symtab section does not count.
Thanks,
Florian
More information about the Libc-help
mailing list