diff options
author | Ryan S. Arnold <rsa@us.ibm.com> | 2010-12-19 22:49:01 -0500 |
---|---|---|
committer | Ulrich Drepper <drepper@gmail.com> | 2010-12-19 22:49:01 -0500 |
commit | 30950a5fd2346c43ba4fc59c16f122cfb59f9629 (patch) | |
tree | 400aceac60bdb17ec66caf2850d173ad8554e135 /elf/check-execstack.c | |
parent | db753e2cfb2051ebf20dc089f87c5b1297cc2cff (diff) | |
download | glibc-30950a5fd2346c43ba4fc59c16f122cfb59f9629.tar.gz |
Make PowerPC64 default to nonexecutable stack
Diffstat (limited to 'elf/check-execstack.c')
-rw-r--r-- | elf/check-execstack.c | 13 |
1 files changed, 9 insertions, 4 deletions
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 <drepper@redhat.com>. 2009. @@ -26,6 +26,7 @@ #include <stdlib.h> #include <string.h> #include <unistd.h> +#include <stackinfo.h> #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 |