From 30950a5fd2346c43ba4fc59c16f122cfb59f9629 Mon Sep 17 00:00:00 2001 From: "Ryan S. Arnold" Date: Sun, 19 Dec 2010 22:49:01 -0500 Subject: Make PowerPC64 default to nonexecutable stack --- elf/check-execstack.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'elf/check-execstack.c') diff --git a/elf/check-execstack.c b/elf/check-execstack.c index 55cf48721a..64353751e9 100644 --- a/elf/check-execstack.c +++ b/elf/check-execstack.c @@ -1,5 +1,5 @@ /* Check for executable stacks in DSOs. - Copyright (C) 2009 Free Software Foundation, Inc. + Copyright (C) 2009, 2010 Free Software Foundation, Inc. This file is part of the GNU C Library. Contribute by Ulrich Drepper . 2009. @@ -26,6 +26,7 @@ #include #include #include +#include #ifdef BITS @@ -150,9 +151,13 @@ main (int argc, char *argv[]) int cnt; int result = 0; - for (cnt = 1; cnt < argc; ++cnt) - result |= handle_file (argv[cnt]); - + /* We can return successfully, i.e., not fail, if PF_X isn't present. If it + * is present then check for the GNU_STACK header. */ + if (DEFAULT_STACK_PERMS & PF_X) + { + for (cnt = 1; cnt < argc; ++cnt) + result |= handle_file (argv[cnt]); + } return result; } #endif -- cgit v1.2.3