From: H.J. Lu Date: Wed, 18 Oct 2006 16:23:24 +0000 (+0000) Subject: 2006-10-18 H.J. Lu X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=c555238b1a3f4e1e23a83d68a18bf6d1170572d0;p=binutils-gdb.git 2006-10-18 H.J. Lu * ld-elf/dl4.c: New file. * ld-elf/dl4.list: Likewise. * ld-elf/dl4a.out: Likewise. * ld-elf/dl4b.out: Likewise. * ld-elf/dl4main.c: Likewise. * ld-elf/dl4xxx.c: Likewise. * ld-elf/dl4xxx.list: Likewise. * ld-elf/shared.exp (build_tests): Add libdl4a.so and libdl4b.so. (run_tests): Likewise. --- diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog index 89c147b09a4..528e7b448ac 100644 --- a/ld/testsuite/ChangeLog +++ b/ld/testsuite/ChangeLog @@ -1,3 +1,17 @@ +2006-10-18 H.J. Lu + + * ld-elf/dl4.c: New file. + * ld-elf/dl4.list: Likewise. + * ld-elf/dl4a.out: Likewise. + * ld-elf/dl4b.out: Likewise. + * ld-elf/dl4main.c: Likewise. + * ld-elf/dl4xxx.c: Likewise. + * ld-elf/dl4xxx.list: Likewise. + + * ld-elf/shared.exp (build_tests): Add libdl4a.so and + libdl4b.so. + (run_tests): Likewise. + 2006-10-18 Richard Sandiford * ld-mips-elf/reloc-1-n64.d: Match 16-character VMAs on LP64 hosts. diff --git a/ld/testsuite/ld-elf/dl4.c b/ld/testsuite/ld-elf/dl4.c new file mode 100644 index 00000000000..bf6f070cb75 --- /dev/null +++ b/ld/testsuite/ld-elf/dl4.c @@ -0,0 +1,24 @@ +#include + +int foo1; +int foo2; + +extern void xxx1 (void); +extern void xxx2 (void); + +void +bar (int x) +{ + if (foo1 == 1) + printf ("bar OK1\n"); + else if (foo1 == 0) + printf ("bar OK2\n"); + if (foo2 == 1) + printf ("bar OK3\n"); + else if (foo2 == 0) + printf ("bar OK4\n"); + foo1 = -1; + foo2 = -1; + xxx1 (); + xxx2 (); +} diff --git a/ld/testsuite/ld-elf/dl4.list b/ld/testsuite/ld-elf/dl4.list new file mode 100644 index 00000000000..e932e2352e3 --- /dev/null +++ b/ld/testsuite/ld-elf/dl4.list @@ -0,0 +1,4 @@ +{ + foo1; + foo2; +}; diff --git a/ld/testsuite/ld-elf/dl4a.out b/ld/testsuite/ld-elf/dl4a.out new file mode 100644 index 00000000000..871c5be830a --- /dev/null +++ b/ld/testsuite/ld-elf/dl4a.out @@ -0,0 +1,6 @@ +bar OK1 +bar OK3 +DSO1 +DSO2 +OK1 +OK3 diff --git a/ld/testsuite/ld-elf/dl4b.out b/ld/testsuite/ld-elf/dl4b.out new file mode 100644 index 00000000000..b838f5b4b7f --- /dev/null +++ b/ld/testsuite/ld-elf/dl4b.out @@ -0,0 +1,6 @@ +bar OK1 +bar OK3 +MAIN1 +MAIN2 +OK1 +OK3 diff --git a/ld/testsuite/ld-elf/dl4main.c b/ld/testsuite/ld-elf/dl4main.c new file mode 100644 index 00000000000..173450da1a8 --- /dev/null +++ b/ld/testsuite/ld-elf/dl4main.c @@ -0,0 +1,34 @@ +#include + +extern int foo1; +extern int foo2; +extern void bar (void); + +void +xxx1 (void) +{ + printf ("MAIN1\n"); +} + +void +xxx2 (void) +{ + printf ("MAIN2\n"); +} + +int +main (void) +{ + foo1 = 1; + foo2 = 1; + bar (); + if (foo1 == -1) + printf ("OK1\n"); + else if (foo1 == 1) + printf ("OK2\n"); + if (foo2 == -1) + printf ("OK3\n"); + else if (foo2 == 1) + printf ("OK4\n"); + return 0; +} diff --git a/ld/testsuite/ld-elf/dl4xxx.c b/ld/testsuite/ld-elf/dl4xxx.c new file mode 100644 index 00000000000..8180eb14129 --- /dev/null +++ b/ld/testsuite/ld-elf/dl4xxx.c @@ -0,0 +1,13 @@ +#include + +void +xxx1 (void) +{ + printf ("DSO1\n"); +} + +void +xxx2 (void) +{ + printf ("DSO2\n"); +} diff --git a/ld/testsuite/ld-elf/dl4xxx.list b/ld/testsuite/ld-elf/dl4xxx.list new file mode 100644 index 00000000000..f39ce14d01a --- /dev/null +++ b/ld/testsuite/ld-elf/dl4xxx.list @@ -0,0 +1,4 @@ +{ + xxx1; + xxx2; +}; diff --git a/ld/testsuite/ld-elf/shared.exp b/ld/testsuite/ld-elf/shared.exp index 3090551f781..ff330a45002 100644 --- a/ld/testsuite/ld-elf/shared.exp +++ b/ld/testsuite/ld-elf/shared.exp @@ -75,6 +75,12 @@ set build_tests { {"Build libdl2b.so with --dynamic-list=dl2.list and dl2xxx.list" "-shared -Wl,--dynamic-list=dl2.list,--dynamic-list=dl2xxx.list" "-fPIC" {dl2.c dl2xxx.c} {} "libdl2b.so"} + {"Build libdl4a.so with --dynamic-list=dl4.list" + "-shared -Wl,--dynamic-list=dl4.list" "-fPIC" + {dl4.c dl4xxx.c} {} "libdl4a.so"} + {"Build libdl4b.so with --dynamic-list=dl4.list and dl4xxx.list" + "-shared -Wl,--dynamic-list=dl4.list,--dynamic-list=dl4xxx.list" "-fPIC" + {dl4.c dl4xxx.c} {} "libdl4b.so"} } set run_tests { @@ -123,6 +129,12 @@ set run_tests { {"Run with libdl2b.so" "tmpdir/libdl2b.so" "" {dl2main.c} "dl2b" "dl2b.out"} + {"Run with libdl4a.so" + "tmpdir/libdl4a.so" "" + {dl4main.c} "dl4a" "dl4a.out"} + {"Run with libdl4b.so" + "tmpdir/libdl4b.so" "" + {dl4main.c} "dl4b" "dl4b.out"} } run_cc_link_tests $build_tests