From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Rob Browning Newsgroups: gmane.lisp.guile.devel Subject: Re: Perhaps we can (and should) just detect dangerous linkages... Date: Sun, 13 Oct 2002 14:58:37 -0500 Sender: guile-devel-admin@gnu.org Message-ID: <873cram7pu.fsf@raven.i.defaultvalue.org> References: <87n0pimeg2.fsf@raven.i.defaultvalue.org> NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1034539214 5138 127.0.0.1 (13 Oct 2002 20:00:14 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sun, 13 Oct 2002 20:00:14 +0000 (UTC) Cc: guile-devel@gnu.org Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 180ouK-0001Kc-01 for ; Sun, 13 Oct 2002 22:00:12 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10) id 180otH-0002B2-00; Sun, 13 Oct 2002 15:59:07 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10) id 180osq-0001SE-00 for guile-devel@gnu.org; Sun, 13 Oct 2002 15:58:40 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10) id 180oso-0001OZ-00 for guile-devel@gnu.org; Sun, 13 Oct 2002 15:58:40 -0400 Original-Received: from n66644228.ipcdsl.net ([66.64.4.228] helo=defaultvalue.org) by monty-python.gnu.org with esmtp (Exim 4.10) id 180oso-0001Np-00 for guile-devel@gnu.org; Sun, 13 Oct 2002 15:58:38 -0400 Original-Received: from raven.i.defaultvalue.org (raven.i.defaultvalue.org [192.168.1.7]) by defaultvalue.org (Postfix) with ESMTP id 7D5A0BD8F; Sun, 13 Oct 2002 14:58:37 -0500 (CDT) Original-Received: by raven.i.defaultvalue.org (Postfix, from userid 1000) id 69A0D18C1; Sun, 13 Oct 2002 14:58:37 -0500 (CDT) Original-To: Neil Jerram In-Reply-To: (Neil Jerram's message of "13 Oct 2002 20:05:01 +0100") Original-Lines: 38 User-Agent: Gnus/5.090006 (Oort Gnus v0.06) Emacs/21.2 (i386-pc-linux-gnu) Errors-To: guile-devel-admin@gnu.org X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.0.11 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Developers list for Guile, the GNU extensibility library List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.lisp.guile.devel:1547 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.devel:1547 Neil Jerram writes: >>>>>> "Rob" == Rob Browning writes: > > Rob> some-app-2 was linked against libuses-base-foo2 which was linked > Rob> against libbase2 and libuses-base-bar which was linked against > Rob> libbase1. So when some-app-2 calls libuses_base_foo_init and that in > Rob> turn calls libbase_require_version(LIBBASE_MAJOR_VERSION), the check > Rob> fails because at runtime foo is calling the libbase_require_version > Rob> from libbase1, but passing it the compile-time embedded value for > Rob> LIBBASE_MAJOR_VERSION from the libbase2 it was compiled against. > > When an app like this is run, does the system load and use both > libbase1 and libbase2, or does it load both but only use one, or what? Well with my proposed checks, the app would just crater. Without the checks, see my earlier message(s) for more details, but the summary is that athough I suspect it depends heavily on the OS (and probably even on whether or not you're using libtool), on a current Debian/GNU/Linux system using libtool, if you do nothing, some-app-2 can end up linked indirectly against both libbase.1 and libbase.2, and at runtime, *all* libbase symbols in the process image will resolve to one copy of libbase, the other libbase will be completely shadowed. Which one is chosen appears to depend on the ordering of libuses-base-foo and libuses-base-bar in the _LDADD line of some-app-2 -- whichever one is first wins globally. Presming that the ordering is such that libbase.2 dominates, I don't actually know what happens if libbase.2 removes some symbols from the libbase api. Do the older libbase.1 versions of those symbols then "show through"? I suppose I could test, but I suspect the answer would only mean something for the particular system I'm testing... -- Rob Browning rlb @defaultvalue.org, @linuxdevel.com, and @debian.org Previously @cs.utexas.edu GPG=1C58 8B2C FB5E 3F64 EA5C 64AE 78FE E5FE F0CB A0AD _______________________________________________ Guile-devel mailing list Guile-devel@gnu.org http://mail.gnu.org/mailman/listinfo/guile-devel