This is the mail archive of the libc-help@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Can dlsym(RTLD_DEFAULT, "xxx") return the virtual address of an external function in an executable file?


* 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]