aboutsummaryrefslogtreecommitdiff
path: root/ld
diff options
context:
space:
mode:
Diffstat (limited to 'ld')
-rw-r--r--ld/testsuite/ChangeLog9
-rw-r--r--ld/testsuite/ld-elfweak/bar.c7
-rw-r--r--ld/testsuite/ld-elfweak/bar1a.c21
-rw-r--r--ld/testsuite/ld-elfweak/elfweak.exp21
-rw-r--r--ld/testsuite/ld-elfweak/main.c3
-rw-r--r--ld/testsuite/ld-elfweak/main1.c15
-rw-r--r--ld/testsuite/ld-elfweak/weakdata.dsym1
7 files changed, 52 insertions, 25 deletions
diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog
index 72e9cff..4512ad8 100644
--- a/ld/testsuite/ChangeLog
+++ b/ld/testsuite/ChangeLog
@@ -1,3 +1,12 @@
+2001-09-14 H.J. Lu <hjl@gnu.org>
+
+ * ld-elfweak/bar.c: Updated.
+ * ld-elfweak/bar1a.c: Likewise.
+ * ld-elfweak/main.c: Likewise.
+ * ld-elfweak/main1.c: Likewise.
+ * ld-elfweak/elfweak.exp: Likewise.
+ * ld-elfweak/weakdata.dsym: Updated.
+
2001-09-11 H.J. Lu <hjl@gnu.org>
* ld-elfweak/elfweak.exp (build_lib): Take a list of object
diff --git a/ld/testsuite/ld-elfweak/bar.c b/ld/testsuite/ld-elfweak/bar.c
index 2245e8d..6317518 100644
--- a/ld/testsuite/ld-elfweak/bar.c
+++ b/ld/testsuite/ld-elfweak/bar.c
@@ -1,9 +1,16 @@
#include <stdio.h>
extern void foo ();
+extern void foobar ();
void
foo ()
{
printf ("strong foo\n");
}
+
+void
+foobar ()
+{
+ foo ();
+}
diff --git a/ld/testsuite/ld-elfweak/bar1a.c b/ld/testsuite/ld-elfweak/bar1a.c
index 7ca1f04..daf0c58 100644
--- a/ld/testsuite/ld-elfweak/bar1a.c
+++ b/ld/testsuite/ld-elfweak/bar1a.c
@@ -1,6 +1,23 @@
-#pragma weak deallocate_foo
+#include <stdio.h>
-int deallocate_foo = 1;
+extern int deallocate_foo;
+
+extern int * bar ();
+extern int * foo ();
+extern void abort ();
+extern void foobar ();
+
+void
+foobar ()
+{
+ if (&deallocate_foo != bar () || &deallocate_foo != foo ())
+ abort ();
+
+ if (deallocate_foo)
+ printf ("weak deallocate_foo\n");
+ else
+ printf ("strong deallocate_foo\n");
+}
int *
bar()
diff --git a/ld/testsuite/ld-elfweak/elfweak.exp b/ld/testsuite/ld-elfweak/elfweak.exp
index ea751f3..bfefa11 100644
--- a/ld/testsuite/ld-elfweak/elfweak.exp
+++ b/ld/testsuite/ld-elfweak/elfweak.exp
@@ -434,6 +434,11 @@ if {![ld_link $ld $tmpdir/libfoo1b.so "$shared $tmpdir/foo1b.o"]} {
return
}
+if {![ld_link $ld $tmpdir/libbar1a.so "$shared $tmpdir/bar1a.o $tmpdir/libfoo1a.so"]} {
+ fail "ELF weak"
+ return
+}
+
build_lib "ELF DSO weak func first" libfoo "foo.o bar.o" dso.dsym
build_lib "ELF DSO weak func last" libfoo "bar.o foo.o" dso.dsym
setup_xfail "*-*-*"
@@ -450,22 +455,22 @@ build_exec "ELF weak func last DSO" foo "libbar.so main.o" "-rpath ." weak weak.
build_lib "ELF DSO weak data first" libfoo "bar1a.o foo1a.o" dsodata.dsym
build_lib "ELF DSO weak data last" libfoo "foo1a.o bar1a.o" dsodata.dsym
setup_xfail "*-*-*"
-build_lib "ELF DSO weak data first DSO" libfoo "bar1a.o libfoo1a.so" dsowdata.dsym
+build_lib "ELF DSO weak data first DSO" libfoo "main1.o libfoo1a.so" dsowdata.dsym
setup_xfail "*-*-*"
-build_lib "ELF DSO weak data last DSO" libfoo "libfoo1a.so bar1a.o" dsowdata.dsym
+build_lib "ELF DSO weak data last DSO" libfoo "libfoo1a.so main1.o" dsowdata.dsym
setup_xfail "*-*-*"
-build_lib "ELF DSO weak data first DSO common" libfoo "bar1a.o libfoo1b.so" dsowdata.dsym
+build_lib "ELF DSO weak data first DSO common" libfoo "main1.o libfoo1b.so" dsowdata.dsym
setup_xfail "*-*-*"
-build_lib "ELF DSO weak data last DSO common" libfoo "libfoo1b.so bar1a.o" dsowdata.dsym
+build_lib "ELF DSO weak data last DSO common" libfoo "libfoo1b.so main1.o" dsowdata.dsym
build_exec "ELF weak data first" foo "main1.o bar1a.o foo1a.o" "" strongdata "" strongdata.sym
build_exec "ELF weak data last" foo "foo1a.o main1.o bar1a.o" "" strongdata "" strongdata.sym
build_exec "ELF weak data first common" foo "main1.o bar1a.o foo1b.o" "" strongdata "" strongcomm.sym
build_exec "ELF weak data last common" foo "foo1b.o main1.o bar1a.o" "" strongdata "" strongcomm.sym
setup_xfail "*-*-*"
-build_exec "ELF weak data first DSO" foo "main1.o bar1a.o libfoo1a.so" "-rpath ." weakdata weakdata.dsym ""
+build_exec "ELF weak data first DSO" foo "main1.o libbar1a.so libfoo1a.so" "-rpath ." weakdata weakdata.dsym ""
setup_xfail "*-*-*"
-build_exec "ELF weak data last DSO" foo "libfoo1a.so main1.o bar1a.o" "-rpath ." weakdata weakdata.dsym ""
+build_exec "ELF weak data last DSO" foo "libfoo1a.so main1.o libbar1a.so" "-rpath ." weakdata weakdata.dsym ""
setup_xfail "*-*-*"
-build_exec "ELF weak data first DSO common" foo "main1.o bar1a.o libfoo1b.so" "-rpath ." weakdata weakdata.dsym ""
+build_exec "ELF weak data first DSO common" foo "main1.o libbar1a.so libfoo1b.so" "-rpath ." weakdata weakdata.dsym ""
setup_xfail "*-*-*"
-build_exec "ELF weak data last DSO common" foo "libfoo1b.so main1.o bar1a.o" "-rpath ." weakdata weakdata.dsym ""
+build_exec "ELF weak data last DSO common" foo "libfoo1b.so main1.o libbar1a.so" "-rpath ." weakdata weakdata.dsym ""
diff --git a/ld/testsuite/ld-elfweak/main.c b/ld/testsuite/ld-elfweak/main.c
index 9daaceb..5ea170c 100644
--- a/ld/testsuite/ld-elfweak/main.c
+++ b/ld/testsuite/ld-elfweak/main.c
@@ -3,6 +3,7 @@
#pragma weak foo
extern void foo ();
+extern void foobar ();
void
foo ()
@@ -13,6 +14,6 @@ foo ()
int
main ()
{
- foo ();
+ foobar ();
return 0;
}
diff --git a/ld/testsuite/ld-elfweak/main1.c b/ld/testsuite/ld-elfweak/main1.c
index 8a897a2..39f819e 100644
--- a/ld/testsuite/ld-elfweak/main1.c
+++ b/ld/testsuite/ld-elfweak/main1.c
@@ -1,22 +1,11 @@
-#include <stdio.h>
-
#pragma weak deallocate_foo
int deallocate_foo = 1;
-extern int * bar ();
-extern int * foo ();
-extern void abort ();
+extern void foobar ();
int
main ()
{
- if (&deallocate_foo != bar () || &deallocate_foo != foo ())
- abort ();
-
- if (deallocate_foo)
- printf ("weak deallocate_foo\n");
- else
- printf ("strong deallocate_foo\n");
-
+ foobar ();
return 0;
}
diff --git a/ld/testsuite/ld-elfweak/weakdata.dsym b/ld/testsuite/ld-elfweak/weakdata.dsym
index 4f1873b..0b5cca3 100644
--- a/ld/testsuite/ld-elfweak/weakdata.dsym
+++ b/ld/testsuite/ld-elfweak/weakdata.dsym
@@ -1,2 +1 @@
[0-9a-f]*[ ]+w[ ]+DO[ ]+.data[ ]+[0-9a-f]*[ ]+(Base[ ]+|[ ]*)deallocate_foo
-[0-9a-f]*[ ]+DF[ ]+\*UND\*[ ]+[0-9a-f]*[ ]+(Base[ ]+|[ ]*)foo