diff options
author | Hans-Peter Nilsson <hp@axis.com> | 2009-01-19 17:33:26 +0000 |
---|---|---|
committer | Hans-Peter Nilsson <hp@axis.com> | 2009-01-19 17:33:26 +0000 |
commit | 63f2573fe476336550cf141d09a62bc1a349eba2 (patch) | |
tree | 3ef1faf51e4b4473ed3ac265433c40e63995a40e | |
parent | 451ffe6311473a8d39ae45944c7fa97f3fbc0ed9 (diff) | |
download | fsf-binutils-gdb-63f2573fe476336550cf141d09a62bc1a349eba2.zip fsf-binutils-gdb-63f2573fe476336550cf141d09a62bc1a349eba2.tar.gz fsf-binutils-gdb-63f2573fe476336550cf141d09a62bc1a349eba2.tar.bz2 |
* ld-cris/expdref3.s, ld-cris/expdref4.s, ld-cris/weakref3.d,
ld-cris/weakref4.d: New tests.
* ld-cris/libdso-15b.d: Adjust for recent weakref fix.
-rw-r--r-- | ld/testsuite/ChangeLog | 6 | ||||
-rw-r--r-- | ld/testsuite/ld-cris/expdref3.s | 9 | ||||
-rw-r--r-- | ld/testsuite/ld-cris/expdref4.s | 7 | ||||
-rw-r--r-- | ld/testsuite/ld-cris/libdso-15b.d | 4 | ||||
-rw-r--r-- | ld/testsuite/ld-cris/weakref3.d | 36 | ||||
-rw-r--r-- | ld/testsuite/ld-cris/weakref4.d | 32 |
6 files changed, 93 insertions, 1 deletions
diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog index 3c9fac7..ee3615b 100644 --- a/ld/testsuite/ChangeLog +++ b/ld/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2009-01-19 Hans-Peter Nilsson <hp@axis.com> + + * ld-cris/expdref3.s, ld-cris/expdref4.s, ld-cris/weakref3.d, + ld-cris/weakref4.d: New tests. + * ld-cris/libdso-15b.d: Adjust for recent weakref fix. + 2009-01-19 H.J. Lu <hongjiu.lu@intel.com> * ld-elf/group9.s: Replace .byte with .long. diff --git a/ld/testsuite/ld-cris/expdref3.s b/ld/testsuite/ld-cris/expdref3.s new file mode 100644 index 0000000..dd35893 --- /dev/null +++ b/ld/testsuite/ld-cris/expdref3.s @@ -0,0 +1,9 @@ + .text + .global x + .type x,@function +x: + move.d expobj2,$r10 + move.d expfn2,$r10 +.Lfe1: + .size x,.Lfe1-x + diff --git a/ld/testsuite/ld-cris/expdref4.s b/ld/testsuite/ld-cris/expdref4.s new file mode 100644 index 0000000..e639039 --- /dev/null +++ b/ld/testsuite/ld-cris/expdref4.s @@ -0,0 +1,7 @@ + .data + .global x + .type x,@object +x: + .dword expobj2 +.Lfe1: + .size x,.Lfe1-x diff --git a/ld/testsuite/ld-cris/libdso-15b.d b/ld/testsuite/ld-cris/libdso-15b.d index 0f14c5e..308b110 100644 --- a/ld/testsuite/ld-cris/libdso-15b.d +++ b/ld/testsuite/ld-cris/libdso-15b.d @@ -9,12 +9,14 @@ # 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. +# The dynamic __expobj2 entry is unused and seems spurious, or there +# should at least be a similar __expfn2 reference .*: file format elf32-cris DYNAMIC SYMBOL TABLE: #... -0+ w[ ]+DO \*UND\*[ ]+0+ TST3[ ]+__expobj2 +0+[ ]+DO \*UND\*[ ]+0+ TST3[ ]+__expobj2 #... 0+[ ]+DO \*UND\*[ ]+0+ TST3[ ]+expobj2 0+[ ]+DF \*UND\*[ ]+0+ TST3[ ]+expfn2 diff --git a/ld/testsuite/ld-cris/weakref3.d b/ld/testsuite/ld-cris/weakref3.d new file mode 100644 index 0000000..492ef41 --- /dev/null +++ b/ld/testsuite/ld-cris/weakref3.d @@ -0,0 +1,36 @@ +#source: start1.s +#source: expdref3.s +#as: --no-underscore --em=criself +#ld: -m crislinux +#ld_after_inputfiles: tmpdir/libdso-15.so +#readelf: -a -x 10 + +# Like libdso-15b.d, but referencing the weak symbol and function from +# a program. At some time we broke emitting a copy reloc for the +# object, instead yielding NULL. + +#... + \[[0-9]+\] .got PROGBITS 0+82314 000314 000010 04 WA 0 0 4 +#... + \[[0-9]+\] .bss NOBITS 0+82324 .* +#... +Relocation section '.rela.dyn' at offset 0x... contains 1 entries: + Offset Info Type Sym.Value Sym. Name \+ Addend +00082324 00000109 R_CRIS_COPY 00082324 __expobj2 \+ 0 + +Relocation section '.rela.plt' at offset 0x... contains 1 entries: + Offset Info Type Sym.Value Sym. Name \+ Addend +00082320 0000030b R_CRIS_JUMP_SLOT 00080238 expfn2 \+ 0 + +There are no unwind sections in this file. + +Symbol table '.dynsym' contains . entries: +#... + .: 00082324 4 OBJECT GLOBAL DEFAULT 13 __expobj2@TST3 \(2\) +#... + .: 00080238 0 FUNC GLOBAL DEFAULT UND expfn2@TST3 \(2\) +#... +Symbol table '.symtab' contains .. entries: +#... +Hex dump of section '\.text': + 0x0008024c 41b20000 6fae2423 08006fae 38020800 .* diff --git a/ld/testsuite/ld-cris/weakref4.d b/ld/testsuite/ld-cris/weakref4.d new file mode 100644 index 0000000..8b19f2f --- /dev/null +++ b/ld/testsuite/ld-cris/weakref4.d @@ -0,0 +1,32 @@ +#source: start1.s +#source: expdref4.s +#as: --no-underscore --em=criself +#ld: -m crislinux +#ld_after_inputfiles: tmpdir/libdso-15.so +#readelf: -a -x 11 + +# Like weakref3.d, but just the expobj2 referenced from .data. We +# should avoid a copy reloc (instead emitting a R_CRIS_GLOB_DAT or +# R_CRIS_32 against the weak symbol), but for the time being, make +# sure we get a valid reloc. + +#... + \[[0-9]+\] .data PROGBITS 0+822a4 0002a4 000004 00 WA 0 0 1 +#... + \[[0-9]+\] .bss NOBITS 0+822a8 .* +#... +Relocation section '.rela.dyn' at offset 0x... contains 1 entries: +#... +000822a8 00000109 R_CRIS_COPY 000822a8 __expobj2 \+ 0 + +There are no unwind sections in this file. + +Symbol table '.dynsym' contains . entries: +#... + .: 000822a8 4 OBJECT GLOBAL DEFAULT 12 __expobj2@TST3 \(2\) +#... +Symbol table '.symtab' contains .. entries: +#... +Hex dump of section '.data': + 0x000822a4 a8220800 .* + |