diff options
author | Hans-Peter Nilsson <hp@axis.com> | 2008-12-23 11:45:25 +0000 |
---|---|---|
committer | Hans-Peter Nilsson <hp@axis.com> | 2008-12-23 11:45:25 +0000 |
commit | 8d98a59075cb0adce69648c067e6020c727a3deb (patch) | |
tree | 03d8f3bdbc2841d13409be13955269220586904d /ld/testsuite/ld-cris | |
parent | 0aef98d79a6753b5d5e289fefc03d1b41dae5969 (diff) | |
download | binutils-redhat-8d98a59075cb0adce69648c067e6020c727a3deb.tar.gz |
* lib/ld-lib.exp (run_dump_test): New option ld_after_inputfiles.
* ld-cris/libdso-1c.d, ld-cris/expdref2.s, ld-cris/libdso-15b.d,
ld-cris/expdyn1w.s, ld-cris/libdso-1d.d, ld-cris/tls-ie-78.d: New
tests.
Diffstat (limited to 'ld/testsuite/ld-cris')
-rw-r--r-- | ld/testsuite/ld-cris/expdref2.s | 11 | ||||
-rw-r--r-- | ld/testsuite/ld-cris/expdyn1w.s | 3 | ||||
-rw-r--r-- | ld/testsuite/ld-cris/libdso-15b.d | 36 | ||||
-rw-r--r-- | ld/testsuite/ld-cris/libdso-1c.d | 35 | ||||
-rw-r--r-- | ld/testsuite/ld-cris/libdso-1d.d | 36 | ||||
-rw-r--r-- | ld/testsuite/ld-cris/tls-ie-78.d | 44 |
6 files changed, 165 insertions, 0 deletions
diff --git a/ld/testsuite/ld-cris/expdref2.s b/ld/testsuite/ld-cris/expdref2.s new file mode 100644 index 0000000000..424e90ccad --- /dev/null +++ b/ld/testsuite/ld-cris/expdref2.s @@ -0,0 +1,11 @@ + .text + .global x + .type x,@function +x: + move.d expobj2:GOT,$r10 + move.d expobj2:PLT,$r10 + move.d expfn2:GOT,$r10 + move.d expfn2:PLT,$r10 +.Lfe1: + .size x,.Lfe1-x + diff --git a/ld/testsuite/ld-cris/expdyn1w.s b/ld/testsuite/ld-cris/expdyn1w.s new file mode 100644 index 0000000000..35d36db595 --- /dev/null +++ b/ld/testsuite/ld-cris/expdyn1w.s @@ -0,0 +1,3 @@ + .weak expobj + .weak expfn + .include "expdyn1.s" diff --git a/ld/testsuite/ld-cris/libdso-15b.d b/ld/testsuite/ld-cris/libdso-15b.d new file mode 100644 index 0000000000..0f14c5ea83 --- /dev/null +++ b/ld/testsuite/ld-cris/libdso-15b.d @@ -0,0 +1,36 @@ +#source: expdref2.s +#as: --pic --no-underscore --em=criself +#ld: --shared -m crislinux +#ld_after_inputfiles: tmpdir/libdso-15.so +#objdump: -s -T + +# A DSO that refers to two symbols in another DSO with +# GOT/PLT-generating relocs, using weak aliases where the strong +# definition is also in the other DSO. +# There was a bug causing GOT markups to be during symbol handling, +# with a newly added assertion failure and a reloc turned R_CRIS_NONE. + +.*: file format elf32-cris + +DYNAMIC SYMBOL TABLE: +#... +0+ w[ ]+DO \*UND\*[ ]+0+ TST3[ ]+__expobj2 +#... +0+[ ]+DO \*UND\*[ ]+0+ TST3[ ]+expobj2 +0+[ ]+DF \*UND\*[ ]+0+ TST3[ ]+expfn2 +#... +Contents of section .rela.dyn: + 01d4 fc220000 0a040000 00000000 00230000 .* + 01e4 0a050000 00000000 .* +Contents of section .plt: + 01ec fce17e7e 0401307a 08013009 00000000 .* + 01fc 00000000 6f0d0c00 00003009 3f7e0000 .* + 020c 00002ffe ecffffff 6f0d1000 00003009 .* + 021c 3f7e0000 00002ffe ecffffff .* +Contents of section .text: + 0228 6fae0c00 00006fae ccffffff 6fae1000 .* + 0238 00006fae d4ffffff .* +#... +Contents of section .got: + 22f0 40220000 00000000 00000000 00000000 .* + 2300 00000000 .* diff --git a/ld/testsuite/ld-cris/libdso-1c.d b/ld/testsuite/ld-cris/libdso-1c.d new file mode 100644 index 0000000000..066d5e2e56 --- /dev/null +++ b/ld/testsuite/ld-cris/libdso-1c.d @@ -0,0 +1,35 @@ +#source: expdref1.s +#as: --pic --no-underscore --em=criself -I$srcdir/$subdir +#ld: --shared -m crislinux +#ld_after_inputfiles: tmpdir/libdso-1b.so +#objdump: -s -T + +# A DSO linked to another DSO that has two versioned symbols, to which +# this DSO refers with two relocs each, a GOT and a PLT reference. +# There was a bug such that GOT markups were lost, resulting in wrong +# offsets into the GOT, with a tell-tale sign being one or more +# R_CRIS_NONE relocs. There should be two GOT relocs here, one each +# for the symbols. + +.*: file format elf32-cris + +DYNAMIC SYMBOL TABLE: +#... +0+[ ]+DF \*UND\* 0+[ ]+TST2[ ]+expobj +0+[ ]+DF \*UND\* 0+[ ]+TST2[ ]+expfn +#... +Contents of section .rela.dyn: + 01a4 cc220000 0a030000 00000000 d0220000 .* + 01b4 0a040000 00000000 .* +Contents of section .plt: + 01bc fce17e7e 0401307a 08013009 00000000 .* + 01cc 00000000 6f0d0c00 00003009 3f7e0000 .* + 01dc 00002ffe ecffffff 6f0d1000 00003009 .* + 01ec 3f7e0000 00002ffe ecffffff .* +Contents of section .text: + 01f8 6fae0c00 00006fae ccffffff 6fae1000 .* + 0208 00006fae d4ffffff .* +#... +Contents of section .got: + 22c0 10220000 00000000 00000000 00000000 .* + 22d0 00000000 .* diff --git a/ld/testsuite/ld-cris/libdso-1d.d b/ld/testsuite/ld-cris/libdso-1d.d new file mode 100644 index 0000000000..47721de17d --- /dev/null +++ b/ld/testsuite/ld-cris/libdso-1d.d @@ -0,0 +1,36 @@ +#source: expdref1.s +#source: expdyn1w.s +#as: --pic --no-underscore --em=criself -I$srcdir/$subdir +#ld: --shared -m crislinux +#ld_after_inputfiles: tmpdir/libdso-1b.so +#objdump: -s -T + +# A DSO linked to another DSO that has two versioned symbols, to which +# this DSO refers with two relocs each, a GOT and a PLT reference. +# This DSO has weak definitions of those symbols. + +.*: file format elf32-cris + +DYNAMIC SYMBOL TABLE: +#... +0+1f2 w DF .text 0+2 expfn +0+22a0 w DO .data 0+4 expobj +#... +Contents of section .rela.dyn: + 0184 98220000 0a020000 00000000 9c220000 .* + 0194 0a030000 00000000 .* +Contents of section .plt: + 019c fce17e7e 0401307a 08013009 00000000 .* + 01ac 00000000 6f0d0c00 00003009 3f7e0000 .* + 01bc 00002ffe ecffffff 6f0d1000 00003009 .* + 01cc 3f7e0000 00002ffe ecffffff .* +Contents of section .text: + 01d8 6fae1000 00006fae e0ffffff 6fae0c00 .* + 01e8 00006fae c0ffffff 0f050f05 .* +Contents of section .dynamic: +#... +Contents of section .got: + 228c f4210000 00000000 00000000 00000000 .* + 229c 00000000 .* +Contents of section .data: + 22a0 00000000 .* diff --git a/ld/testsuite/ld-cris/tls-ie-78.d b/ld/testsuite/ld-cris/tls-ie-78.d new file mode 100644 index 0000000000..3994df8cd4 --- /dev/null +++ b/ld/testsuite/ld-cris/tls-ie-78.d @@ -0,0 +1,44 @@ +#source: start1.s +#source: tls128.s +#source: tls-ie-8e.s +#as: --no-underscore --em=criself +#ld: -m crislinux +#ld_after_inputfiles: tmpdir/tls-dso-xz-1.so +#objdump: -s -h -t -T -R -r -p + +# Check that we have proper NPTL/TLS markings and GOT for a +# R_CRIS_32_IE, for an executable, symbol defined elsewhere. + +.*: file format elf32-cris + +Program Header: +#... + TLS off .* + filesz 0x0+80 memsz 0x0+80 flags r-- + +Dynamic Section: + NEEDED tmpdir/tls-dso-xz-1.so +#... +private flags = 0: +#... + 8 .got[ ]+0+10 .* + CONTENTS, ALLOC, LOAD, DATA +SYMBOL TABLE: +#... +0+ \*UND\* 0+ x +#... +DYNAMIC SYMBOL TABLE: +0+ D \*UND\* 0+ x +#... +DYNAMIC RELOCATION RECORDS +OFFSET TYPE VALUE +0+822d4 R_CRIS_32_TPREL x + +Contents of section .interp: +#... +Contents of section \.text: + 801bc 41b20000 6faed422 08000000 .* +Contents of section \.tdata: +#... +Contents of section \.got: + 822c8 48220800 00000000 00000000 00000000 .* |