From owner-freebsd-questions Thu Jul 31 18:22:33 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id SAA15338 for questions-outgoing; Thu, 31 Jul 1997 18:22:33 -0700 (PDT) Received: from awfulhak.demon.co.uk (awfulhak.demon.co.uk [158.152.17.1]) by hub.freebsd.org (8.8.5/8.8.5) with ESMTP id SAA15329 for ; Thu, 31 Jul 1997 18:22:22 -0700 (PDT) Received: from awfulhak.org (dev.lan.awfulhak.org [10.0.1.5]) by awfulhak.demon.co.uk (8.8.5/8.8.5) with ESMTP id CAA00681; Fri, 1 Aug 1997 02:06:37 +0100 (BST) Received: from dev.lan.awfulhak.org (localhost [127.0.0.1]) by awfulhak.org (8.8.6/8.8.6) with ESMTP id CAA19410; Fri, 1 Aug 1997 02:06:36 +0100 (BST) Message-Id: <199708010106.CAA19410@awfulhak.org> X-Mailer: exmh version 2.0zeta 7/24/97 To: Walter Hafner cc: freebsd-questions@FreeBSD.ORG Subject: Re: questions about dlopen() In-reply-to: Your message of "30 Jul 1997 11:15:01 +0200." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Fri, 01 Aug 1997 02:06:36 +0100 From: Brian Somers Sender: owner-freebsd-questions@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk > 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 > *CLICK* > The best observation I can make is that the BSD Daemon logo is _much_ > cooler than that Penguin :-) (Donald Whiteside) -- Brian , Don't _EVER_ lose your sense of humour....