summary refs log tree commit diff
path: root/elf/dep1.c
diff options
context:
space:
mode:
Diffstat (limited to 'elf/dep1.c')
-rw-r--r--elf/dep1.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/elf/dep1.c b/elf/dep1.c
new file mode 100644
index 0000000000..49dc2a22d9
--- /dev/null
+++ b/elf/dep1.c
@@ -0,0 +1,24 @@
+#include <unistd.h>
+
+extern int dep2 (void);
+extern int dep4 (void);
+
+static void
+__attribute__ ((constructor))
+init (void)
+{
+  write (1, "3", 1);
+}
+
+static void
+__attribute__ ((destructor))
+fini (void)
+{
+  write (1, "6", 1);
+}
+
+int
+dep1 (void)
+{
+  return dep4 () - dep2 ();
+}