From 7a0eea86b979247ba93b739beec6c2e6fd26dbd2 Mon Sep 17 00:00:00 2001 From: rsandifo Date: Wed, 21 Mar 2007 09:07:19 +0000 Subject: [PATCH] gcc/ * doc/invoke.texi (-fpie, -fPIE): Document __pie__ and __PIE__. * c-cppbuiltin.c (c_cpp_builtins): Define them. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@123104 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 5 +++++ gcc/c-cppbuiltin.c | 5 +++++ gcc/doc/invoke.texi | 4 ++++ 3 files changed, 14 insertions(+) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index a3db8dbcb869..c2bcf896c9c5 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2007-03-21 Richard Sandiford + + * doc/invoke.texi (-fpie, -fPIE): Document __pie__ and __PIE__. + * c-cppbuiltin.c (c_cpp_builtins): Define them. + 2007-03-20 Mark Mitchell * config/arm/elf.h (TARGET_ASM_DESTRUCTOR): Define. diff --git a/gcc/c-cppbuiltin.c b/gcc/c-cppbuiltin.c index 0239a1c3af8e..e9f608eff2ec 100644 --- a/gcc/c-cppbuiltin.c +++ b/gcc/c-cppbuiltin.c @@ -532,6 +532,11 @@ c_cpp_builtins (cpp_reader *pfile) builtin_define_with_int_value ("__pic__", flag_pic); builtin_define_with_int_value ("__PIC__", flag_pic); } + if (flag_pie) + { + builtin_define_with_int_value ("__pie__", flag_pie); + builtin_define_with_int_value ("__PIE__", flag_pie); + } if (flag_iso) cpp_define (pfile, "__STRICT_ANSI__"); diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index b11681b9ad9b..f2451c3812f5 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -14210,6 +14210,10 @@ generated position independent code can be only linked into executables. Usually these options are used when @option{-pie} GCC option will be used during linking. +@option{-fpie} and @option{-fPIE} both define the macros +@code{__pie__} and @code{__PIE__}. The macros have the value 1 +for @option{-fpie} and 2 for @option{-fPIE}. + @item -fno-jump-tables @opindex fno-jump-tables Do not use jump tables for switch statements even where it would be -- 2.47.2