about summary refs log tree commit diff
path: root/elf
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>2004-09-20 20:56:03 +0000
committerRoland McGrath <roland@gnu.org>2004-09-20 20:56:03 +0000
commit44828b9d2ae915f02491133a964d3ed2de6da175 (patch)
tree8eb551218bdc817d84231a02fd15fc5cdacece7d /elf
parent703ccc12453bbe0111b758637445386ed834b8ae (diff)
downloadglibc-44828b9d2ae915f02491133a964d3ed2de6da175.tar.gz
glibc-44828b9d2ae915f02491133a964d3ed2de6da175.tar.xz
glibc-44828b9d2ae915f02491133a964d3ed2de6da175.zip
2004-09-20 Roland McGrath <roland@frob.com>
	* elf/dl-load.c (__stack_prot): Only use PROT_GROWSUP/PROT_GROWSDOWN
	in initializer #if defined.
Diffstat (limited to 'elf')
-rw-r--r--elf/dl-load.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/elf/dl-load.c b/elf/dl-load.c
index e4f85a9cc8..73112bce23 100644
--- a/elf/dl-load.c
+++ b/elf/dl-load.c
@@ -105,11 +105,13 @@ ELF_PREFERRED_ADDRESS_DATA;
 
 
 int __stack_prot attribute_hidden attribute_relro
-#if _STACK_GROWS_DOWN
-     = PROT_READ|PROT_WRITE|PROT_GROWSDOWN;
-#elif _STACK_GROWS_UP
-     = PROT_READ|PROT_WRITE|PROT_GROWSUP;
+  = (PROT_READ|PROT_WRITE
+#if _STACK_GROWS_DOWN && defined PROT_GROWSDOWN
+     |PROT_GROWSDOWN
+#elif _STACK_GROWS_UP && defined PROT_GROWSUP
+     |PROT_GROWSUP
 #endif
+     );
 
 
 /* Type for the buffer we put the ELF header and hopefully the program