diff options
Diffstat (limited to 'elf/tst-array1.c')
-rw-r--r-- | elf/tst-array1.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/elf/tst-array1.c b/elf/tst-array1.c index ca9bdf4079..e998932b36 100644 --- a/elf/tst-array1.c +++ b/elf/tst-array1.c @@ -1,6 +1,7 @@ #include <unistd.h> -static void init (void) __attribute__ ((constructor)); +/* Give init non-default priority so that it runs before init_array. */ +static void init (void) __attribute__ ((constructor (1000))); static void init (void) @@ -8,7 +9,8 @@ init (void) write (STDOUT_FILENO, "init\n", 5); } -static void fini (void) __attribute__ ((destructor)); +/* Give fini the same priority as init. */ +static void fini (void) __attribute__ ((destructor (1000))); static void fini (void) |