Date: Fri, 01 Aug 1997 02:06:36 +0100 From: Brian Somers <brian@awfulhak.org> To: Walter Hafner <hafner@forwiss.tu-muenchen.de> Cc: freebsd-questions@FreeBSD.ORG Subject: Re: questions about dlopen() Message-ID: <199708010106.CAA19410@awfulhak.org> In-Reply-To: Your message of "30 Jul 1997 11:15:01 %2B0200." <s9nyb6oyk8a.fsf@pccog4.forwiss.tu-muenchen.de>
next in thread | previous in thread | raw e-mail | index | archive | help
> The following message is a courtesy copy of an article > that has been posted as well. > > Hi there! > > I've got a few questions regarding the 'dlopen()' call. I had a look at > the sources (/usr/src/lib), but didn't find any references to > dlopen(). The manpage is no help either. dlopen() is defined in lib/csu/i386/crt0.c, and things get obscure from there :-) Essentially, ld.so fills in the interesting bits. > Problem: We try to read shared libs into an application at runtime. Our > application supports various framegrabbers on various hardware (HP, Sun, > SGI, PC/Linux, PC/FreeBSD ...) and we have to load wrapper-libs that > provide a consistent user interface at runtime (plus the vendor-specific > libs of course). That's where 'dlopen()' comes in handy. The following > code snipplet works on _all_ hard- and software combinations _except_ > FreeBSD 2.2.* (didn't try 2.1.*): > > #define RTLD_LAZY 1 > [...] > hndl = dlopen(name,RTLD_LAZY); > if (hndl == NULL) > return H_ERR_DLOPEN; > [.....] You're right. If you want to submit some patches against /usr/src/gnu/usr.bin/ld/rtld/rtld.c (map_object() would need to fondle the path passed to it), I'm sure someone would commit them :-) > -- > Walter Hafner_____________________________ hafner@forwiss.tu-muenchen.de > <A href=http://www.forwiss.tu-muenchen.de/~hafner/>*CLICK*</A> > The best observation I can make is that the BSD Daemon logo is _much_ > cooler than that Penguin :-) (Donald Whiteside) -- Brian <brian@awfulhak.org>, <brian@freebsd.org> <http://www.awfulhak.org> Don't _EVER_ lose your sense of humour....
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199708010106.CAA19410>