From owner-freebsd-hackers Wed Feb 17 23:10:36 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from wall.polstra.com (rtrwan160.accessone.com [206.213.115.74]) by hub.freebsd.org (Postfix) with ESMTP id 0240410E64 for ; Wed, 17 Feb 1999 23:10:32 -0800 (PST) (envelope-from jdp@polstra.com) Received: from vashon.polstra.com (vashon.polstra.com [206.213.73.13]) by wall.polstra.com (8.9.1/8.9.1) with ESMTP id WAA15554; Wed, 17 Feb 1999 22:39:47 -0800 (PST) (envelope-from jdp@polstra.com) From: John Polstra Received: (from jdp@localhost) by vashon.polstra.com (8.9.2/8.9.1) id WAA69320; Wed, 17 Feb 1999 22:39:47 -0800 (PST) (envelope-from jdp@polstra.com) Date: Wed, 17 Feb 1999 22:39:47 -0800 (PST) Message-Id: <199902180639.WAA69320@vashon.polstra.com> To: kbyanc@freedomnet.com Subject: Re: symbol export question In-Reply-To: <000201be59e3$0ebbf5c0$1468f0c6@tech.freedomnet.com> Organization: Polstra & Co., Seattle, WA Cc: hackers@freebsd.org Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG In article <000201be59e3$0ebbf5c0$1468f0c6@tech.freedomnet.com>, Kelly Yancey wrote: > > I saw a similar question pop up a few days ago relating to Apache's DSO > model, but I never saw an answer. I have a similar problem that I'm hoping > that someone with more dynamic library experience can help me with... > > I have written a program which loads dynamic libraries using dlopen() and > friends to implement optional functionality. The main executable can call > dlsym() to properly resolve the symbols in the libraries and the libraries > can call symbols exported from the main executable. Everything works. Now, > for the trick...the only reason I can get it to work right is because I pass > the -Xlinker -E parameter(s) to gcc so that it tells ld to export *all* the > symbols in each the main executable and the modules. While this works, it > seems like a nasty kludge. No, it's the only way to do what you want to do. If you think it's a kludge, consider that it was the default in the a.out tools. You just didn't notice it before. :-) > I looked at the PAM sources under /usr/src/lib/libpam and see that if PAM > is compiled to use dynamic modules, it defines PAM_EXPORT as extern (which > is then in turn used for each symbol declaration to be exported). Well, I > have 2 problems with that: That's an entirely separate thing, which has nothing to do with your question above. John -- John Polstra jdp@polstra.com John D. Polstra & Co., Inc. Seattle, Washington USA "Nobody ever went broke underestimating the taste of the American public." -- H. L. Mencken To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message