3 /* Give init non-default priority so that it runs before init_array. */
4 static void init (void) __attribute__ ((constructor (1000)));
9 write (STDOUT_FILENO
, "init\n", 5);
12 /* Give fini the same priority as init. */
13 static void fini (void) __attribute__ ((destructor (1000)));
18 write (STDOUT_FILENO
, "fini\n", 5);
24 write (STDOUT_FILENO
, "preinit array 0\n", 16);
30 write (STDOUT_FILENO
, "preinit array 1\n", 16);
36 write (STDOUT_FILENO
, "preinit array 2\n", 16);
39 void (*const preinit_array
[]) (void)
40 __attribute__ ((section (".preinit_array"), aligned (sizeof (void *)))) =
50 write (STDOUT_FILENO
, "init array 0\n", 13);
56 write (STDOUT_FILENO
, "init array 1\n", 13);
62 write (STDOUT_FILENO
, "init array 2\n", 13);
65 void (*init_array
[]) (void)
66 __attribute__ ((section (".init_array"), aligned (sizeof (void *)))) =
76 write (STDOUT_FILENO
, "fini array 0\n", 13);
82 write (STDOUT_FILENO
, "fini array 1\n", 13);
88 write (STDOUT_FILENO
, "fini array 2\n", 13);
91 void (*fini_array
[]) (void)
92 __attribute__ ((section (".fini_array"), aligned (sizeof (void *)))) =