aboutsummaryrefslogtreecommitdiff
path: root/REORG.TODO/elf/order.c
diff options
context:
space:
mode:
Diffstat (limited to 'REORG.TODO/elf/order.c')
-rw-r--r--REORG.TODO/elf/order.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/REORG.TODO/elf/order.c b/REORG.TODO/elf/order.c
new file mode 100644
index 0000000000..ca617cbc09
--- /dev/null
+++ b/REORG.TODO/elf/order.c
@@ -0,0 +1,25 @@
+#include <unistd.h>
+
+void init (void) __attribute__ ((constructor));
+void
+__attribute__ ((constructor))
+init (void)
+{
+ write (1, "4", 1);
+}
+
+void fini (void) __attribute__ ((destructor));
+void
+__attribute__ ((destructor))
+fini (void)
+{
+ write (1, "5", 1);
+}
+
+extern int dep1 (void);
+
+int
+main (void)
+{
+ return dep1 () != 42;
+}