aboutsummaryrefslogtreecommitdiff
path: root/elf/tst-array2dep.c
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2012-11-16 06:49:38 -0800
committerH.J. Lu <hjl.tools@gmail.com>2012-11-16 06:49:38 -0800
commit224cb1349151189a864e6b64be01966da1164374 (patch)
tree88f6955b6c5977454d84d4f93cfd2f69b6f1bec8 /elf/tst-array2dep.c
parentd14fbb177ac9a604b38d51034c6c61271d0df0db (diff)
downloadglibc-hjl/init.zip
glibc-hjl/init.tar.gz
glibc-hjl/init.tar.bz2
Set constructor/destructor priority to 1000hjl/init
Diffstat (limited to 'elf/tst-array2dep.c')
-rw-r--r--elf/tst-array2dep.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/elf/tst-array2dep.c b/elf/tst-array2dep.c
index 2812761..2f920cd 100644
--- a/elf/tst-array2dep.c
+++ b/elf/tst-array2dep.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, "DSO init\n", 9);
}
-static void fini (void) __attribute__ ((destructor));
+/* Give fini the same priority as init. */
+static void fini (void) __attribute__ ((destructor (1000)));
static void
fini (void)