Date: Fri, 19 Aug 2005 23:25:22 +0300 From: Giorgos Keramidas <keramida@ceid.upatras.gr> To: Jonathon McKitrick <jcm@FreeBSD-uk.eu.org> Cc: freebsd-questions@freebsd.org Subject: Re: Forcing symbol resolution in lib rather than bin Message-ID: <20050819202522.GB9519@flame.pc> In-Reply-To: <20050819201945.GA79032@dogma.freebsd-uk.eu.org> 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>
next in thread | previous in thread | raw e-mail | index | archive | help
On 2005-08-19 21:19, Jonathon McKitrick <jcm@FreeBSD-uk.eu.org> 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.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050819202522.GB9519>