]> git.ipfire.org Git - thirdparty/glibc.git/blame - elf/tst-execstack-prog.c
install.texi: Build was tested with binutils 2.41 (just released)
[thirdparty/glibc.git] / elf / tst-execstack-prog.c
CommitLineData
c70ba488
RM
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
11static void deeper (void (*f) (void));
12
13static int
14do_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
24static void
25deeper (void (*f) (void))
26{
27 char stack[1100 * 1024];
2c6cabb3 28 explicit_bzero (stack, sizeof stack);
c70ba488
RM
29 (*f) ();
30 memfrob (stack, sizeof stack);
31}
32
36fe25fd 33#include <support/test-driver.c>