From owner-freebsd-questions@FreeBSD.ORG Fri Aug 19 20:14:51 2005 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2C08E16A41F for ; Fri, 19 Aug 2005 20:14:51 +0000 (GMT) (envelope-from keramida@ceid.upatras.gr) Received: from aiolos.otenet.gr (aiolos.otenet.gr [195.170.0.93]) by mx1.FreeBSD.org (Postfix) with ESMTP id 64AAC43D53 for ; Fri, 19 Aug 2005 20:14:50 +0000 (GMT) (envelope-from keramida@ceid.upatras.gr) Received: from flame.pc (aris.bedc.ondsl.gr [62.103.39.226]) by aiolos.otenet.gr (8.13.4/8.13.4/Debian-1) with SMTP id j7JKEmaF028299; Fri, 19 Aug 2005 23:14:48 +0300 Received: from flame.pc (flame [127.0.0.1]) by flame.pc (8.13.4/8.13.4) with ESMTP id j7JKEeFx009267; Fri, 19 Aug 2005 23:14:40 +0300 (EEST) (envelope-from keramida@ceid.upatras.gr) Received: (from keramida@localhost) by flame.pc (8.13.4/8.13.4/Submit) id j7JKEeCW009266; Fri, 19 Aug 2005 23:14:40 +0300 (EEST) (envelope-from keramida@ceid.upatras.gr) Date: Fri, 19 Aug 2005 23:14:40 +0300 From: Giorgos Keramidas To: Jonathon McKitrick Message-ID: <20050819201440.GA9246@flame.pc> References: <20050819191335.GA76538@dogma.freebsd-uk.eu.org> <20050819194748.GA7138@flame.pc> <20050819200338.GA77739@dogma.freebsd-uk.eu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050819200338.GA77739@dogma.freebsd-uk.eu.org> Cc: freebsd-questions@freebsd.org Subject: Re: Forcing symbol resolution in lib rather than bin X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Aug 2005 20:14:51 -0000 On 2005-08-19 21:03, Jonathon McKitrick wrote: >On Fri, Aug 19, 2005 at 10:47:48PM +0300, Giorgos Keramidas wrote: >: # flame:/tmp/jcm-lib/foobar$ LD_LIBRARY_PATH=`pwd`/../libbar ./foobar >: # libfoo initialized at 0x80062a8a0 >: # libbar initialized at 0x4004e4 >: # flame:/tmp/jcm-lib/foobar$ > > Hmmm. I'm using my own makefile setup rather than the standard one. I know > you're a big fan of ;-) > > Doesn't ld *statically* link code from .a archives? 'statically' is such an overloaded term I prefer to avoid using it. The C linker will include the body of functions defined in non-shared libraries into every shared object that references them, AFAIK. This is obvious if you run nm(1) on libbar.so of the example above, because the libfoo_init() function is listed as 'T'. I think that's what you want by making the libfoo.a library non-shared in the first place.