This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/35500] Documentation for -fPIC/-fpic/-fpie is not clear
- From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 7 Mar 2008 19:47:48 -0000
- Subject: [Bug c++/35500] Documentation for -fPIC/-fpic/-fpie is not clear
- References: <bug-35500-15713@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #3 from pinskia at gcc dot gnu dot org 2008-03-07 19:47 -------
(In reply to comment #2)
> But DSOs still work if I don't use PIC. Why is that?
Depends on the target :). If this is x86, then you can guess why. In fact
x86_64 errors out when linking if you did not use -fPIC (or -fpic).
> Why would anybody want to create position-independent executable? What are the
> advantages and disadvantages?
Security, random addresses for the text section.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35500