This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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: [PATCH] -fpie/-fPIE/-pie GCC support


On Mon, 2 Jun 2003, Jakub Jelinek wrote:

> This patch is the GCC side of Position Independent Executable support
> which has been commited this week to binutils trunk.
> The patch adds -pie option which is for linking, similarly to -shared.
> This may select different crt files etc. and pass appropriate options
> down to the linker.

Where is the rationale / documentation for when PIE code is useful?  Is
this something that is deliberately not added to the manual because if
it's useful to you then you'll already understand it and why it's useful?

> or not). ATM the difference is in binds_local - like in non-fpic code
> GCC can assume any non-common object defined in the same module, even if
> not static, will be in the same binary (which means GOT relative accesses
> to such variables, ability to inline non-static functions at -O3, etc.).

There ought then to be testcases (that with PIC the compiler assumes
functions can be overridden, with PIE it doesn't).

You change many specs to define __PIC__ and __pic__ for PIE as well.  I
can't find documentation of these macros: is the previously intended
definition (that existing code presumes) that they are defined for
position-independent code, as distinguished from code for shared
libraries?  Could you move the definition of these macros out of specs and
into a single place in the compiler, depending on flag_pic etc.?

-- 
Joseph S. Myers
jsm28@cam.ac.uk


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