Re: dlopen(), ld.so, and library wrappers

2002-04-02 Thread Terry Lambert
"E.B. Dreger" wrote: > So you're saying that: > > 1) Program foo contains function called getpid() > 2) Program foo links with libc > 3) foo.getpid uses dlsym(RTLD_NEXT, "getpid") to call libc.getpid > 4) Shared object bar, loaded by foo, will receive a pointer to >foo.getpid instead of libc.

Re: dlopen(), ld.so, and library wrappers

2002-04-02 Thread E.B. Dreger
> Date: Tue, 2 Apr 2002 11:05:52 -0800 > From: Alfred Perlstein <[EMAIL PROTECTED]> > From the dlopen manpage: [ snip ] Works great, less coding. Looks like I just misunderstood the manpage and/or the workings of the dynamic linker. Time for me to have some fun. And, no, I'm not using wrapp

Re: dlopen(), ld.so, and library wrappers

2002-04-02 Thread E.B. Dreger
> Date: Tue, 2 Apr 2002 11:05:52 -0800 > From: Alfred Perlstein <[EMAIL PROTECTED]> > From the dlopen manpage: I reread that right before initial post. > If dlsym() is called with the special handle RTLD_NEXT, then the search > for the symbol is limited to the shared objects which w

Re: dlopen(), ld.so, and library wrappers

2002-04-02 Thread Alfred Perlstein
* E.B. Dreger <[EMAIL PROTECTED]> [020402 10:29] wrote: > Greetings all, > > > I wish to accomplish the following: > > 1. Program "foo" loads shared object "bar" using dlopen() and >dlsym() > > 2. "bar" needs certain symbols resolved, which "foo" intercepts. > > For example, "foo" might w

dlopen(), ld.so, and library wrappers

2002-04-02 Thread E.B. Dreger
Greetings all, I wish to accomplish the following: 1. Program "foo" loads shared object "bar" using dlopen() and dlsym() 2. "bar" needs certain symbols resolved, which "foo" intercepts. For example, "foo" might wrap malloc() or open() to provide its own behavior... much like subclassing wi