This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
PROT_GROWSDOWN
- From: "Alfred M. Szmidt" <ams at kemisten dot nu>
- To: libc-alpha at sources dot redhat dot com
- Date: Mon, 20 Sep 2004 22:27:12 +0200
- Subject: PROT_GROWSDOWN
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
+