kdeinit (was: Summary from Buildsystem BoF at Desktop Summit)

Thiago Macieira thiago at kde.org
Tue Aug 16 12:27:02 BST 2011

On Tuesday, 16 de August de 2011 13:16:44 Laszlo Papp wrote:
> > btw, why cannot non-pic libs be prelinked? works for non-pie executables,
> > after all.
> Well, by definition, non-pic libraries cannot be prelinked since the
> symbols are at fixed addresses. You can not change the symbols using
> prelink. It is mentioned in the prelink manual [1], and prelink goes
> out of its way to find non-pic libraries and ignore them. You can just
> read the preface where it says why the libraries should be PIC, and
> how only PIC libraries can actually be prelinked.

Technically, there two dimensions here and the PIC / non-PIC naming is 

Code position: fixed / movable
Code cleanliness: clean (no relocations) / dirty (has text relocations)

-fPIC creates clean, movable code. Without it, shared libraries are dirty, but 
still movable. Non-PIE applications, however, are both dirty and fixed.

So the NVidia libraries have text relocations, but they are still position-
independent. They can be loaded anywhere. The prelinker should be able to 
prelink it.

A prelinked, non-PIC library is just like a Windows DLL: the PIC register is 
free and, if the loader can load it at its preferred address, will not dirty 
its pages (i.e., will be sharable).

Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
   Software Architect - Intel Open Source Technology Center
      PGP/GPG: 0x6EF45358; fingerprint:
      E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20110816/c33b8668/attachment.sig>

More information about the kde-core-devel mailing list