* 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-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
2001-09-11 H.J. Lu <hjl@gnu.org>
* ld-elfweak/elfweak.exp (build_lib): Take a list of object
#include <stdio.h>
extern void foo ();
#include <stdio.h>
extern void foo ();
void
foo ()
{
printf ("strong foo\n");
}
void
foo ()
{
printf ("strong foo\n");
}
+
+void
+foobar ()
+{
+ foo ();
+}
-#pragma weak deallocate_foo
+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");
+}
+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 "*-*-*"
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 "*-*-*"
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" 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
-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
-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
-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" 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 ""
-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 ""
-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 ""
-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 ""
#pragma weak foo
extern void foo ();
#pragma weak foo
extern void foo ();
#pragma weak deallocate_foo
int deallocate_foo = 1;
#pragma weak deallocate_foo
int deallocate_foo = 1;
-extern int * bar ();
-extern int * foo ();
-extern void abort ();
- if (&deallocate_foo != bar () || &deallocate_foo != foo ())
- abort ();
-
- if (deallocate_foo)
- printf ("weak deallocate_foo\n");
- else
- printf ("strong deallocate_foo\n");
-
[0-9a-f]*[ ]+w[ ]+DO[ ]+.data[ ]+[0-9a-f]*[ ]+(Base[ ]+|[ ]*)deallocate_foo
[0-9a-f]*[ ]+w[ ]+DO[ ]+.data[ ]+[0-9a-f]*[ ]+(Base[ ]+|[ ]*)deallocate_foo
-[0-9a-f]*[ ]+DF[ ]+\*UND\*[ ]+[0-9a-f]*[ ]+(Base[ ]+|[ ]*)foo