Daniel Iliev <[EMAIL PROTECTED]> skribis:
> Well, then I have to simplify more (because of my lack of knowledge) and
> ask what are the pros and cons to use PIC when building a program and a
> share library?

When a program runs it needs to know the addresses of variables,
subroutines, etc. A shared library can’t know those addresses until
run time, when it gets linked into the program. Therefore its code
needs to have fancy things done to it so it can be taught where to
find things at run time. The PIC stuff is largely overhead. A static
library is linked in at program build time, and so doesn’t have this
overhead.

My wild guess is that prelink would need position independent
executables because the build-time linker (/usr/bin/ld) doesn’t
know how to link a program to a shared library as if it were a static
library.


-- 
Barry.SCHWARTZ at chemoelectric.org   http://chemoelectric.org
        Free stuff / Senpagaj varoj:  http://crudfactory.com (PDF)
'Democracies don't war; democracies are peaceful countries.' - Bush
(http://www.whitehouse.gov/news/releases/2005/12/20051219-2.html)

Attachment: pgplhBu36sDuu.pgp
Description: PGP signature

Reply via email to