This is the mail archive of the libc-alpha@sources.redhat.com 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: dlsym() and RTLD_NEXT resolves wrong symbol


On Sun, 2005-02-13 at 17:51 +0100, Jakub Jelinek wrote:

> > My question is thus:  Why does it not the address of the first symbol that
> > would have been resolved during normal operation?  Or differently, why is
> > my assumption that it would resolve the same symbol as during normal
> > runtime
> > wrong ?
> 
> Because dlsym is a lookup for unversioned symbol.
> Program or shared library compiled/linked against glibc 2.0.x, that doesn't
> contain any versioning whatsoever, is supposed to resolve to the oldest
> symbol version, not to the newest.  And dlsym matches that behaviour.
> 

Ok, that does put a twist on things, thank you.

> The @@ symbols vs. @ symbols matter at link time, so if you are linking
> against new libc.so undefined chown references become chown@GLIBC_2.1.
> If you want chown@@GLIBC_2.1, just call dlvsym (h, "chown", "GLIBC_2.1").
> 

So there is no way to get the latest when there is more then one symbol
without specifying the version (Except maybe a script that extracts that
info) ?  (Asking because there are quite a few functions being wrapped)


Thanks,

-- 
Martin Schlemmer

Attachment: signature.asc
Description: This is a digitally signed message part


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