aboutsummaryrefslogtreecommitdiff
path: root/ld/testsuite
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2008-09-16 14:09:34 +0000
committerH.J. Lu <hjl.tools@gmail.com>2008-09-16 14:09:34 +0000
commit0a36a439ee413816df8ab88a769135076e6355f6 (patch)
tree9038090ce719b70f67aaacdbd267a4bc5aad52de /ld/testsuite
parente87d403811e6f31fde1848a31c9e1feec914b37e (diff)
downloadgdb-0a36a439ee413816df8ab88a769135076e6355f6.zip
gdb-0a36a439ee413816df8ab88a769135076e6355f6.tar.gz
gdb-0a36a439ee413816df8ab88a769135076e6355f6.tar.bz2
bfd/
2008-09-16 H.J. Lu <hongjiu.lu@intel.com> PR ld/6877 * elflink.c (_bfd_elf_merge_symbol): Allow a common symbol to override the function in a shared library. ld/testsuite/ 2008-09-16 H.J. Lu <hongjiu.lu@intel.com> PR ld/6877 * ld-elf/comm1.c: New. * ld-elf/func1.c: Likewise. * ld-elf/shared.exp: Add tests for libfunc1.so and comm1.
Diffstat (limited to 'ld/testsuite')
-rw-r--r--ld/testsuite/ChangeLog8
-rw-r--r--ld/testsuite/ld-elf/comm1.c17
-rw-r--r--ld/testsuite/ld-elf/func1.c2
-rw-r--r--ld/testsuite/ld-elf/shared.exp12
4 files changed, 39 insertions, 0 deletions
diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog
index a2c3050..cc898e6 100644
--- a/ld/testsuite/ChangeLog
+++ b/ld/testsuite/ChangeLog
@@ -1,3 +1,11 @@
+2008-09-16 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR ld/6877
+ * ld-elf/comm1.c: New.
+ * ld-elf/func1.c: Likewise.
+
+ * ld-elf/shared.exp: Add tests for libfunc1.so and comm1.
+
2008-08-26 Nick Clifton <nickc@redhat.com>
* ld-arm/arm-elf.exp: Add farcall-thumb-arm-short test.
diff --git a/ld/testsuite/ld-elf/comm1.c b/ld/testsuite/ld-elf/comm1.c
new file mode 100644
index 0000000..c553d86
--- /dev/null
+++ b/ld/testsuite/ld-elf/comm1.c
@@ -0,0 +1,17 @@
+#include <stdio.h>
+#include <stdlib.h>
+
+int foo;
+void bar (void);
+
+int
+main ()
+{
+ if (foo != 0)
+ abort ();
+ foo = 200;
+ bar ();
+ if (foo == 200)
+ printf ("PASS\n");
+ return 0;
+}
diff --git a/ld/testsuite/ld-elf/func1.c b/ld/testsuite/ld-elf/func1.c
new file mode 100644
index 0000000..99443e4
--- /dev/null
+++ b/ld/testsuite/ld-elf/func1.c
@@ -0,0 +1,2 @@
+void foo (void) { }
+void bar (void) { }
diff --git a/ld/testsuite/ld-elf/shared.exp b/ld/testsuite/ld-elf/shared.exp
index 846027e..f0bc403 100644
--- a/ld/testsuite/ld-elf/shared.exp
+++ b/ld/testsuite/ld-elf/shared.exp
@@ -123,6 +123,12 @@ set build_tests {
{"Build libdata1.so"
"-shared" "-fPIC"
{data1.c} {} "libdata1.so"}
+ {"Build libcomm1.o"
+ "-r -nostdlib" ""
+ {comm1.c} {} "libcomm1.o"}
+ {"Build libfunc1.so"
+ "-shared" "-fPIC"
+ {func1.c} {} "libfunc1.so"}
}
set run_tests {
@@ -235,6 +241,12 @@ set run_tests {
{"Run with libdata1.so"
"tmpdir/libdata1.so" ""
{dynbss1.c} "dynbss1" "pass.out"}
+ {"Run with libfunc1.so comm1.o"
+ "tmpdir/libfunc1.so tmpdir/comm1.o" ""
+ {dummy.c} "comm1" "pass.out"}
+ {"Run with comm1.o libfunc1.so"
+ "tmpdir/comm1.o tmpdir/libfunc1.so" ""
+ {dummy.c} "comm1" "pass.out"}
}
run_cc_link_tests $build_tests