From owner-freebsd-hackers@FreeBSD.ORG Wed Sep 7 11:32:07 2005 Return-Path: X-Original-To: freebsd-hackers@FreeBSD.org Delivered-To: freebsd-hackers@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5D36C16A41F; Wed, 7 Sep 2005 11:32:07 +0000 (GMT) (envelope-from kan@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 275A243D4C; Wed, 7 Sep 2005 11:32:07 +0000 (GMT) (envelope-from kan@FreeBSD.org) Received: from freefall.freebsd.org (kan@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.3/8.13.3) with ESMTP id j87BW7tR075476; Wed, 7 Sep 2005 11:32:07 GMT (envelope-from kan@freefall.freebsd.org) Received: (from kan@localhost) by freefall.freebsd.org (8.13.3/8.13.1/Submit) id j87BW7Oe075475; Wed, 7 Sep 2005 11:32:07 GMT (envelope-from kan) Date: Wed, 7 Sep 2005 11:32:06 +0000 From: Alexander Kabaev To: Joe Marcus Clarke Message-ID: <20050907113206.GA73920@freefall.freebsd.org> References: <1126073204.18969.15.camel@shumai.marcuscom.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1126073204.18969.15.camel@shumai.marcuscom.com> User-Agent: Mutt/1.4.2.1i Cc: freebsd-hackers@FreeBSD.org Subject: Re: Why is our symbol lookup the way it is? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Sep 2005 11:32:07 -0000 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