Fix alignment of AVX safe area on x86-64.
[glibc.git] / elf / tst-array1.c
blob4d78db6167126db6d16b8f54c6144586dfb26fd6
1 #include <unistd.h>
3 static void init (void) __attribute__ ((constructor));
5 static void
6 init (void)
8 write (STDOUT_FILENO, "init\n", 5);
11 static void fini (void) __attribute__ ((destructor));
13 static void
14 fini (void)
16 write (STDOUT_FILENO, "fini\n", 5);
19 static void
20 preinit_0 (void)
22 write (STDOUT_FILENO, "preinit array 0\n", 16);
25 static void
26 preinit_1 (void)
28 write (STDOUT_FILENO, "preinit array 1\n", 16);
31 static void
32 preinit_2 (void)
34 write (STDOUT_FILENO, "preinit array 2\n", 16);
37 void (*const preinit_array []) (void)
38 __attribute__ ((section (".preinit_array"), aligned (sizeof (void *)))) =
40 &preinit_0,
41 &preinit_1,
42 &preinit_2
45 static void
46 init_0 (void)
48 write (STDOUT_FILENO, "init array 0\n", 13);
51 static void
52 init_1 (void)
54 write (STDOUT_FILENO, "init array 1\n", 13);
57 static void
58 init_2 (void)
60 write (STDOUT_FILENO, "init array 2\n", 13);
63 void (*const init_array []) (void)
64 __attribute__ ((section (".init_array"), aligned (sizeof (void *)))) =
66 &init_0,
67 &init_1,
68 &init_2
71 static void
72 fini_0 (void)
74 write (STDOUT_FILENO, "fini array 0\n", 13);
77 static void
78 fini_1 (void)
80 write (STDOUT_FILENO, "fini array 1\n", 13);
83 static void
84 fini_2 (void)
86 write (STDOUT_FILENO, "fini array 2\n", 13);
89 void (*const fini_array []) (void)
90 __attribute__ ((section (".fini_array"), aligned (sizeof (void *)))) =
92 &fini_0,
93 &fini_1,
94 &fini_2
97 int
98 main (void)
100 return 0;