libtool
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: dlopening the C runtime library


From: Sam Varshavchik
Subject: Re: dlopening the C runtime library
Date: Sun, 06 Dec 2009 10:05:57 -0500

Simon Richter writes:

Hi,

On Sun, Dec 06, 2009 at 08:52:52AM -0500, Sam Varshavchik wrote:

My wrapper needs to find the real socket() and connect(). I haven't
checked this yet, but I suspect that since my shared library was
loaded ahead of libc, after lt_dlopen(NULL), using lt_dlsym() will
simply return a pointer to my own symbols, rather than libc's.

Right. dlsym(RTLD_NEXT, "open") will give you the one that you shadowed;
this might not be the real symbol yet as there may be other wrappers
loaded, and it might not be the one from libc as applications are
allowed to provide their own definitions of symbols and have them take
precedence.

That looks like what I'm looking for. I don't seem to find an analogous flag for lt_dlsym, in libtool's documentation, so I'll go with native dlsym, then.


Attachment: pgp248dXsoNpY.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]