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:
647 bytes
|
Line | |
---|
1 | /* Test program for executable stacks in an executable itself. */
|
---|
2 |
|
---|
3 | #include <dlfcn.h>
|
---|
4 | #include <stdio.h>
|
---|
5 | #include <string.h>
|
---|
6 | #include <unistd.h>
|
---|
7 | #include <error.h>
|
---|
8 |
|
---|
9 | #include "tst-execstack-mod.c" /* This defines the `tryme' test function. */
|
---|
10 |
|
---|
11 | static void deeper (void (*f) (void));
|
---|
12 |
|
---|
13 | static int
|
---|
14 | do_test (void)
|
---|
15 | {
|
---|
16 | tryme ();
|
---|
17 |
|
---|
18 | /* Test that growing the stack region gets new executable pages too. */
|
---|
19 | deeper (&tryme);
|
---|
20 |
|
---|
21 | return 0;
|
---|
22 | }
|
---|
23 |
|
---|
24 | static void
|
---|
25 | deeper (void (*f) (void))
|
---|
26 | {
|
---|
27 | char stack[1100 * 1024];
|
---|
28 | memfrob (stack, sizeof stack);
|
---|
29 | (*f) ();
|
---|
30 | memfrob (stack, sizeof stack);
|
---|
31 | }
|
---|
32 |
|
---|
33 |
|
---|
34 | #define TEST_FUNCTION do_test ()
|
---|
35 | #include "../test-skeleton.c"
|
---|
Note:
See
TracBrowser
for help on using the repository browser.