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, "DSO init\n", 9);
12 /* Give fini the same priority as init. */
13 static void fini (void) __attribute__ ((destructor (1000)));
18 write (STDOUT_FILENO, "DSO fini\n", 9);
24 write (STDOUT_FILENO, "DSO init array 0\n", 17);
30 write (STDOUT_FILENO, "DSO init array 1\n", 17);
36 write (STDOUT_FILENO, "DSO init array 2\n", 17);
39 void (*init_array []) (void)
40 __attribute__ ((section (".init_array"), aligned (sizeof (void *)))) =
50 write (STDOUT_FILENO, "DSO fini array 0\n", 17);
56 write (STDOUT_FILENO, "DSO fini array 1\n", 17);
62 write (STDOUT_FILENO, "DSO fini array 2\n", 17);
65 void (*fini_array []) (void)
66 __attribute__ ((section (".fini_array"), aligned (sizeof (void *)))) =