PROT_GROWSDOWN

Alfred M. Szmidt ams@kemisten.nu
Mon Sep 20 20:27:00 GMT 2004


The following change is bogus, _STACK_GROWS_DOWN is defined for i386
in general, but PROT_GROWS{DOWN,UP} are only defined for the GNU/Linux
port, not for GNU/Hurd.

dl-load.c:109: error: `PROT_GROWSDOWN' undeclared here (not in a function)

--- libc/elf/dl-load.c	2004/09/20 07:42:43	1.246
+++ libc/elf/dl-load.c	2004/09/20 15:07:20	1.247
@@ -102,7 +103,13 @@
 #endif
 
 
-extern int __stack_prot attribute_relro attribute_hidden;
+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;
+#endif
+



More information about the Libc-alpha mailing list