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