Refer to C23 in place of C2X in glibc
[glibc.git] / elf / tst-execstack-needed.c
blob85078e40efbdeafd56381f4c3ebe0e6b1d7a6cd9
1 /* Test program for making nonexecutable stacks executable
2 on DT_NEEDED load of a DSO that requires executable stacks. */
4 #include <dlfcn.h>
5 #include <stdio.h>
6 #include <string.h>
7 #include <unistd.h>
8 #include <error.h>
10 extern void tryme (void); /* from tst-execstack-mod.so */
12 static void deeper (void (*f) (void));
14 static int
15 do_test (void)
17 tryme ();
19 /* Test that growing the stack region gets new executable pages too. */
20 deeper (&tryme);
22 return 0;
25 static void
26 deeper (void (*f) (void))
28 char stack[1100 * 1024];
29 explicit_bzero (stack, sizeof stack);
30 (*f) ();
31 memfrob (stack, sizeof stack);
34 #include <support/test-driver.c>