Last change
on this file was 2036, checked in by bird, 20 years ago |
Initial revision
|
-
Property cvs2svn:cvs-rev
set to
1.1
-
Property svn:eol-style
set to
native
-
Property svn:executable
set to
*
-
Property svn:keywords
set to
Author Date Id Revision
|
File size:
686 bytes
|
Line | |
---|
1 | /* Test program for making nonexecutable stacks executable
|
---|
2 | on DT_NEEDED load of a DSO that requires executable stacks. */
|
---|
3 |
|
---|
4 | #include <dlfcn.h>
|
---|
5 | #include <stdio.h>
|
---|
6 | #include <string.h>
|
---|
7 | #include <unistd.h>
|
---|
8 | #include <error.h>
|
---|
9 |
|
---|
10 | extern void tryme (void); /* from tst-execstack-mod.so */
|
---|
11 |
|
---|
12 | static void deeper (void (*f) (void));
|
---|
13 |
|
---|
14 | static int
|
---|
15 | do_test (void)
|
---|
16 | {
|
---|
17 | tryme ();
|
---|
18 |
|
---|
19 | /* Test that growing the stack region gets new executable pages too. */
|
---|
20 | deeper (&tryme);
|
---|
21 |
|
---|
22 | return 0;
|
---|
23 | }
|
---|
24 |
|
---|
25 | static void
|
---|
26 | deeper (void (*f) (void))
|
---|
27 | {
|
---|
28 | char stack[1100 * 1024];
|
---|
29 | memfrob (stack, sizeof stack);
|
---|
30 | (*f) ();
|
---|
31 | memfrob (stack, sizeof stack);
|
---|
32 | }
|
---|
33 |
|
---|
34 |
|
---|
35 | #define TEST_FUNCTION do_test ()
|
---|
36 | #include "../test-skeleton.c"
|
---|
Note:
See
TracBrowser
for help on using the repository browser.