This is the mail archive of the
libc-help@sourceware.org
mailing list for the glibc project.
operation and limitations of dladdr()?
- From: Britton Kerin <britton dot kerin at gmail dot com>
- To: libc-help at sourceware dot org
- Date: Tue, 29 Mar 2016 12:27:44 -0800
- Subject: operation and limitations of dladdr()?
- Authentication-results: sourceware.org; auth=none
I'm trying to learn as much as possible about dladdr() before
unleashing a small lib that uses it on the world. Two questions:
Does the fact that dladdr() reports the symbol with the nearest
address lower than the given
one mean that that might be the correct function? In other words why this:
const char *dli_sname; /* Name of nearest symbol with address
lower than addr */
void *dli_saddr; /* Exact address of symbol name in dli_sname */
I would have thought that the address of the function about to be
executed would have to match the library address exactly, but maybe
not. What does it mean if they don't match? My current
strategy is to be cowardly and not tell the user that the correct
function has been found unless
I get an exact match.
Thanks,
Britton