[Bug c++/35500] Documentation for -fPIC/-fpic/-fpie is not clear
pinskia at gcc dot gnu dot org
gcc-bugzilla@gcc.gnu.org
Fri Mar 7 19:48:00 GMT 2008
------- 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
More information about the Gcc-bugs
mailing list