This is the mail archive of the
libc-help@sourceware.org
mailing list for the glibc project.
Re: Can dlsym(RTLD_DEFAULT, "xxx") return the virtual address of an external function in an executable file?
- From: Florian Weimer <fweimer at redhat dot com>
- To: <yhb at ruijie dot com dot cn>
- Cc: <libc-help at sourceware dot org>
- Date: Tue, 07 May 2019 10:21:46 +0200
- Subject: Re: Can dlsym(RTLD_DEFAULT, "xxx") return the virtual address of an external function in an executable file?
- References: <80B78A8B8FEE6145A87579E8435D78C3B06B7400@FZEX3.ruijie.com.cn>
* 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