Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 17 Feb 1999 22:39:47 -0800 (PST)
From:      John Polstra <jdp@polstra.com>
To:        kbyanc@freedomnet.com
Cc:        hackers@freebsd.org
Subject:   Re: symbol export question
Message-ID:  <199902180639.WAA69320@vashon.polstra.com>
In-Reply-To: <000201be59e3$0ebbf5c0$1468f0c6@tech.freedomnet.com>

Next in thread | Previous in thread | Raw E-Mail | Index | Archive | Help
In article <000201be59e3$0ebbf5c0$1468f0c6@tech.freedomnet.com>,
Kelly Yancey <kbyanc@freedomnet.com> 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




Want to link to this message? Use this URL: <http://docs.FreeBSD.org/cgi/mid.cgi?199902180639.WAA69320>