This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: is -fPIC safe for executable programs, or must -fPIE be used?
- From: Jeff Law <law at redhat dot com>
- To: Britton Kerin <britton dot kerin at gmail dot com>, gcc-help at gcc dot gnu dot org
- Date: Thu, 24 Mar 2016 10:57:43 -0600
- Subject: Re: is -fPIC safe for executable programs, or must -fPIE be used?
- Authentication-results: sourceware.org; auth=none
- References: <CAC4O8c-FrGrpKUQptyYzZpu8Zr9afmyWaRHTFLRLDMyA9QZtaw at mail dot gmail dot com>
On 03/23/2016 04:12 PM, Britton Kerin wrote:
I can't tell from the manual if -fPIC is safe for executable programs,
or only for libraries.
I want to use -fPIC or -fPIE so dladdr() will work right. I would
rather use -fPIC if possible, because it seems simpler to use one such
option for everything if possible.
Sadly, it depends on the target (processor & OS in use).
jeff