Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 7 Sep 2005 11:32:06 +0000
From:      Alexander Kabaev <kan@FreeBSD.org>
To:        Joe Marcus Clarke <marcus@FreeBSD.org>
Cc:        freebsd-hackers@FreeBSD.org
Subject:   Re: Why is our symbol lookup the way it is?
Message-ID:  <20050907113206.GA73920@freefall.freebsd.org>
In-Reply-To: <1126073204.18969.15.camel@shumai.marcuscom.com>
References:  <1126073204.18969.15.camel@shumai.marcuscom.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, Sep 07, 2005 at 02:06:44AM -0400, Joe Marcus Clarke wrote:
> This is something that's been bothering me for a while, ever since I
> fixed the symbol conflicts in Mozilla with -Bsymbolic.  Why do we not
> look in the referencing object first by default?  I'm referring to the
> great comments in the symlook_default() function in rtld.c.  We only
> check the referencing object first when -Bsymbolic is passed to the
> linker.

Number of reasons. Programs should be able to override symbols from
dynamim libraries, for instance. C++ exceptions won't work with -Bsymbolic
when exceptions are thrown across shared library boundaries, as thrower
and hander will use their own typeinfo structures and the catch clause
in handler block will simply not recognize the exception, etc.

> 
> The main reason I'm asking is that I just tracked down another symbol
> conflict in a dlopen'd library that plagues us but not Linux.  I assume
> there was a good reason for resolving symbols in the order we do, but
> admittedly, I don't understand enough of the linker to know what it is.
> Thanks.

I would suggest providing an exect scenario that is biting you. I fixed
most incompatibilities in symbol lookup order between us and Linux for
when Martin Blapp was working on initial OpenOffice port and if there
is another, I would like to know about it.

--
Alexander Kabaev



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050907113206.GA73920>