aboutsummaryrefslogtreecommitdiff
path: root/ld
diff options
context:
space:
mode:
Diffstat (limited to 'ld')
-rw-r--r--ld/testsuite/ChangeLog8
-rw-r--r--ld/testsuite/ld-gc/dummy.s1
-rw-r--r--ld/testsuite/ld-gc/gc.exp8
-rw-r--r--ld/testsuite/ld-gc/pr11218-1.c5
-rw-r--r--ld/testsuite/ld-gc/pr11218-2.c13
-rw-r--r--ld/testsuite/ld-gc/pr11218.d5
6 files changed, 40 insertions, 0 deletions
diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog
index 3a2dc34..224aa93 100644
--- a/ld/testsuite/ChangeLog
+++ b/ld/testsuite/ChangeLog
@@ -1,3 +1,11 @@
+2010-01-26 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR ld/11218
+ * ld-gc/dummy.s: New.
+ * ld-gc/pr11218-1.c: Likewise.
+ * ld-gc/pr11218-2.c: Likewise.
+ * ld-gc/pr11218.d: Likewise.
+
2010-01-23 Richard Sandiford <r.sandiford@uk.ibm.com>
* ld-powerpc/aix-ref-1-32.od, ld-powerpc/aix-ref-1-64.od,
diff --git a/ld/testsuite/ld-gc/dummy.s b/ld/testsuite/ld-gc/dummy.s
new file mode 100644
index 0000000..403f980
--- /dev/null
+++ b/ld/testsuite/ld-gc/dummy.s
@@ -0,0 +1 @@
+# Dummy
diff --git a/ld/testsuite/ld-gc/gc.exp b/ld/testsuite/ld-gc/gc.exp
index c271a3d..7005442 100644
--- a/ld/testsuite/ld-gc/gc.exp
+++ b/ld/testsuite/ld-gc/gc.exp
@@ -92,3 +92,11 @@ test_gc "Check --gc-section/-r/-u" "gcrel" $ld "-r --gc-sections -u used_func"
run_dump_test "noent"
run_dump_test "abi-note"
run_dump_test "start"
+if { [is_remote host] || [which $CC] != 0 } {
+ if { [istarget "*-*-linux*"] } {
+ ld_compile "$CC -fPIC $CFLAGS $cflags" $srcdir/$subdir/pr11218-1.c tmpdir/pr11218-1.o
+ ld_simple_link $ld tmpdir/pr11218-1.so "-shared tmpdir/pr11218-1.o"
+ ld_compile "$CC -c $CFLAGS $cflags" $srcdir/$subdir/pr11218-2.c tmpdir/pr11218-2.o
+ run_dump_test "pr11218"
+ }
+}
diff --git a/ld/testsuite/ld-gc/pr11218-1.c b/ld/testsuite/ld-gc/pr11218-1.c
new file mode 100644
index 0000000..9cc79f0
--- /dev/null
+++ b/ld/testsuite/ld-gc/pr11218-1.c
@@ -0,0 +1,5 @@
+extern void unresolved_detected_at_runtime_not_at_linktime(void);
+void foo_in_so(void)
+{
+ unresolved_detected_at_runtime_not_at_linktime();
+}
diff --git a/ld/testsuite/ld-gc/pr11218-2.c b/ld/testsuite/ld-gc/pr11218-2.c
new file mode 100644
index 0000000..2515bc6
--- /dev/null
+++ b/ld/testsuite/ld-gc/pr11218-2.c
@@ -0,0 +1,13 @@
+extern void foo_in_so(void);
+
+void call_unresolved(void)
+{
+ unresolved_detected_at_runtime_not_at_linktime();
+}
+
+int main(int argc, char *argv[])
+{
+ foo_in_so();
+
+ return 0;
+}
diff --git a/ld/testsuite/ld-gc/pr11218.d b/ld/testsuite/ld-gc/pr11218.d
new file mode 100644
index 0000000..27019a8
--- /dev/null
+++ b/ld/testsuite/ld-gc/pr11218.d
@@ -0,0 +1,5 @@
+# name: --gc-sections with shared library
+# source: dummy.s
+# ld: --gc-sections -e main tmpdir/pr11218-2.o tmpdir/pr11218-1.so
+# target: *-*-linux*
+# error: undefined reference to `unresolved_detected_at_runtime_not_at_linktime'