This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: What is the right way to link static and shared libraries togethe r?


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]