aboutsummaryrefslogtreecommitdiff
path: root/ld/testsuite/ld-selective/2.c
diff options
context:
space:
mode:
Diffstat (limited to 'ld/testsuite/ld-selective/2.c')
-rw-r--r--ld/testsuite/ld-selective/2.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/ld/testsuite/ld-selective/2.c b/ld/testsuite/ld-selective/2.c
new file mode 100644
index 0000000..7295887
--- /dev/null
+++ b/ld/testsuite/ld-selective/2.c
@@ -0,0 +1,19 @@
+/* Normally we should loose foo and keep _start and _init.
+ With -u foo, we should keep that as well. */
+
+void _start() __asm__("_start");
+void _start()
+{
+}
+
+void __attribute__((section(".init")))
+_init()
+{
+}
+
+int foo() __asm__("foo");
+int foo()
+{
+ static int x = 1;
+ return x++;
+}