diff --git a/gcc/ChangeLog b/gcc/ChangeLog index dc2e04ac1e9e9a171e4038cecab5b7733f19610d..aeab479d8343c4da80090e3e5a6af82cbbe8a570 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,7 @@ +2011-06-10 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> + + * doc/sourcebuild.texi (Effective-Target Keywords, pie): Document it. + 2011-06-10 Hans-Peter Nilsson <hp@axis.com> * ira-costs.c: Remove #ifdefs on dead FORBIDDEN_INC_DEC_CLASSES. diff --git a/gcc/doc/sourcebuild.texi b/gcc/doc/sourcebuild.texi index 64210c21bc92972c8a58ae79686c6341e09b5d3a..d2cc4ea3ead46948dc2dd10c6741735a411f8c8a 100644 --- a/gcc/doc/sourcebuild.texi +++ b/gcc/doc/sourcebuild.texi @@ -1787,6 +1787,9 @@ Target defines @code{PCC_BITFIELD_TYPE_MATTERS}. @item pe_aligned_commons Target supports @option{-mpe-aligned-commons}. +@item pie +Target supports @option{-pie}, @option{-fpie} and @option{-fPIE}. + @item section_anchors Target supports section anchors. diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 31f5d1e65c8975da15c7c868625406d69c22f16a..4ffc08152a7cea2b7e4ba4c26c16f73683e82883 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2011-06-10 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> + + * lib/target-supports.exp (check_effective_target_pie): New proc. + * gcc.dg/pie-link.c: Use target pie. + 2011-06-10 Eric Botcazou <ebotcazou@adacore.com> Laurent Rougé <laurent.rouge@menta.fr> diff --git a/gcc/testsuite/gcc.dg/pie-link.c b/gcc/testsuite/gcc.dg/pie-link.c index 00ff49597ed83917b613dff976b70e6cc6d5ef49..c16086cc19ebd0a8065c101a4335736bd9b75849 100644 --- a/gcc/testsuite/gcc.dg/pie-link.c +++ b/gcc/testsuite/gcc.dg/pie-link.c @@ -1,4 +1,4 @@ -/* { dg-do link { target *-*-darwin[912]* *-*-linux* } } */ +/* { dg-do link { target pie } } */ /* { dg-options "-fpie" } */ int main(void) diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp index 7d3a27135f5d4ea7395972ad3b27500cb90f9ccc..1f6f8b6ba4e676dae45ef051dccc9b7d1e5c905b 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -788,6 +788,16 @@ proc check_effective_target_fpic { } { return 0 } +# Return 1 if -pie, -fpie and -fPIE are supported, 0 otherwise. + +proc check_effective_target_pie { } { + if { [istarget *-*-darwin\[912\]*] + || [istarget *-*-linux*] } { + return 1; + } + return 0 +} + # Return true if the target supports -mpaired-single (as used on MIPS). proc check_effective_target_mpaired_single { } {