public inbox for libc-help@sourceware.org
 help / color / mirror / Atom feed
* Can dlsym(RTLD_DEFAULT, "xxx") return the virtual address of an external function in an executable file?
@ 2019-05-07  4:01 yhb
  2019-05-07  8:21 ` Florian Weimer
  0 siblings, 1 reply; 2+ messages in thread
From: yhb @ 2019-05-07  4:01 UTC (permalink / raw)
  To: libc-help

Can dlsym(RTLD_DEFAULT, "xxx") return the virtual address of an external function in an executable file?
I did an experiment, and found out dlsym(RTLD_DEFAULT, "xxx") returned NULL.


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Can dlsym(RTLD_DEFAULT, "xxx") return the virtual address of an external function in an executable file?
  2019-05-07  4:01 Can dlsym(RTLD_DEFAULT, "xxx") return the virtual address of an external function in an executable file? yhb
@ 2019-05-07  8:21 ` Florian Weimer
  0 siblings, 0 replies; 2+ messages in thread
From: Florian Weimer @ 2019-05-07  8:21 UTC (permalink / raw)
  To: yhb; +Cc: libc-help

* 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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-05-07  8:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-07  4:01 Can dlsym(RTLD_DEFAULT, "xxx") return the virtual address of an external function in an executable file? yhb
2019-05-07  8:21 ` Florian Weimer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).