Subject: Re: intercepting library calls
To: Michael Ritzert <mjr@turbo.su.shuttle.de>
From: Todd Vierling <tv@wasabisystems.com>
List: port-sparc
Date: 12/28/2000 13:30:42
On Thu, 28 Dec 2000, Michael Ritzert wrote:

: in an attempt to port the library to reduce colormap flashin from
: solaris to netbsd (1.4.1 a.out), i lack some information about the
: dynamic linker.  Solaris offers the possibility to "preload" a library
: specified in an environment variable LD_PRELOAD. To intercept with the
: library to "patch", it uses dlsym(). dlsym() seems to be implemented
: sufficiently functional in NetBSD to to the job, but what about the
: LD_PRELOAD mechanism or something analogous?

LD_PRELOAD is supported by both the a.out and ELF dynamic linkers on
NetBSD.  You'll have to do a dlopen("libc.so.12") and then dlsym() on it, as
you've described, to get to the libc functions that you are overriding.

-- 
-- Todd Vierling <tv@wasabisystems.com>  *  Wasabi NetBSD:  Run with it.
-- NetBSD 1.5 now available on CD-ROM  --  http://www.wasabisystems.com/