Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 24 Feb 1999 19:20:22 -0800 (PST)
From:      John Polstra <jdp@polstra.com>
To:        damian@cablenet.net
Cc:        hackers@freebsd.org
Subject:   Re: Interesting ld.so bug
Message-ID:  <199902250320.TAA00439@vashon.polstra.com>
In-Reply-To: <36D1AFBF.58BCFFEF@cablenet.net>
References:  <199902202154.OAA18160@usr08.primenet.com>

next in thread | previous in thread | raw e-mail | index | archive | help
In article <36D1AFBF.58BCFFEF@cablenet.net>,
Damian Hamill  <damian@cablenet.net> wrote:
> 
> I've recently installed version 3 on a system and upgraded to 3.1 and
> noticed dynamic loading strangeness too.
> 
> The Apache port won't load dynamic modules as it can't resolve some of
> the undefined symbols from the module being loaded which are contained
> in the loading process, ap_make_sub_pool for example.
> 
> Using dlsym(NULL,"symbol_name") in one of my own dynamically loaded
> modules fails to find "symbol_name" in the loading process, contrary to
> the man page and previous behaviour.

This has been answered in the mailing lists zillions of times.  Your
port is out of date, I suspect.  You have to add "--export-dynamic" to
the linker command line when building the main executable.  All of the
ports have been updated to do that already, as far as I know.

> Similarly I find that I now don't need a leading underscore before
> the symbol name to resolve symbols in the module being loaded from
> the loading process, again contrary to the man page and previous
> behaviour.

You're right about the man page -- it's out of date.  Thanks for
pointing that out.  "Previous behavior" has actually accepted the
symbol with or without the underscore for probably close to a year by
now.

> Is this all part of the transition to elf ?

Yes.

> Do I need to add -elf to CFLAGS ?

No, it should already be the default on your system.  Type
"objformat" and see what it says.

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: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199902250320.TAA00439>