about summary refs log tree commit diff
path: root/elf/tst-initorder2.c
diff options
context:
space:
mode:
authorAndreas Schwab <schwab@redhat.com>2011-08-22 16:08:16 -0400
committerUlrich Drepper <drepper@gmail.com>2011-08-22 16:08:16 -0400
commite888bcbe4fb8ad538ec640bfb18b687d51e001e7 (patch)
tree95d9ee2186182388c15bd6245d4b1cf702ec34c2 /elf/tst-initorder2.c
parent91b392a4bab0c2dc90e7e3ff914dec20b97adca8 (diff)
downloadglibc-e888bcbe4fb8ad538ec640bfb18b687d51e001e7.tar.gz
glibc-e888bcbe4fb8ad538ec640bfb18b687d51e001e7.tar.xz
glibc-e888bcbe4fb8ad538ec640bfb18b687d51e001e7.zip
Correct cycle detection during dependency sorting
Diffstat (limited to 'elf/tst-initorder2.c')
-rw-r--r--elf/tst-initorder2.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/elf/tst-initorder2.c b/elf/tst-initorder2.c
new file mode 100644
index 0000000000..050f9568b8
--- /dev/null
+++ b/elf/tst-initorder2.c
@@ -0,0 +1,20 @@
+#include <stdio.h>
+
+#ifndef NAME
+int
+main (void)
+{
+  puts ("main");
+}
+#else
+static void __attribute__ ((constructor))
+init (void)
+{
+  puts ("init: " NAME);
+}
+static void __attribute__ ((destructor))
+fini (void)
+{
+  puts ("fini: " NAME);
+}
+#endif