diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2006-10-18 16:23:24 +0000 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2006-10-18 16:23:24 +0000 |
commit | c555238b1a3f4e1e23a83d68a18bf6d1170572d0 (patch) | |
tree | 72c3913a5c994c7d58a18d880b7724f2f6372344 | |
parent | 92f5d02b57f259eb32c3b3499898af0d6814fead (diff) | |
download | gdb-c555238b1a3f4e1e23a83d68a18bf6d1170572d0.zip gdb-c555238b1a3f4e1e23a83d68a18bf6d1170572d0.tar.gz gdb-c555238b1a3f4e1e23a83d68a18bf6d1170572d0.tar.bz2 |
2006-10-18 H.J. Lu <hongjiu.lu@intel.com>
* 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.
-rw-r--r-- | ld/testsuite/ChangeLog | 14 | ||||
-rw-r--r-- | ld/testsuite/ld-elf/dl4.c | 24 | ||||
-rw-r--r-- | ld/testsuite/ld-elf/dl4.list | 4 | ||||
-rw-r--r-- | ld/testsuite/ld-elf/dl4a.out | 6 | ||||
-rw-r--r-- | ld/testsuite/ld-elf/dl4b.out | 6 | ||||
-rw-r--r-- | ld/testsuite/ld-elf/dl4main.c | 34 | ||||
-rw-r--r-- | ld/testsuite/ld-elf/dl4xxx.c | 13 | ||||
-rw-r--r-- | ld/testsuite/ld-elf/dl4xxx.list | 4 | ||||
-rw-r--r-- | ld/testsuite/ld-elf/shared.exp | 12 |
9 files changed, 117 insertions, 0 deletions
diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog index 89c147b..528e7b4 100644 --- a/ld/testsuite/ChangeLog +++ b/ld/testsuite/ChangeLog @@ -1,3 +1,17 @@ +2006-10-18 H.J. Lu <hongjiu.lu@intel.com> + + * 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 <richard@codesourcery.com> * 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 0000000..bf6f070 --- /dev/null +++ b/ld/testsuite/ld-elf/dl4.c @@ -0,0 +1,24 @@ +#include <stdio.h> + +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 0000000..e932e23 --- /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 0000000..871c5be --- /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 0000000..b838f5b --- /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 0000000..173450d --- /dev/null +++ b/ld/testsuite/ld-elf/dl4main.c @@ -0,0 +1,34 @@ +#include <stdio.h> + +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 0000000..8180eb1 --- /dev/null +++ b/ld/testsuite/ld-elf/dl4xxx.c @@ -0,0 +1,13 @@ +#include <stdio.h> + +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 0000000..f39ce14 --- /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 3090551..ff330a4 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 |