From owner-freebsd-questions@FreeBSD.ORG Fri Aug 19 20:26:29 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 CE93A16A424 for ; Fri, 19 Aug 2005 20:26:29 +0000 (GMT) (envelope-from keramida@ceid.upatras.gr) Received: from kane.otenet.gr (kane.otenet.gr [195.170.0.95]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0E78743D53 for ; Fri, 19 Aug 2005 20:26:28 +0000 (GMT) (envelope-from keramida@ceid.upatras.gr) Received: from flame.pc (aris.bedc.ondsl.gr [62.103.39.226]) by kane.otenet.gr (8.13.4/8.13.4/Debian-1) with SMTP id j7JKPPxT027974; Fri, 19 Aug 2005 23:25:26 +0300 Received: from flame.pc (flame [127.0.0.1]) by flame.pc (8.13.4/8.13.4) with ESMTP id j7JKPNKU009558; Fri, 19 Aug 2005 23:25:23 +0300 (EEST) (envelope-from keramida@ceid.upatras.gr) Received: (from keramida@localhost) by flame.pc (8.13.4/8.13.4/Submit) id j7JKPMUn009557; Fri, 19 Aug 2005 23:25:22 +0300 (EEST) (envelope-from keramida@ceid.upatras.gr) Date: Fri, 19 Aug 2005 23:25:22 +0300 From: Giorgos Keramidas To: Jonathon McKitrick Message-ID: <20050819202522.GB9519@flame.pc> References: <20050819191335.GA76538@dogma.freebsd-uk.eu.org> <20050819194748.GA7138@flame.pc> <20050819200338.GA77739@dogma.freebsd-uk.eu.org> <20050819201440.GA9246@flame.pc> <20050819201945.GA79032@dogma.freebsd-uk.eu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050819201945.GA79032@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:26:30 -0000 On 2005-08-19 21:19, Jonathon McKitrick wrote: >On Fri, Aug 19, 2005 at 11:14:40PM +0300, Giorgos Keramidas wrote: >: > 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. > > I can see from nm(1) that the function I want is there ('T'). And reading > about ld(1) talks about the '-(' option for searching the .a archives until > there are no unresolved symbols. But it still doesn't find mine unless I > link it with the binary, not the calling shared object. I think I'll have to see a minimal example that reproduces the problem.