]> git.ipfire.org Git - thirdparty/glibc.git/blame - elf/tst-array5dep.c
elf: Refuse to dlopen PIE objects [BZ #24323]
[thirdparty/glibc.git] / elf / tst-array5dep.c
CommitLineData
04395c90
UD
1#include <string.h>
2#include <unistd.h>
3
4static void
5init_0 (int argc __attribute__ ((unused)), char **argv)
6{
7 char *p = strrchr (argv [0], '/');
8
9 if (p == NULL)
10 return;
11
12 p++;
13 size_t len = strlen (p);
14 write (STDOUT_FILENO, "init array in DSO: ", 19);
15 write (STDOUT_FILENO, p, len);
16 write (STDOUT_FILENO, "\n", 1);
17}
18
19void (*const init_array []) (int, char **)
20 __attribute__ ((section (".init_array"), aligned (sizeof (void *)))) =
21{
22 &init_0,
23};