Re: Idea for LD_PRELOAD (retraction)

Jamie Lokier (lkd@tantalophile.demon.co.uk)
Mon, 5 Jul 1999 17:31:23 +0200


Adam J. Richter wrote:
> > The problem with LD_PRELOAD is that it can only replace function
> >definitions, rather than "wrap" additional work around functions,
>
> I would like to thank Artur Skawina for pointing out that
> this can be done with dlsym(RTLD_NEXT, "symbol") and even include
> a sample program, and also Ulrich Drepper for saying that there
> was a way to do it with dlsym.

Aye, but that's not as _fast_ as dynamic-link-time wrappers :-)
(Pointer lookups all over the place).

It's a bit icky if you want to use the looked-up symbol from a C++
static constructor too.

-- Jamie

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/