[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-buildsystem
Subject:    Re: kdeinit (was: Summary from Buildsystem BoF at Desktop Summit)
From:       Michael Matz <matz () kde ! org>
Date:       2011-08-17 13:10:07
Message-ID: Pine.LNX.4.64.1108171445560.23968 () wotan ! suse ! de
[Download RAW message or body]

Hi,

On Wed, 17 Aug 2011, Thiago Macieira wrote:

> > Can you think of any other example where PIE would differ from PIC?
> 
> One idea is that variables are moved and the compiler uses a simpler, 
> 32-bit PC-relative relocation to access them, as opposed to a 64-bit 
> indirect as would be expected.
> 
> Another, and far more likely, is that the compiler and linker expect 
> that none of the symbols in the executable be overridden by any library. 
> That is, it probably applies -Bsymbolic or something equivalent. If you 
> have an application or library that expects to be able to override 
> non-weak symbols by interposition, this could cause issues. Fortunately, 
> this is very rare and frowned upon.

<advancing from the cave>
Speculations aside: the difference is that symbols defined in a DSO are 
interposable with PIC (when also linked with -shared) and non-interposable 
with PIE.  There are no other differences.  That happens to be the 
semantics that symbol resolution during loading is given for the first 
loaded DSO, which conventially is called 'executable', hence the name for 
this option.

Note that linking with -shared also has the side effect of exporting all 
global symbols from the DSO (appropriately filtered through symbol version 
lists).  It also is incompatible with -fPIE code, therefore by default a 
PIE compiled/linked executable doesn't export any symbols.  See 
--dynamic-list.  Again, that's just a side effect, the only real 
difference between PIC and PIE is the one above.
</crawl back>


Ciao,
Michael.
_______________________________________________
Kde-buildsystem mailing list
Kde-buildsystem@kde.org
https://mail.kde.org/mailman/listinfo/kde-buildsystem
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic