This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: What is the right way to link static and shared libraries togethe r?
- From: Alexandre Oliva <aoliva at redhat dot com>
- To: Joerg dot Richter at pdv-FS dot de
- Cc: binutils at sources dot redhat dot com
- Date: 10 Jul 2003 14:10:38 -0300
- Subject: Re: What is the right way to link static and shared libraries togethe r?
- Organization: GCC Team, Red Hat
- References: <E8CDBCCCB3158347AC15ADEBFB24A84F5ACFBB@fsexchng.pdv-fs.de>
On Jul 10, 2003, Joerg.Richter@pdv-FS.de wrote:
> LINK -shared B.o -o libB.so -lA
> LINK C.o -o C -lB
> I like the second one better, cause you build a self contained shared
> library B. And the executable can link with B without knowing library A.
However, if library A contains non-PIC, it is possible that library B
fails to link, or is silently broken. On some platforms, you just
can't link non-PIC into shared libraries. On others, you can, even if
with a run-time penalty.
--
Alexandre Oliva Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer aoliva@{redhat.com, gcc.gnu.org}
CS PhD student at IC-Unicamp oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist Professional serial bug killer