diff options
author | Ben Cheng <bccheng@google.com> | 2014-03-26 11:03:35 -0700 |
---|---|---|
committer | Ben Cheng <bccheng@google.com> | 2014-03-26 11:03:35 -0700 |
commit | 09797ba54abf3683ea66eedddf6afbe7653f9cb9 (patch) | |
tree | 8030b2ed79c7463c89d6da294782e9d503c84f50 /binutils-2.24/ld/testsuite/ld-cris | |
parent | 5a2caf34e4995860baf405552163df288000b7bf (diff) | |
download | toolchain_binutils-09797ba54abf3683ea66eedddf6afbe7653f9cb9.zip toolchain_binutils-09797ba54abf3683ea66eedddf6afbe7653f9cb9.tar.gz toolchain_binutils-09797ba54abf3683ea66eedddf6afbe7653f9cb9.tar.bz2 |
Initial checkin of binutils 2.24.
Change-Id: I0dfcbae6608dded6c3586bf5f4ac27e9612e70a2
Diffstat (limited to 'binutils-2.24/ld/testsuite/ld-cris')
264 files changed, 5951 insertions, 0 deletions
diff --git a/binutils-2.24/ld/testsuite/ld-cris/badgotr1.d b/binutils-2.24/ld/testsuite/ld-cris/badgotr1.d new file mode 100644 index 0000000..971a631 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/badgotr1.d @@ -0,0 +1,11 @@ +#source: gotrel1.s +#as: --pic --underscore --em=criself +#ld: -m crislinux -shared +#objdump: -dr +#error: \A[^\nc][^\n]*o: uses _-prefixed [^\nc]*\n[^\nc][^\n]* failed to merge [^\n]*\n[^\nc][^\n]* no GOT [^\n]*\n[^\nc][^\n]* Bad value\Z + +# The error regex above is supposed to not match if we get a +# SEGV, in which case we'll see "child killed: segmentation +# violation", supposedly at the beginning (seen) or end (in +# theory) of it. The input ELF type (with underscores on +# symbols) mismatches the output type (no underscores). diff --git a/binutils-2.24/ld/testsuite/ld-cris/comref1.s b/binutils-2.24/ld/testsuite/ld-cris/comref1.s new file mode 100644 index 0000000..5be25d8 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/comref1.s @@ -0,0 +1,8 @@ + .text +y: + .comm c1,4,1 + .comm c2,4,1 + .comm c3,4,1 + move.d c1,$r10 + move.d c2:GOT,$r10 + move.d c3:PLT,$r10 diff --git a/binutils-2.24/ld/testsuite/ld-cris/cris.exp b/binutils-2.24/ld/testsuite/ld-cris/cris.exp new file mode 100644 index 0000000..ebe4bff --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/cris.exp @@ -0,0 +1,56 @@ +# Expect script for ld-cris tests +# Copyright 2002, 2005, 2007, 2009 Free Software Foundation, Inc. +# +# This file is part of the GNU Binutils. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, +# MA 02110-1301, USA. +# +# Written by Hans-Peter Nilsson (hp@axis.com) +# + +if ![istarget cris-*-*] { + return +} + +set rd_test_list [lsort [glob -nocomplain $srcdir/$subdir/*.d]] + +# First, execute those tests that are named to indicate that they create a +# DSO. Copy the file from the run_dump_test "tmpdir/dump" to a unique +# expected name. +# FIXME: Add option "output: filename" to run_dump_test. +foreach atest $rd_test_list { + # We need to check against runtest_file_p too, or we'd mindlessly copy + # the last tmpdir/dump in selective test-runs. + if { [string match $srcdir/$subdir/*dso-*.d $atest] \ + && [runtest_file_p $runtests [file rootname $atest]] } { + verbose [file rootname $atest] + run_dump_test [file rootname $atest] + set cmd "cp tmpdir/dump tmpdir/[file rootname [file tail $atest]].so" + send_log "$cmd\n" + set cmdret [catch "exec $cmd" comp_output] + send_log "$comp_output\n" + # FIXME: What if it fails? Need we do something? + } +} + +# Then run the ordinary tests. This round, exclude the dso-* tests. +foreach atest $rd_test_list { + # We need to strip the ".d", but can leave the dirname. + if { ! [string match $srcdir/$subdir/*dso-*.d $atest] } { + verbose [file rootname $atest] + run_dump_test [file rootname $atest] + } +} diff --git a/binutils-2.24/ld/testsuite/ld-cris/def2.d b/binutils-2.24/ld/testsuite/ld-cris/def2.d new file mode 100644 index 0000000..ff75d88 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/def2.d @@ -0,0 +1,10 @@ +#source: start1.s +#source: stabs1.s +#source: globsymw1.s +#target: cris-*-*elf* cris-*-*aout* +#as: --em=crisaout +#ld: -mcrisaout +#objdump: -p +# Just checking that undef2 links correctly when given a symbol. +.*: file format a\.out-cris +#pass diff --git a/binutils-2.24/ld/testsuite/ld-cris/def3.d b/binutils-2.24/ld/testsuite/ld-cris/def3.d new file mode 100644 index 0000000..e1ae3c5 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/def3.d @@ -0,0 +1,10 @@ +#source: start1.s +#source: stabs1.s +#source: globsymw1.s +#target: cris-*-*elf* cris-*-*aout* +#as: --em=criself +#ld: -mcriself +#objdump: -p +# Just checking that undef3 links correctly when given a symbol. +.*: file format elf32.*-cris +#pass diff --git a/binutils-2.24/ld/testsuite/ld-cris/dso-1.s b/binutils-2.24/ld/testsuite/ld-cris/dso-1.s new file mode 100644 index 0000000..7cf9950 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/dso-1.s @@ -0,0 +1,8 @@ + .text + .global dsofn + .type dsofn,@function + .p2align 1 +dsofn: + nop +.Lfe1: + .size dsofn,.Lfe1-dsofn diff --git a/binutils-2.24/ld/testsuite/ld-cris/dso-1b.s b/binutils-2.24/ld/testsuite/ld-cris/dso-1b.s new file mode 100644 index 0000000..fc7424a --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/dso-1b.s @@ -0,0 +1,4 @@ + .include "dso-1.s" + .symver dsofn,expfn@@TST2 + .include "init.s" + .symver _init,expobj@@TST2 diff --git a/binutils-2.24/ld/testsuite/ld-cris/dso-2.s b/binutils-2.24/ld/testsuite/ld-cris/dso-2.s new file mode 100644 index 0000000..f7c38a6 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/dso-2.s @@ -0,0 +1,6 @@ + .text + .global export_1 + .type export_1,@function +export_1: + jump [$r1+dsofn:GOTPLT16] + jump [$r1+dsofn:GOTPLT] diff --git a/binutils-2.24/ld/testsuite/ld-cris/dso-3.s b/binutils-2.24/ld/testsuite/ld-cris/dso-3.s new file mode 100644 index 0000000..6610504 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/dso-3.s @@ -0,0 +1,20 @@ +; The visibility definitions here override the default +; definitions in the object where the symbols are defined. We +; check STV_HIDDEN and STV_PROTECTED with function and object +; definition respectively. This is by no means a full coverage, +; just enough to be a test-case for the bug described in +; libdso-3.d. Use ld-elfvsb for general visibility tests. + + .hidden expobj + .protected expfn + + .text + .global globsym + .type globsym,@function +globsym: + move.d expfn:GOTOFF,$r3 + move.d expfn:PLTG,$r3 + move.d expfn:PLT,$r3 + move.d expobj:GOTOFF,$r3 +.Lfe1: + .size globsym,.Lfe1-globsym diff --git a/binutils-2.24/ld/testsuite/ld-cris/dso-pltdis1.d b/binutils-2.24/ld/testsuite/ld-cris/dso-pltdis1.d new file mode 100644 index 0000000..4bc3c70 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/dso-pltdis1.d @@ -0,0 +1,61 @@ +#source: dsov32-1.s +#source: dsov32-2.s +#source: dsofn4g.s +#as: --pic --no-underscore --march=v32 --em=criself +#ld: --shared -m crislinux +#objdump: -d -R + +# Check dissassembly of the .plt section, specifically the synthetic +# symbols, in a DSO in which a .got.plt entry has been merged into a +# regular .got entry. There was a bug in which some (i.e. subsequent +# with regards to reloc order) synthetic X@plt entries were wrong if +# there were merged .got entries present; dsofn4@plt below. The +# alternatives in the matching regexps are placeholders for a future +# improvement: synthetic symbols for .plt entries with merged .got +# entries (lost as a consequence of the relocs no longer accounted for +# in .rela.plt and the default synthetic-symbol implementation just +# iterating over .rela.plt). + +.*: file format elf32-cris + +Disassembly of section \.plt: + +0+1b4 <(dsofn4@plt-0x1a|dsofn@plt-0x34)>: + 1b4: 84e2 subq 4,\$sp + 1b6: 0401 addoq 4,\$r0,\$acr + 1b8: 7e7a move \$mof,\[\$sp\] + 1ba: 3f7a move \[\$acr\],\$mof + 1bc: 04f2 addq 4,\$acr + 1be: 6ffa move\.d \[\$acr\],\$acr + 1c0: bf09 jump \$acr + 1c2: b005 nop + \.\.\. +#... + 1ce: 6f0d ..00 0000 addo\.d .* + 1d4: 6ffa move\.d \[\$acr\],\$acr + 1d6: bf09 jump \$acr + 1d8: b005 nop + 1da: 3f7e .... .... move .*,\$mof + 1e0: bf0e .... .... ba .* + 1e6: b005 nop + +0+1e8 <dsofn@plt>: + 1e8: 6f0d ..00 0000 addo\.d .* + 1ee: 6ffa move\.d \[\$acr\],\$acr + 1f0: bf09 jump \$acr + 1f2: b005 nop + 1f4: 3f7e .... .... move .*,\$mof + 1fa: bf0e baff ffff ba 1b4 <(dsofn4@plt-0x1a|dsofn@plt-0x34)> + 200: b005 nop + +Disassembly of section \.text: +#... +0+202 <dsofn3>: + 202: bfbe e6ff ffff bsr 1e8 <dsofn@plt> + 208: b005 nop + +0+20a <dsofn4>: + 20a: 7f0d ae20 0000 lapc 22b8 <_GLOBAL_OFFSET_TABLE_>,\$r0 + 210: 5f0d 1400 addo\.w 0x14,\$r0,\$acr + 214: bfbe baff ffff bsr 1ce <(dsofn4@plt|dsofn@plt-0x1a)> +#pass diff --git a/binutils-2.24/ld/testsuite/ld-cris/dso-pltdis2.d b/binutils-2.24/ld/testsuite/ld-cris/dso-pltdis2.d new file mode 100644 index 0000000..5348a8a --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/dso-pltdis2.d @@ -0,0 +1,54 @@ +#source: dsov32-1.s +#source: dsov32-2.s +#source: dsofng.s +#as: --pic --no-underscore --march=v32 --em=criself +#ld: --shared -m crislinux +#objdump: -d + +# Complement to dso-pltdis1.d; merging the other .got.plt entry. +# Depending on reloc order, one of the tests would fail. + +.*: file format elf32-cris + +Disassembly of section \.plt: + +0+1b4 <(dsofn4@plt-0x1a|dsofn@plt-0x34)>: + + 1b4: 84e2 subq 4,\$sp + 1b6: 0401 addoq 4,\$r0,\$acr + 1b8: 7e7a move \$mof,\[\$sp\] + 1ba: 3f7a move \[\$acr\],\$mof + 1bc: 04f2 addq 4,\$acr + 1be: 6ffa move\.d \[\$acr\],\$acr + 1c0: bf09 jump \$acr + 1c2: b005 nop + \.\.\. + +000001ce <dsofn4@plt>: + 1ce: 6f0d ..00 0000 addo\.d .* + 1d4: 6ffa move\.d \[\$acr\],\$acr + 1d6: bf09 jump \$acr + 1d8: b005 nop + 1da: 3f7e .... .... move .*,\$mof + 1e0: bf0e .... .... ba .* + 1e6: b005 nop +#... + 1e8: 6f0d ..00 0000 addo\.d .* + 1ee: 6ffa move\.d \[\$acr\],\$acr + 1f0: bf09 jump \$acr + 1f2: b005 nop + 1f4: 3f7e .... .... move .*,\$mof + 1fa: bf0e .... .... ba .* + 200: b005 nop + +Disassembly of section \.text: +#... +0+202 <dsofn3>: + 202: bfbe e6ff ffff bsr 1e8 <(dsofn@plt|dsofn4@plt\+0x1a)> + 208: b005 nop + +0+20a <dsofn4>: + 20a: 7f0d ae20 0000 lapc 22b8 <_GLOBAL_OFFSET_TABLE_>,\$r0 + 210: 5f0d ..00 addo\.w 0x..,\$r0,\$acr + 214: bfbe baff ffff bsr 1ce <dsofn4@plt> +#pass diff --git a/binutils-2.24/ld/testsuite/ld-cris/dso12-pltdis.d b/binutils-2.24/ld/testsuite/ld-cris/dso12-pltdis.d new file mode 100644 index 0000000..71a1748 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/dso12-pltdis.d @@ -0,0 +1,54 @@ +#source: expdyn1.s +#source: dsov32-1.s +#source: dsov32-2.s +#as: --pic --no-underscore --march=v32 --em=criself +#ld: --shared -m crislinux -z nocombreloc +#objdump: -d + +# Check dissassembly of .plt section. + +.*: file format elf32-cris + +Disassembly of section \.plt: + +0+1e4 <dsofn4@plt-0x1a>: + + 1e4: 84e2 subq 4,\$sp + 1e6: 0401 addoq 4,\$r0,\$acr + 1e8: 7e7a move \$mof,\[\$sp\] + 1ea: 3f7a move \[\$acr\],\$mof + 1ec: 04f2 addq 4,\$acr + 1ee: 6ffa move\.d \[\$acr\],\$acr + 1f0: bf09 jump \$acr + 1f2: b005 nop + \.\.\. + +0+1fe <dsofn4@plt>: + 1fe: 6f0d 0c00 0000 addo\.d c <dsofn4@plt-0x1f2>,\$r0,\$acr + 204: 6ffa move\.d \[\$acr\],\$acr + 206: bf09 jump \$acr + 208: b005 nop + 20a: 3f7e 0000 0000 move 0 <dsofn4@plt-0x1fe>,\$mof + 210: bf0e d4ff ffff ba 1e4 <dsofn4@plt-0x1a> + 216: b005 nop + +0+218 <dsofn@plt>: + 218: 6f0d 1000 0000 addo\.d 10 <dsofn4@plt-0x1ee>,\$r0,\$acr + 21e: 6ffa move\.d \[\$acr\],\$acr + 220: bf09 jump \$acr + 222: b005 nop + 224: 3f7e 0c00 0000 move c <dsofn4@plt-0x1f2>,\$mof + 22a: bf0e baff ffff ba 1e4 <dsofn4@plt-0x1a> + 230: b005 nop + +Disassembly of section \.text: +#... +0+236 <dsofn3>: + 236: bfbe e2ff ffff bsr 218 <dsofn@plt> + 23c: b005 nop + +0+23e <dsofn4>: + 23e: 7f0d a620 0000 lapc 22e4 <_GLOBAL_OFFSET_TABLE_>,\$r0 + 244: 5f0d 1400 addo\.w 0x14,\$r0,\$acr + 248: bfbe b6ff ffff bsr 1fe <dsofn4@plt> +#pass diff --git a/binutils-2.24/ld/testsuite/ld-cris/dsofn4g.s b/binutils-2.24/ld/testsuite/ld-cris/dsofn4g.s new file mode 100644 index 0000000..8c13fe9 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/dsofn4g.s @@ -0,0 +1,3 @@ + .text +x: + move.d dsofn4:GOT,$r10 diff --git a/binutils-2.24/ld/testsuite/ld-cris/dsofnf.s b/binutils-2.24/ld/testsuite/ld-cris/dsofnf.s new file mode 100644 index 0000000..bf0a4fa --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/dsofnf.s @@ -0,0 +1,7 @@ + .text + .global f + .type f,@function +f: + move.d [$r0+dsofn:GOT],$r1 +0: + .size f,0b-f diff --git a/binutils-2.24/ld/testsuite/ld-cris/dsofnf2.s b/binutils-2.24/ld/testsuite/ld-cris/dsofnf2.s new file mode 100644 index 0000000..fbf2384 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/dsofnf2.s @@ -0,0 +1,8 @@ + .text + .global f + .type f,@function +f: + move.d [$r0+dsofn:GOT],$r1 + move.d dsofn,$r2 +0: + .size f,0b-f diff --git a/binutils-2.24/ld/testsuite/ld-cris/dsofng.s b/binutils-2.24/ld/testsuite/ld-cris/dsofng.s new file mode 100644 index 0000000..af46471 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/dsofng.s @@ -0,0 +1,3 @@ + .text +x: + move.d dsofn:GOT,$r10 diff --git a/binutils-2.24/ld/testsuite/ld-cris/dsov32-1.s b/binutils-2.24/ld/testsuite/ld-cris/dsov32-1.s new file mode 100644 index 0000000..07a3e9c --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/dsov32-1.s @@ -0,0 +1,8 @@ + .text + .global dsofn3 + .type dsofn3,@function +dsofn3: + bsr dsofn:PLT + nop +.Lfe1: + .size dsofn3,.Lfe1-dsofn3 diff --git a/binutils-2.24/ld/testsuite/ld-cris/dsov32-2.s b/binutils-2.24/ld/testsuite/ld-cris/dsov32-2.s new file mode 100644 index 0000000..672f273 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/dsov32-2.s @@ -0,0 +1,10 @@ + .text + .global dsofn4 + .type dsofn4,@function +dsofn4: + lapc _GLOBAL_OFFSET_TABLE_,$r0 + addo.w expobj:GOT16,$r0,$acr + bsr dsofn4:PLT + nop +.Lfe1: + .size dsofn4,.Lfe1-dsofn4 diff --git a/binutils-2.24/ld/testsuite/ld-cris/dsov32-3.s b/binutils-2.24/ld/testsuite/ld-cris/dsov32-3.s new file mode 100644 index 0000000..768b06c --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/dsov32-3.s @@ -0,0 +1,8 @@ + .text + .global dsofn5 + .type dsofn5,@function +dsofn5: + bsr dsofn + nop +.Lfe1: + .size dsofn5,.Lfe1-dsofn5 diff --git a/binutils-2.24/ld/testsuite/ld-cris/dsov32-4.s b/binutils-2.24/ld/testsuite/ld-cris/dsov32-4.s new file mode 100644 index 0000000..d06768a --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/dsov32-4.s @@ -0,0 +1,14 @@ + .text + .global dsofn5 + .type dsofn5,@function +dsofn5: + bsr localfn + nop +.Lfe: + .size dsofn5,.Lfe-dsofn5 + + .type localfn,@function +localfn: + nop +.Lfe1: + .size localfn,.Lfe1-localfn diff --git a/binutils-2.24/ld/testsuite/ld-cris/euwref1.s b/binutils-2.24/ld/testsuite/ld-cris/euwref1.s new file mode 100644 index 0000000..5d21f4a --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/euwref1.s @@ -0,0 +1,8 @@ + .text +y: + .weak uw1 + .weak uw2 + .weak uw3 + move.d uw1,$r10 + move.d uw2:GOT,$r10 + move.d uw3:PLT,$r10 diff --git a/binutils-2.24/ld/testsuite/ld-cris/expalltst3 b/binutils-2.24/ld/testsuite/ld-cris/expalltst3 new file mode 100644 index 0000000..4ab8d53 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/expalltst3 @@ -0,0 +1 @@ +TST3 { global: *; }; diff --git a/binutils-2.24/ld/testsuite/ld-cris/expdref1.s b/binutils-2.24/ld/testsuite/ld-cris/expdref1.s new file mode 100644 index 0000000..58faa60 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/expdref1.s @@ -0,0 +1,6 @@ + .text +x: + move.d expobj:GOT,$r10 + move.d expobj:PLT,$r10 + move.d expfn:GOT,$r10 + move.d expfn:PLT,$r10 diff --git a/binutils-2.24/ld/testsuite/ld-cris/expdref2.s b/binutils-2.24/ld/testsuite/ld-cris/expdref2.s new file mode 100644 index 0000000..424e90c --- /dev/null +++ b/binutils-2.24/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/binutils-2.24/ld/testsuite/ld-cris/expdref3.s b/binutils-2.24/ld/testsuite/ld-cris/expdref3.s new file mode 100644 index 0000000..dd35893 --- /dev/null +++ b/binutils-2.24/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/binutils-2.24/ld/testsuite/ld-cris/expdref4.s b/binutils-2.24/ld/testsuite/ld-cris/expdref4.s new file mode 100644 index 0000000..e639039 --- /dev/null +++ b/binutils-2.24/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/binutils-2.24/ld/testsuite/ld-cris/expdyn1.d b/binutils-2.24/ld/testsuite/ld-cris/expdyn1.d new file mode 100644 index 0000000..51d875d --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/expdyn1.d @@ -0,0 +1,14 @@ +#source: expdyn1.s +#as: --no-underscore --em=criself +#ld: -m crislinux -export-dynamic tmpdir/libdso-1.so +#objdump: -T + +.*: file format elf32-cris + +# Exporting dynamic symbols means objects as well as functions. + +DYNAMIC SYMBOL TABLE: +#... +00080... g DF .text 0+2 expfn +00082... g DO .data 0+4 expobj +#pass diff --git a/binutils-2.24/ld/testsuite/ld-cris/expdyn1.s b/binutils-2.24/ld/testsuite/ld-cris/expdyn1.s new file mode 100644 index 0000000..646be85 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/expdyn1.s @@ -0,0 +1,18 @@ + .data + .global expobj + .type expobj,@object + .size expobj,4 +expobj: + .dword 0 + + .text + .global _start +_start: + nop + .global expfn +expfn: + .type expfn,@function + nop +.Lfe1: + .size expfn,.Lfe1-expfn + diff --git a/binutils-2.24/ld/testsuite/ld-cris/expdyn1w.s b/binutils-2.24/ld/testsuite/ld-cris/expdyn1w.s new file mode 100644 index 0000000..35d36db --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/expdyn1w.s @@ -0,0 +1,3 @@ + .weak expobj + .weak expfn + .include "expdyn1.s" diff --git a/binutils-2.24/ld/testsuite/ld-cris/expdyn2.d b/binutils-2.24/ld/testsuite/ld-cris/expdyn2.d new file mode 100644 index 0000000..6c5faa5 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/expdyn2.d @@ -0,0 +1,16 @@ +#source: expdyn1.s +#source: expdref1.s --pic +#as: --no-underscore --em=criself +#ld: -m crislinux --export-dynamic tmpdir/libdso-1.so +#objdump: -R + +# Programs linked with --export-dynamic threw away .rela.got for exported +# symbols, but since got reference counter wasn't reset, there was a SEGV +# trying to generate the .rela.got relocations. In this test, we have an +# object in the program that has pic-relocations to an exported symbol, +# but those relocations can be resolved at link-time. We link to a DSO to +# get dynamic linking. + +.*: file format elf32-cris + +DYNAMIC RELOCATION RECORDS \(none\) diff --git a/binutils-2.24/ld/testsuite/ld-cris/expdyn2.s b/binutils-2.24/ld/testsuite/ld-cris/expdyn2.s new file mode 100644 index 0000000..d184ebc --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/expdyn2.s @@ -0,0 +1,21 @@ + .data + .global __expobj2 + .type __expobj2,@object + .size __expobj2,4 +__expobj2: + .dword 0 + .weak expobj2 + .set expobj2,__expobj2 + + .text + .global _start +_start: + nop + .global __expfn2 +__expfn2: + .type __expfn2,@function + nop +.Lfe1: + .size __expfn2,.Lfe1-__expfn2 + .weak expfn2 + .set expfn2,__expfn2 diff --git a/binutils-2.24/ld/testsuite/ld-cris/expdyn3.d b/binutils-2.24/ld/testsuite/ld-cris/expdyn3.d new file mode 100644 index 0000000..34f2a5e --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/expdyn3.d @@ -0,0 +1,12 @@ +#source: expdyn1.s +#source: expdref1.s --pic +#source: euwref1.s --pic +#as: --no-underscore --em=criself +#ld: -m crislinux --export-dynamic tmpdir/libdso-1.so +#objdump: -R + +# Like expdyn2.d, but also weakly referencing symbols. + +.*: file format elf32-cris + +DYNAMIC RELOCATION RECORDS \(none\) diff --git a/binutils-2.24/ld/testsuite/ld-cris/expdyn4.d b/binutils-2.24/ld/testsuite/ld-cris/expdyn4.d new file mode 100644 index 0000000..e932056 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/expdyn4.d @@ -0,0 +1,12 @@ +#source: expdyn1.s +#source: expdref1.s --pic +#source: comref1.s --pic +#as: --no-underscore --em=criself +#ld: -m crislinux --export-dynamic tmpdir/libdso-1.so +#objdump: -R + +# Like expdyn2.d, but referencing COMMON symbols. + +.*: file format elf32-cris + +DYNAMIC RELOCATION RECORDS \(none\) diff --git a/binutils-2.24/ld/testsuite/ld-cris/expdyn5.d b/binutils-2.24/ld/testsuite/ld-cris/expdyn5.d new file mode 100644 index 0000000..5504534 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/expdyn5.d @@ -0,0 +1,13 @@ +#source: expdyn1.s +#source: expdref1.s --pic +#as: --no-underscore --em=criself +#ld: -m crislinux --export-dynamic tmpdir/libdso-1.so +#objdump: -s -j .got + +# Like expdyn2.d, but testing that the .got contents is correct. There +# needs to be a .got due to the GOT relocs, but the entry is constant. + +.*: file format elf32-cris +Contents of section \.got: + 82244 dc210800 00000000 00000000 bf010800 .* + 82254 58220800 .* diff --git a/binutils-2.24/ld/testsuite/ld-cris/expdyn6.d b/binutils-2.24/ld/testsuite/ld-cris/expdyn6.d new file mode 100644 index 0000000..43d04ff --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/expdyn6.d @@ -0,0 +1,13 @@ +#source: expdyn1.s +#source: expdref1.s --pic +#source: euwref1.s --pic +#as: --no-underscore --em=criself +#ld: -m crislinux --export-dynamic tmpdir/libdso-1.so +#objdump: -s -j .got + +# Like expdyn5.d, weakly referencing symbols. + +.*: file format elf32-cris +Contents of section \.got: + 822a0 38220800 00000000 00000000 00000000 .* + 822b0 07020800 b8220800 .* diff --git a/binutils-2.24/ld/testsuite/ld-cris/expdyn7.d b/binutils-2.24/ld/testsuite/ld-cris/expdyn7.d new file mode 100644 index 0000000..7bd91e0 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/expdyn7.d @@ -0,0 +1,13 @@ +#source: expdyn1.s +#source: expdref1.s --pic +#source: comref1.s --pic +#as: --no-underscore --em=criself +#ld: -m crislinux --export-dynamic tmpdir/libdso-1.so +#objdump: -s -j .got + +# Like expdyn5.d, referencing COMMON symbols. + +.*: file format elf32-cris +Contents of section \.got: + 8229c 34220800 00000000 00000000 b8220800 .* + 822ac 04020800 b4220800 .* diff --git a/binutils-2.24/ld/testsuite/ld-cris/globsym1ref.s b/binutils-2.24/ld/testsuite/ld-cris/globsym1ref.s new file mode 100644 index 0000000..03d4477 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/globsym1ref.s @@ -0,0 +1 @@ + .long globsym1 diff --git a/binutils-2.24/ld/testsuite/ld-cris/globsymw1.s b/binutils-2.24/ld/testsuite/ld-cris/globsymw1.s new file mode 100644 index 0000000..955014d --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/globsymw1.s @@ -0,0 +1,15 @@ + .text + .stabn 162,0,0,0 + .global globsym1 + .type globsym1, @function +globsym1: + .stabd 46,0,0 + .stabn 68,0,16,LM0-globsym1 +LM0: + .long 0 + .size globsym1, .-globsym1 + .stabs "",100,0,0,Letext0 +Letext0: +;# This must be the last line; the point is that the warning symbol +;# construct is last, but is missing the actual symbol warned about. + .stabs "isatty is not implemented and will always fail",30,0,0,0 diff --git a/binutils-2.24/ld/testsuite/ld-cris/globsymw2.s b/binutils-2.24/ld/testsuite/ld-cris/globsymw2.s new file mode 100644 index 0000000..a9e11ff --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/globsymw2.s @@ -0,0 +1,16 @@ + .text + .stabn 162,0,0,0 +;# A bit like globsymw1.s but containing a valid, working, stabs +;# symbol warning construct. + .stabs "isatty is not implemented and will always fail",30,0,0,0 + .stabs "globsym1",1,0,0,0 + .global globsym1 + .type globsym1, @function +globsym1: + .stabd 46,0,0 + .stabn 68,0,16,LM0-globsym1 +LM0: + .long 0 + .size globsym1, .-globsym1 + .stabs "",100,0,0,Letext0 +Letext0: diff --git a/binutils-2.24/ld/testsuite/ld-cris/got7.s b/binutils-2.24/ld/testsuite/ld-cris/got7.s new file mode 100644 index 0000000..c97055e --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/got7.s @@ -0,0 +1,21 @@ +; Just something defining 7 variables @ 4 bytes and requesting GOT +; entries for each of them. + + .text + .global got7fn + .type got7fn,@function +got7fn: + .irpc n,1234567 + move.d got7var\n:GOT,$r10 + .endr +.Lfe: + .size got7fn,.Lfe-got7fn + + .irpc n,1234567 + .data + .global got7var\n + .type got7var\n,@object + .size got7var\n,4 +got7var\n: + .dword 0 + .endr diff --git a/binutils-2.24/ld/testsuite/ld-cris/gotplt1.d b/binutils-2.24/ld/testsuite/ld-cris/gotplt1.d new file mode 100644 index 0000000..8fcb7b5 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/gotplt1.d @@ -0,0 +1,48 @@ +#source: dso-2.s +#source: dsofnf2.s +#source: gotrel1.s +#as: --pic --no-underscore --em=criself +#ld: -m crislinux tmpdir/libdso-1.so +#objdump: -sR + +# Make sure we don't merge a PLT-specific entry +# (R_CRIS_JUMP_SLOT) with a non-PLT-GOT-specific entry +# (R_CRIS_GLOB_DAT) in an executable, since they may have +# different contents there. (If we merge them in a DSO it's ok: +# we make a round-trip to the PLT in the executable if it's +# referenced there, but that's still perceived as better than +# having an unnecessary PLT, dynamic reloc and lookup in the +# DSO.) In the executable, the GOT contents for the non-PLT +# reloc should be constant. + +.*: file format elf32-cris + +DYNAMIC RELOCATION RECORDS +OFFSET TYPE VALUE +00082280 R_CRIS_JUMP_SLOT dsofn + +Contents of section .* +#... +Contents of section \.rela\.plt: + 80190 80220800 0b040000 00000000 .* +Contents of section \.plt: + 8019c fce17e7e 7f0d7822 0800307a 7f0d7c22 .* + 801ac 08003009 7f0d8022 08003009 3f7e0000 .* + 801bc 00002ffe d8ffffff .* +Contents of section \.text: + 801c4 5f1d0c00 30096f1d 0c000000 30090000 .* + 801d4 6f0d1000 0000611a 6f2eb001 08000000 .* + 801e4 6f3e70df ffff0000 .* +Contents of section \.dynamic: + 821ec 01000000 01000000 04000000 e4000800 .* + 821fc 05000000 5c010800 06000000 0c010800 .* + 8220c 0a000000 32000000 0b000000 10000000 .* + 8221c 15000000 00000000 03000000 74220800 .* + 8222c 02000000 0c000000 14000000 07000000 .* + 8223c 17000000 90010800 00000000 00000000 .* + 8224c 00000000 00000000 00000000 00000000 .* + 8225c 00000000 00000000 00000000 00000000 .* + 8226c 00000000 00000000 .* +Contents of section \.got: + 82274 ec210800 00000000 00000000 b8010800 .* + 82284 b0010800 .* diff --git a/binutils-2.24/ld/testsuite/ld-cris/gotplt2.d b/binutils-2.24/ld/testsuite/ld-cris/gotplt2.d new file mode 100644 index 0000000..48f1413 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/gotplt2.d @@ -0,0 +1,37 @@ +#source: dso-2.s +#source: dsofnf.s +#source: gotrel1.s +#as: --pic --no-underscore --em=criself +#ld: -shared -m crislinux -z nocombreloc +#objdump: -sR + +# Make sure we merge a PLT-specific entry (usually +# R_CRIS_JUMP_SLOT) with a GOT-specific entry (R_CRIS_GLOB_DAT) +# in a DSO. It's ok: we make a round-trip to the PLT in the +# executable if it's referenced there, but that's still +# perceived as better than having an unnecessary PLT, dynamic +# reloc and lookup in the DSO.) + +.*: file format elf32-cris + +DYNAMIC RELOCATION RECORDS +OFFSET TYPE VALUE +00002230 R_CRIS_GLOB_DAT dsofn + +Contents of section .* +#... +Contents of section \.rela\.got: + 0188 30220000 0a080000 00000000 .* +Contents of section \.text: + 0194 5f1d0c00 30096f1d 0c000000 30090000 .* + 01a4 6f0d0c00 0000611a 6f3e88df ffff0000 .* +Contents of section \.dynamic: + 21b4 04000000 94000000 05000000 5c010000 .* + 21c4 06000000 cc000000 0a000000 2a000000 .* + 21d4 0b000000 10000000 07000000 88010000 .* + 21e4 08000000 0c000000 09000000 0c000000 .* + 21f4 00000000 00000000 00000000 00000000 .* + 2204 00000000 00000000 00000000 00000000 .* + 2214 00000000 00000000 00000000 00000000 .* +Contents of section \.got: + 2224 b4210000 00000000 00000000 00000000 .* diff --git a/binutils-2.24/ld/testsuite/ld-cris/gotplt3.d b/binutils-2.24/ld/testsuite/ld-cris/gotplt3.d new file mode 100644 index 0000000..f4cb4be --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/gotplt3.d @@ -0,0 +1,35 @@ +#source: dso-2.s +#source: dsofnf.s +#source: gotrel1.s +#source: dso-1.s +#as: --pic --no-underscore --em=criself +#ld: -shared -m crislinux -z nocombreloc +#objdump: -sR + +# Like gotplt2, but make sure we merge right when we have a +# definition of the function too. + +.*: file format elf32-cris + +DYNAMIC RELOCATION RECORDS +OFFSET TYPE VALUE +00002234 R_CRIS_GLOB_DAT dsofn + +Contents of section .* +#... +Contents of section \.rela\.got: + 0188 34220000 0a080000 00000000 .* +Contents of section \.text: + 0194 5f1d0c00 30096f1d 0c000000 30090000 .* + 01a4 6f0d0c00 0000611a 6f3e84df ffff0000 .* + 01b4 0f050000 .* +Contents of section \.dynamic: + 21b8 04000000 94000000 05000000 5c010000 .* + 21c8 06000000 cc000000 0a000000 2a000000 .* + 21d8 0b000000 10000000 07000000 88010000 .* + 21e8 08000000 0c000000 09000000 0c000000 .* + 21f8 00000000 00000000 00000000 00000000 .* + 2208 00000000 00000000 00000000 00000000 .* + 2218 00000000 00000000 00000000 00000000 .* +Contents of section \.got: + 2228 b8210000 00000000 00000000 00000000 .* diff --git a/binutils-2.24/ld/testsuite/ld-cris/gotrel1.s b/binutils-2.24/ld/testsuite/ld-cris/gotrel1.s new file mode 100644 index 0000000..68f035d --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/gotrel1.s @@ -0,0 +1,4 @@ + .global _start +_start: +localsym: + move.d localsym:GOTOFF,$r3 diff --git a/binutils-2.24/ld/testsuite/ld-cris/gotrel2.s b/binutils-2.24/ld/testsuite/ld-cris/gotrel2.s new file mode 100644 index 0000000..3f98674 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/gotrel2.s @@ -0,0 +1,5 @@ + .text + .weak undefweak + .global _start +_start: + move.d [$r0+undefweak:GOT],$r3 diff --git a/binutils-2.24/ld/testsuite/ld-cris/hiddef1.d b/binutils-2.24/ld/testsuite/ld-cris/hiddef1.d new file mode 100644 index 0000000..0be90a1 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/hiddef1.d @@ -0,0 +1,28 @@ +#source: gotrel1.s +#source: hiddef1.s +#source: hidrefgotplt1.s +#ld: -shared -m crislinux +#as: --pic --no-underscore -I$srcdir/$subdir --em=criself +#readelf: -S -s -r + +# Regression test for mishandling of GOTPLT relocs against a +# hidden symbol, where the reloc is found after the symbol +# definition. There should be no PLT, just a single GOT entry +# from a GOTPLT reloc moved to the .got section. It's hard to +# check for absence of a .plt section, so we just check the +# number of symbols and sections. When the number of symbols +# and sections change, make sure that there's no .plt and that +# dsofn is hidden (not exported as a dynamic symbol). + +There are 11 section headers, starting at offset 0x[0-9a-f]+: +#... + \[[ 0-9]+\] \.got PROGBITS [0-9a-f]+ [0-9a-f]+ 0+10 04 WA 0 0 4 +#... +Relocation section '\.rela\.dyn' at offset 0x[0-9a-f]+ contains 1 entries: +#... +[0-9a-f]+ 0+c R_CRIS_RELATIVE +[0-9a-f]+ +#... +Symbol table '\.dynsym' contains 6 entries: +#... +Symbol table '\.symtab' contains 18 entries: +#pass diff --git a/binutils-2.24/ld/testsuite/ld-cris/hiddef1.s b/binutils-2.24/ld/testsuite/ld-cris/hiddef1.s new file mode 100644 index 0000000..ac24c81 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/hiddef1.s @@ -0,0 +1,2 @@ + .include "dso-1.s" + .hidden dsofn diff --git a/binutils-2.24/ld/testsuite/ld-cris/hide1 b/binutils-2.24/ld/testsuite/ld-cris/hide1 new file mode 100644 index 0000000..655871d --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/hide1 @@ -0,0 +1 @@ +TST1 { global: export_*; local: *; }; diff --git a/binutils-2.24/ld/testsuite/ld-cris/hidedsofns2468 b/binutils-2.24/ld/testsuite/ld-cris/hidedsofns2468 new file mode 100644 index 0000000..ebe3d44 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/hidedsofns2468 @@ -0,0 +1 @@ +TST2 { local: dsofn; dsofn2; dsofn4; dsofn6; dsofn8; }; diff --git a/binutils-2.24/ld/testsuite/ld-cris/hidrefgotplt1.s b/binutils-2.24/ld/testsuite/ld-cris/hidrefgotplt1.s new file mode 100644 index 0000000..020ff16 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/hidrefgotplt1.s @@ -0,0 +1,2 @@ + .text + move.d [$r0+dsofn:GOTPLT],$r1 diff --git a/binutils-2.24/ld/testsuite/ld-cris/init.s b/binutils-2.24/ld/testsuite/ld-cris/init.s new file mode 100644 index 0000000..b65ec44 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/init.s @@ -0,0 +1,6 @@ + .global _init + .type _init,@function +_init: + nop +.Lfe3: + .size _init,.Lfe3-_init diff --git a/binutils-2.24/ld/testsuite/ld-cris/ldsym1.d b/binutils-2.24/ld/testsuite/ld-cris/ldsym1.d new file mode 100644 index 0000000..e8dcd32 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/ldsym1.d @@ -0,0 +1,20 @@ +# source: expdyn1.s +# target: cris-*-*elf* cris-*-*aout* +# as: --em=criself +# ld: -mcriself +# objdump: -d + +# Note that the linker script symbol __start is set to the same +# value as _start, and will collate before _start and be chosen +# as the presentation symbol at disassembly. Anyway, __start +# shouldn't hinder disassembly by posing as an object symbol. + +.*: file format elf32-us-cris + +Disassembly of section \.text: + +0+ <(___init__start|__start|__Stext)>: + 0: 0f05 nop + +0+2 <expfn>: + 2: 0f05 nop diff --git a/binutils-2.24/ld/testsuite/ld-cris/libdso-1.d b/binutils-2.24/ld/testsuite/ld-cris/libdso-1.d new file mode 100644 index 0000000..aa41d4f --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/libdso-1.d @@ -0,0 +1,13 @@ +#source: dso-1.s +#as: --pic --no-underscore --em=criself +#ld: --shared -m crislinux +#objdump: -T + +# Just check that we actually got a DSO with the dsofn symbol. + +.*: file format elf32-cris + +DYNAMIC SYMBOL TABLE: +#... +00000[12].[02468ace] g DF .text 0+2 dsofn +#pass diff --git a/binutils-2.24/ld/testsuite/ld-cris/libdso-10.d b/binutils-2.24/ld/testsuite/ld-cris/libdso-10.d new file mode 100644 index 0000000..43d96bd --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/libdso-10.d @@ -0,0 +1,37 @@ +#source: dso-1.s +#as: --pic --no-underscore --march=v32 --em=criself +#ld: --shared -m crislinux +#objdump: -p -h + +# Sanity check; just an empty GOT. + +.*: file format elf32-cris + +Program Header: + LOAD off 0x0+ vaddr 0x0+ paddr 0x0+ align 2\*\*13 + filesz 0x0+144 memsz 0x0+144 flags r-x + LOAD off 0x0+144 vaddr 0x0+2144 paddr 0x0+2144 align 2\*\*13 + filesz 0x0+64 memsz 0x0+64 flags rw- + DYNAMIC off 0x0+144 vaddr 0x0+2144 paddr 0x0+2144 align 2\*\*2 + filesz 0x0+58 memsz 0x0+58 flags rw- +Dynamic Section: + HASH.*0x0*94 + STRTAB.*0x0*120 + SYMTAB.*0x0*c0 + STRSZ.*0x0*1f + SYMENT.*0x0*10 +private flags = 2: \[v32\] +Sections: +Idx Name Size VMA LMA File off Algn + 0 \.hash 0+2c 0+94 0+94 0+94 2\*\*2 + CONTENTS, ALLOC, LOAD, READONLY, DATA + 1 \.dynsym 0+60 0+c0 0+c0 0+c0 2\*\*2 + CONTENTS, ALLOC, LOAD, READONLY, DATA + 2 \.dynstr 0+1f 0+120 0+120 0+120 2\*\*0 + CONTENTS, ALLOC, LOAD, READONLY, DATA + 3 \.text 0+4 0+140 0+140 0+140 2\*\*1 + CONTENTS, ALLOC, LOAD, READONLY, CODE + 4 \.dynamic 0+58 0+2144 0+2144 0+144 2\*\*2 + CONTENTS, ALLOC, LOAD, DATA + 5 \.got 0+c 0+219c 0+219c 0+19c 2\*\*2 + CONTENTS, ALLOC, LOAD, DATA diff --git a/binutils-2.24/ld/testsuite/ld-cris/libdso-11.d b/binutils-2.24/ld/testsuite/ld-cris/libdso-11.d new file mode 100644 index 0000000..dc7b75a --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/libdso-11.d @@ -0,0 +1,27 @@ +#source: dso-1.s +#source: dsov32-1.s +#as: --pic --no-underscore --march=v32 --em=criself +#ld: --shared -m crislinux +#objdump: -s -T + +.*: file format elf32-cris + +DYNAMIC SYMBOL TABLE: +#... +0+1a0 g DF \.text 0+8 dsofn3 +#... +0+19c g DF \.text 0+2 dsofn +#... +Contents of section \.rela\.plt: + 015c 2c220000 0b060000 00000000 .* +Contents of section \.plt: + 0168 84e20401 7e7a3f7a 04f26ffa bf09b005 .* + 0178 00000000 00000000 00006f0d 0c000000 .* + 0188 6ffabf09 b0053f7e 00000000 bf0ed4ff .* + 0198 ffffb005 .* +Contents of section \.text: + 019c b0050000 bfbee2ff ffffb005 .* +Contents of section \.dynamic: +#... +Contents of section \.got: + 2220 a8210000 00000000 00000000 8e010000 .* diff --git a/binutils-2.24/ld/testsuite/ld-cris/libdso-12.d b/binutils-2.24/ld/testsuite/ld-cris/libdso-12.d new file mode 100644 index 0000000..c8a4f62 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/libdso-12.d @@ -0,0 +1,51 @@ +#source: expdyn1.s +#source: dsov32-1.s +#source: dsov32-2.s +#as: --pic --no-underscore --march=v32 --em=criself +#ld: --shared -m crislinux -z nocombreloc +#objdump: -s -T + +# Check for common DSO contents; load of GOT register, branch to +# function PLT, undefined symbol, GOT reloc. + +.*: file format elf32-cris + +DYNAMIC SYMBOL TABLE: +#... +0+23e g DF \.text 0+12 dsofn4 +0+234 g DF \.text 0+2 expfn +0+22fc g DO \.data 0+4 expobj +#... +0+236 g DF \.text 0+8 dsofn3 +#... +0+ D \*UND\* 0+ dsofn +#... +Contents of section \.rela\.got: + 01c0 f8220000 0a040000 00000000 .* +Contents of section \.rela\.plt: + 01cc f0220000 0b020000 00000000 f4220000 .* + 01dc 0b0a0000 00000000 .* +Contents of section \.plt: + 01e4 84e20401 7e7a3f7a 04f26ffa bf09b005 .* + 01f4 00000000 00000000 00006f0d 0c000000 .* + 0204 6ffabf09 b0053f7e 00000000 bf0ed4ff .* + 0214 ffffb005 6f0d1000 00006ffa bf09b005 .* + 0224 3f7e0c00 0000bf0e baffffff b005 .* +Contents of section \.text: + 0232 b005b005 bfbee2ff ffffb005 7f0da620 .* + 0242 00005f0d 1400bfbe b6ffffff b0050000 .* +Contents of section \.dynamic: + 2254 04000000 94000000 05000000 84010000 .* + 2264 06000000 d4000000 0a000000 3a000000 .* + 2274 0b000000 10000000 03000000 e4220000 .* + 2284 02000000 18000000 14000000 07000000 .* + 2294 17000000 cc010000 07000000 c0010000 .* + 22a4 08000000 0c000000 09000000 0c000000 .* + 22b4 00000000 00000000 00000000 00000000 .* + 22c4 00000000 00000000 00000000 00000000 .* + 22d4 00000000 00000000 00000000 00000000 .* +Contents of section \.got: + 22e4 54220000 00000000 00000000 0a020000 .* + 22f4 24020000 00000000 .* +Contents of section \.data: + 22fc 00000000 .* diff --git a/binutils-2.24/ld/testsuite/ld-cris/libdso-12b.d b/binutils-2.24/ld/testsuite/ld-cris/libdso-12b.d new file mode 100644 index 0000000..87506ed --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/libdso-12b.d @@ -0,0 +1,50 @@ +#source: expdyn1.s +#source: dsov32-1.s +#source: dsov32-2.s +#as: --pic --no-underscore --march=v32 --em=criself +#ld: --shared -m crislinux +#objdump: -s -T + +# Like libdso-12.d but without -z nocombreloc. + +.*: file format elf32-cris + +DYNAMIC SYMBOL TABLE: +#... +0+23e g DF \.text 0+12 dsofn4 +0+234 g DF \.text 0+2 expfn +0+22fc g DO \.data 0+4 expobj +#... +0+236 g DF \.text 0+8 dsofn3 +#... +0+ D \*UND\* 0+ dsofn +#... +Contents of section \.rela\.dyn: + 01c0 f8220000 0a040000 00000000 .* +Contents of section \.rela\.plt: + 01cc f0220000 0b020000 00000000 f4220000 .* + 01dc 0b0a0000 00000000 .* +Contents of section \.plt: + 01e4 84e20401 7e7a3f7a 04f26ffa bf09b005 .* + 01f4 00000000 00000000 00006f0d 0c000000 .* + 0204 6ffabf09 b0053f7e 00000000 bf0ed4ff .* + 0214 ffffb005 6f0d1000 00006ffa bf09b005 .* + 0224 3f7e0c00 0000bf0e baffffff b005 .* +Contents of section \.text: + 0232 b005b005 bfbee2ff ffffb005 7f0da620 .* + 0242 00005f0d 1400bfbe b6ffffff b0050000 .* +Contents of section \.dynamic: + 2254 04000000 94000000 05000000 84010000 .* + 2264 06000000 d4000000 0a000000 3a000000 .* + 2274 0b000000 10000000 03000000 e4220000 .* + 2284 02000000 18000000 14000000 07000000 .* + 2294 17000000 cc010000 07000000 c0010000 .* + 22a4 08000000 0c000000 09000000 0c000000 .* + 22b4 00000000 00000000 00000000 00000000 .* + 22c4 00000000 00000000 00000000 00000000 .* + 22d4 00000000 00000000 00000000 00000000 .* +Contents of section \.got: + 22e4 54220000 00000000 00000000 0a020000 .* + 22f4 24020000 00000000 .* +Contents of section \.data: + 22fc 00000000 .* diff --git a/binutils-2.24/ld/testsuite/ld-cris/libdso-12c.d b/binutils-2.24/ld/testsuite/ld-cris/libdso-12c.d new file mode 100644 index 0000000..37eab56 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/libdso-12c.d @@ -0,0 +1,41 @@ +#source: expdyn1.s +#source: dsov32-1.s +#source: dsov32-2.s +#source: dso-1.s +#as: --pic --no-underscore --march=v32 --em=criself +#ld: --shared -m crislinux --version-script $srcdir/$subdir/hidedsofns2468 +#objdump: -s -T + +# Like libdso-12b.d, but dsofn is defined and the two called functions +# are forced local using a linker script. There should just be the +# GOT relocation for expobj in the DSO. + +.*: file format elf32-cris + +DYNAMIC SYMBOL TABLE: +#... +0+202 g[ ]+DF \.text 0+2 Base[ ]+expfn +0+22bc g[ ]+DO \.data 0+4 Base[ ]+expobj +#... +0+204 g[ ]+DF \.text 0+8 Base[ ]+dsofn3 +#... +Contents of section \.rela\.dyn: + 01f4 b8220000 0a040000 00000000 .* +Contents of section \.text: + 0200 b005b005 bfbe1c00 0000b005 7f0da020 .* + 0210 00005f0d 0c00bfbe f6ffffff b0050000 .* + 0220 b0050000 .* +Contents of section .dynamic: + 2224 04000000 94000000 05000000 70010000 .* + 2234 06000000 d0000000 0a000000 37000000 .* + 2244 0b000000 10000000 07000000 f4010000 .* + 2254 08000000 0c000000 09000000 0c000000 .* + 2264 fcffff6f bc010000 fdffff6f 02000000 .* + 2274 f0ffff6f a8010000 00000000 00000000 .* + 2284 00000000 00000000 00000000 00000000 .* + 2294 00000000 00000000 00000000 00000000 .* + 22a4 00000000 00000000 .* +Contents of section \.got: + 22ac 24220000 00000000 00000000 00000000 .* +Contents of section \.data: + 22bc 00000000 .* diff --git a/binutils-2.24/ld/testsuite/ld-cris/libdso-13.d b/binutils-2.24/ld/testsuite/ld-cris/libdso-13.d new file mode 100644 index 0000000..772480e --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/libdso-13.d @@ -0,0 +1,31 @@ +#source: dso-1.s +#source: dsov32-3.s +#as: --pic --no-underscore --march=v32 --em=criself +#ld: --shared -m crislinux -z nocombreloc --enable-new-dtags +#readelf: -d -r +#warning: relocation R_CRIS_32_PCREL should not be used in a shared object; recompile with -fPIC + +# Check that a TEXTREL reloc is correctly generated for PCREL +# relocations against global symbols. +# FIXME: Have a textrel-enabling(-disabling) linker option. +# (Warning always generated unless [other option] warnings are +# generally disabled.) Split out the expected readelf output +# into a separate test using that option. + +Dynamic section at offset 0x[0-9a-f][0-9a-f][0-9a-f] contains 11 entries: + Tag[ ]+Type[ ]+Name/Value + 0x0+4 \(HASH\)[ ]+0x94 + 0x0+5 \(STRTAB\)[ ]+0x[12][0-9a-f][0-9a-f] + 0x0+6 \(SYMTAB\)[ ]+0x[0-9a-f][0-9a-f] + 0x0+a \(STRSZ\)[ ]+38 \(bytes\) + 0x0+b \(SYMENT\)[ ]+16 \(bytes\) + 0x0+7 \(RELA\)[ ]+0x[12][0-9a-f][0-9a-f] + 0x0+8 \(RELASZ\)[ ]+12 \(bytes\) + 0x0+9 \(RELAENT\)[ ]+12 \(bytes\) + 0x0+16 \(TEXTREL\)[ ]+0x0 + 0x0+1e \(FLAGS\)[ ]+TEXTREL + 0x0+ \(NULL\)[ ]+0x0 + +Relocation section '\.rela\.text' at offset 0x[12][0-9a-f][0-9a-f] contains 1 entries: + Offset[ ]+Info[ ]+Type[ ]+Sym\.Value Sym\. Name \+ Addend +0+[12][0-9a-f][0-9a-f] 0+[0-9a-f]06 R_CRIS_32_PCREL[ ]+0+[0-f]+[ ]+dsofn \+ 6 diff --git a/binutils-2.24/ld/testsuite/ld-cris/libdso-13b.d b/binutils-2.24/ld/testsuite/ld-cris/libdso-13b.d new file mode 100644 index 0000000..cd6f4e2 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/libdso-13b.d @@ -0,0 +1,23 @@ +#source: dso-1.s +#source: dsov32-3.s +#as: --pic --no-underscore --march=v32 --em=criself +#ld: --shared -m crislinux --version-script $srcdir/$subdir/hidedsofns2468 +#readelf: -d -r + +# Like libdso-13.d, but without -z nocombreloc and with a version +# script hiding the function called pcrel-without-plt. There should +# be no warning, no relocations in the output and no TEXTREL marking. + +Dynamic section at offset 0x1b0 contains 9 entries: + Tag Type Name/Value + 0x00000004 \(HASH\) .* + 0x00000005 \(STRTAB\) .* + 0x00000006 \(SYMTAB\) .* + 0x0000000a \(STRSZ\) .* + 0x0000000b \(SYMENT\) .* + 0x6ffffffc \(VERDEF\) .* + 0x6ffffffd \(VERDEFNUM\) .* + 0x6ffffff0 \(VERSYM\) .* + 0x00000000 \(NULL\) 0x0 + +There are no relocations in this file. diff --git a/binutils-2.24/ld/testsuite/ld-cris/libdso-14.d b/binutils-2.24/ld/testsuite/ld-cris/libdso-14.d new file mode 100644 index 0000000..c0a20e8 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/libdso-14.d @@ -0,0 +1,19 @@ +#source: dso-1.s +#source: dsov32-4.s +#as: --pic --no-underscore --march=v32 --em=criself +#ld: --shared -m crislinux +#readelf: -d -r + +# Checking that a bsr to a non-PLT-decorated nonvisible function +# doesn't make the DSO textrel. + +Dynamic section at offset 0x16c contains 6 entries: + Tag[ ]+Type[ ]+Name/Value + 0x0+4 \(HASH\)[ ]+0x94 + 0x0+5 \(STRTAB\)[ ]+0x134 + 0x0+6 \(SYMTAB\)[ ]+0xc4 + 0x0+a \(STRSZ\)[ ]+38 \(bytes\) + 0x0+b \(SYMENT\)[ ]+16 \(bytes\) + 0x0+ \(NULL\)[ ]+0x0 + +There are no relocations in this file. diff --git a/binutils-2.24/ld/testsuite/ld-cris/libdso-15.d b/binutils-2.24/ld/testsuite/ld-cris/libdso-15.d new file mode 100644 index 0000000..ce57e97 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/libdso-15.d @@ -0,0 +1,24 @@ +#source: expdyn2.s +#as: --pic --no-underscore --em=criself -I$srcdir/$subdir +#ld: --shared -m crislinux --version-script $srcdir/$subdir/expalltst3 +#objdump: -s -T + +# A DSO that has two versioned symbols, each with a weak alias. +# Each symbol is versioned. + +.*: file format elf32-cris + +DYNAMIC SYMBOL TABLE: +#... +0+2288 g[ ]+DO .data[ ]+0+4 TST3[ ]+__expobj2 +0+20a g[ ]+DF .text[ ]+0+2 TST3[ ]+__expfn2 +0+20a w[ ]+DF .text[ ]+0+2 TST3[ ]+expfn2 +0+2288 w[ ]+DO .data[ ]+0+4 TST3[ ]+expobj2 +#... +Contents of section .text: + 0208 0f050f05 .* +#... +Contents of section .got: + 227c 0c220000 00000000 00000000 .* +Contents of section .data: + 2288 00000000 .* diff --git a/binutils-2.24/ld/testsuite/ld-cris/libdso-15b.d b/binutils-2.24/ld/testsuite/ld-cris/libdso-15b.d new file mode 100644 index 0000000..308b110 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/libdso-15b.d @@ -0,0 +1,38 @@ +#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. +# 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+[ ]+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/binutils-2.24/ld/testsuite/ld-cris/libdso-1b.d b/binutils-2.24/ld/testsuite/ld-cris/libdso-1b.d new file mode 100644 index 0000000..9ad2143 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/libdso-1b.d @@ -0,0 +1,15 @@ +#source: dso-1b.s +#as: --pic --no-underscore --em=criself -I$srcdir/$subdir +#ld: --shared -m crislinux --version-script $srcdir/$subdir/hidedsofns2468 +#objdump: -T + +# Like libdso-1, but export the function as expfn@@TST2 and another +# function as expobj@@TST2. + +.*: file format elf32-cris + +DYNAMIC SYMBOL TABLE: +#... +00000[12].[02468ace] g DF .text 0+2[ ]+TST2[ ]+expobj +00000[12].[02468ace] g DF .text 0+2[ ]+TST2[ ]+expfn +#pass diff --git a/binutils-2.24/ld/testsuite/ld-cris/libdso-1c.d b/binutils-2.24/ld/testsuite/ld-cris/libdso-1c.d new file mode 100644 index 0000000..066d5e2 --- /dev/null +++ b/binutils-2.24/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/binutils-2.24/ld/testsuite/ld-cris/libdso-1d.d b/binutils-2.24/ld/testsuite/ld-cris/libdso-1d.d new file mode 100644 index 0000000..47721de --- /dev/null +++ b/binutils-2.24/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/binutils-2.24/ld/testsuite/ld-cris/libdso-2.d b/binutils-2.24/ld/testsuite/ld-cris/libdso-2.d new file mode 100644 index 0000000..3b4777a --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/libdso-2.d @@ -0,0 +1,58 @@ +#source: dso-1.s +#source: dso-2.s +#as: --pic --no-underscore --em=criself +#ld: --shared -m crislinux --version-script $srcdir/$subdir/hide1 +#readelf: -S -s -r + +# Use "dsofn" from dso-1 in a GOTPLT reloc, but hide it in a +# version script. This will change the incoming GOTPLT reloc to +# instead be a (local) GOT reloc. There are no other .rela.got +# entries. This formerly SEGV:ed because .rela.got was created +# too late to have it mapped to an output section. + +There are 13 section headers.* +#... + +\[ 1\] \.hash +HASH +.* + +\[ 2\] \.dynsym +DYNSYM +.* + +\[ 3\] \.dynstr +STRTAB +.* + +\[ 4\] \.gnu\.version +VERSYM +.* + +\[ 5\] \.gnu\.version_d +VERDEF +.* + +\[ 6\] \.rela\.dyn +RELA +.* + +\[ 7\] \.text +PROGBITS .* + +\[ 8\] \.dynamic +DYNAMIC +.* + +\[ 9\] \.got +PROGBITS .* + +\[10\] \.shstrtab +STRTAB +.* + +\[11\] \.symtab +SYMTAB +.* + +\[12\] \.strtab +STRTAB +.* +#... +Relocation section '\.rela\.dyn' at offset 0x[0-9a-f]+ contains 1 entries: +#... +00002[12][0-9a-f][048c] +0000000c R_CRIS_RELATIVE +150 +#... +Symbol table '\.dynsym' contains 4 entries: + +Num: +Value +Size +Type +Bind +Vis +Ndx +Name + +0: 0+ +0 +NOTYPE +LOCAL +DEFAULT +UND + +1: [0-9a-f]+ +0 +SECTION +LOCAL +DEFAULT +7 + +2: 0+ +0 +OBJECT +GLOBAL +DEFAULT +ABS TST1 + +3: 0+154 +0 +FUNC +GLOBAL +DEFAULT +7 export_1@@TST1 + +Symbol table '\.symtab' contains 18 entries: + +Num: +Value +Size +Type +Bind +Vis +Ndx +Name + +0: 0+ +0 +NOTYPE +LOCAL +DEFAULT +UND + +1: [0-9a-f]+ +0 +SECTION +LOCAL +DEFAULT +1 + +2: [0-9a-f]+ +0 +SECTION +LOCAL +DEFAULT +2 + +3: [0-9a-f]+ +0 +SECTION +LOCAL +DEFAULT +3 + +4: [0-9a-f]+ +0 +SECTION +LOCAL +DEFAULT +4 + +5: [0-9a-f]+ +0 +SECTION +LOCAL +DEFAULT +5 + +6: [0-9a-f]+ +0 +SECTION +LOCAL +DEFAULT +6 + +7: [0-9a-f]+ +0 +SECTION +LOCAL +DEFAULT +7 + +8: [0-9a-f]+ +0 +SECTION +LOCAL +DEFAULT +8 + +9: [0-9a-f]+ +0 +SECTION +LOCAL +DEFAULT +9 + +10: 0+2..[046c] +0 +OBJECT +LOCAL +DEFAULT +ABS _DYNAMIC + +11: 0+2..[046c] +0 +NOTYPE +LOCAL +DEFAULT +9 __bss_start + +12: 0+2..[046c] +0 +NOTYPE +LOCAL +DEFAULT +9 _edata + +13: 0+2..[046c] +0 +OBJECT +LOCAL +DEFAULT +ABS _GLOBAL_OFFSET_TABLE_ + +14: 0+2..[046c] +0 +NOTYPE +LOCAL +DEFAULT +9 _end + +15: 0+150 +2 +FUNC +LOCAL +DEFAULT +7 dsofn + +16: 0+ +0 +OBJECT +GLOBAL +DEFAULT +ABS TST1 + +17: 0+154 +0 +FUNC +GLOBAL +DEFAULT +7 export_1 diff --git a/binutils-2.24/ld/testsuite/ld-cris/libdso-3.d b/binutils-2.24/ld/testsuite/ld-cris/libdso-3.d new file mode 100644 index 0000000..9e18c59 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/libdso-3.d @@ -0,0 +1,14 @@ +#source: expdyn1.s +#source: dso-3.s +#as: --pic --no-underscore --em=criself +#ld: --shared -m crislinux +#objdump: -R + +# GOTOFF relocs against global symbols with non-default +# visibility got a linker error. (A non-default visibility is +# to be treated as a local definition for the reloc.) We also +# make sure we don't get unnecessary dynamic relocations. + +.*: file format elf32-cris + +DYNAMIC RELOCATION RECORDS \(none\) diff --git a/binutils-2.24/ld/testsuite/ld-cris/libdso-4.d b/binutils-2.24/ld/testsuite/ld-cris/libdso-4.d new file mode 100644 index 0000000..b7cc840 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/libdso-4.d @@ -0,0 +1,11 @@ +#source: dso-2.s +#as: --pic --no-underscore --em=criself +#ld: --shared -m crislinux +#objdump: -T + +# DSO with an undef symbol "dsofn". See undef1.d. + +.*: file format elf32-cris +#... +0+ D \*UND\* 0+ dsofn + diff --git a/binutils-2.24/ld/testsuite/ld-cris/locref1.d b/binutils-2.24/ld/testsuite/ld-cris/locref1.d new file mode 100644 index 0000000..ac26b28 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/locref1.d @@ -0,0 +1,22 @@ +#as: --no-underscore --pic --em=criself +#source: expdyn1.s +#source: locref1.s +#ld: -m crislinux +#objdump: -dt + +# Referencing a "normal" (non-hidden) symbol with a local-only PIC +# relocation is ok when building an executable. + +.*: file format elf32-cris + +SYMBOL TABLE: +#... +0+82084 l O \.got 0+ _GLOBAL_OFFSET_TABLE_ +0+80076 g F \.text 0+2 expfn +0+82090 g O \.data 0+4 expobj +#... +Disassembly of section \.text: +#... +0+80078 <y>: + 80078: 6fae f2df ffff .* + 8007e: 6fbe 0c00 0000 .* diff --git a/binutils-2.24/ld/testsuite/ld-cris/locref1.s b/binutils-2.24/ld/testsuite/ld-cris/locref1.s new file mode 100644 index 0000000..7a29841 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/locref1.s @@ -0,0 +1,3 @@ +y: + move.d expfn:GOTOFF,$r10 + move.d expobj:GOTOFF,$r11 diff --git a/binutils-2.24/ld/testsuite/ld-cris/locref2.d b/binutils-2.24/ld/testsuite/ld-cris/locref2.d new file mode 100644 index 0000000..735b10e --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/locref2.d @@ -0,0 +1,22 @@ +#as: --no-underscore --pic --em=criself +#source: gotrel1.s +#source: locref2.s +#ld: -m crislinux +#objdump: -dt + +# Referencing an undefined weak (non-hidden) symbol with a local-only +# PIC relocation is ok when building an executable. + +.*: file format elf32-cris + +SYMBOL TABLE: +#... +0+82088 l O \.got 0+ _GLOBAL_OFFSET_TABLE_ +0+ w \*UND\* 0+ expfn +0+ w \*UND\* 0+ expobj +#... +Disassembly of section \.text: +#... +0+8007c <y>: + 8007c: 6fae 78df f7ff .* + 80082: 6fbe 78df f7ff .* diff --git a/binutils-2.24/ld/testsuite/ld-cris/locref2.s b/binutils-2.24/ld/testsuite/ld-cris/locref2.s new file mode 100644 index 0000000..3b407a6 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/locref2.s @@ -0,0 +1,5 @@ + .weak expfn + .weak expobj +y: + move.d expfn:GOTOFF,$r10 + move.d expobj:GOTOFF,$r11 diff --git a/binutils-2.24/ld/testsuite/ld-cris/move-1.s b/binutils-2.24/ld/testsuite/ld-cris/move-1.s new file mode 100644 index 0000000..c023285 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/move-1.s @@ -0,0 +1,3 @@ + .text +localsym: + moveq 1,$r10 diff --git a/binutils-2.24/ld/testsuite/ld-cris/nodyn4.d b/binutils-2.24/ld/testsuite/ld-cris/nodyn4.d new file mode 100644 index 0000000..c1af092 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/nodyn4.d @@ -0,0 +1,19 @@ +#source: expdyn1.s +#source: expdref1.s --pic +#source: comref1.s --pic +#as: --no-underscore --em=criself +#ld: -m crislinux +#readelf: -l + +# Like expdyn4.d, but no --export-dynamic. Got a BFD_ASSERT at one time. +# Check that we get the expected sections. + +#... +There are 2 program headers, .* +#... + LOAD [0-9a-fx ]+ R E 0x2000 + LOAD [0-9a-fx ]+ RW 0x2000 +#... + 00 \.text[ ]* + 01 \.got \.data \.bss[ ]* +#pass diff --git a/binutils-2.24/ld/testsuite/ld-cris/nodyn5.d b/binutils-2.24/ld/testsuite/ld-cris/nodyn5.d new file mode 100644 index 0000000..28b581e --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/nodyn5.d @@ -0,0 +1,13 @@ +#source: expdyn1.s +#source: expdref1.s --pic +#source: comref1.s --pic +#as: --no-underscore --em=criself +#ld: -m crislinux +#objdump: -s -j .got + +# Like nodyn4.d, but checking .got contents. + +.*: file format elf32-cris +Contents of section \.got: + 820a4 00000000 00000000 00000000 c0200800 .* + 820b4 76000800 bc200800 .* diff --git a/binutils-2.24/ld/testsuite/ld-cris/noglob1.d b/binutils-2.24/ld/testsuite/ld-cris/noglob1.d new file mode 100644 index 0000000..49ca3b6 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/noglob1.d @@ -0,0 +1,9 @@ +#ld: +#target: cris-*-*elf* cris-*-*aout* +#objdump: -p + +# Check that we can link an object that doesn't have any global symbols; +# where elf_sym_hashes(bfd) is NULL. + +.*: file format .*-cris +#pass diff --git a/binutils-2.24/ld/testsuite/ld-cris/noglob1.s b/binutils-2.24/ld/testsuite/ld-cris/noglob1.s new file mode 100644 index 0000000..62111bf --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/noglob1.s @@ -0,0 +1,4 @@ +; See noglob1.d + .text +x: + move.d .,$r0 diff --git a/binutils-2.24/ld/testsuite/ld-cris/noov.d b/binutils-2.24/ld/testsuite/ld-cris/noov.d new file mode 100644 index 0000000..c591583 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/noov.d @@ -0,0 +1,13 @@ +#target: cris-*-*elf* +#ld: --section-start=.text=0xc0010000 +#objdump: -s -j .text + +# Check that we don't get a "relocation truncated to fit", when a +# relocation would overflow if it hadn't been wrapping. We always +# want 32-bit-wrapping on a 32-bit target for the benefit of Linux +# address-mapping macros. + +.*: file format elf32.*-cris + +Contents of section \.text: + c0010000 04200100 00200100 .* diff --git a/binutils-2.24/ld/testsuite/ld-cris/noov.s b/binutils-2.24/ld/testsuite/ld-cris/noov.s new file mode 100644 index 0000000..88e803f --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/noov.s @@ -0,0 +1,14 @@ + .text + ; Test that this works both with a symbol defined in a section... + .dword __Edata+0x40000000 + + ; ...as well as absolute symbol (defined outside sections in the + ; linker script). + .dword __Sdata+0x40000000 + + .data + ; Make sure we get the same section alignment for *-elf as for *-linux*. + .balign 0x2000 + + ; Make .data non-empty. + .dword 0 diff --git a/binutils-2.24/ld/testsuite/ld-cris/pcrelcp-1.d b/binutils-2.24/ld/testsuite/ld-cris/pcrelcp-1.d new file mode 100644 index 0000000..95fb235 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/pcrelcp-1.d @@ -0,0 +1,34 @@ +#as: --no-underscore --em=criself +#ld: -shared -m crislinux -z nocombreloc +#ld_after_inputfiles: tmpdir/libdso-1b.so +#warning: \A[^\n]*\.o, section `.text', to symbol `expfn@@TST2':\n +#warning: [^\n]*recompile with -fPIC\Z +#readelf: -a + +# Building a DSO with (unrecommended) non-pic pc-relative references +# to a versioned symbol in a library got caught by an assert in +# elf_cris_copy_indirect_symbol wherein the list of pc-relative +# references wasn't merged, but simply asserted to be NULL before +# copied to, on the merged-to (direct) symbol. For versioned symbols, +# there was an "extra" copy made, to make a base-version symbol, where +# the copied-from pc-relative list was NULL but the copied-to symbol +# already had a list merged. + +# The list was used to emit warning messages, but incorrectly held the +# relocation section for the reference, resulting in warnings being +# emitted for any section with a pc-relative relocation. + +# The test checks that there's a warning message only for the +# read-only sections section (.text) (not the read-write sections), +# that the correct number of relocations is emitted and we also check +# for the TEXTREL dynamic marker. + +#... + 0x00000016 \(TEXTREL\)[ ]+0x0 +#... +Relocation section '\.rela\.text' at offset .* contains 4 entries: +#... +Relocation section '\.rela\.data' at offset .* contains 8 entries: +#... +Relocation section '.rela.data2' at offset .* contains 16 entries: +#pass diff --git a/binutils-2.24/ld/testsuite/ld-cris/pcrelcp-1.s b/binutils-2.24/ld/testsuite/ld-cris/pcrelcp-1.s new file mode 100644 index 0000000..d1bcbee --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/pcrelcp-1.s @@ -0,0 +1,50 @@ + .symver x,expfn@TST2 ; .symver required to make @ part of name. + .global _start + .type _start,@function +_start: + .dword 0,0,0,0 + .reloc 0,R_CRIS_32_PCREL,expfn + .reloc 4,R_CRIS_32_PCREL,expfn + .reloc 8,R_CRIS_32_PCREL,x + .reloc 12,R_CRIS_32_PCREL,x +.Lfe3: + .size _start,.Lfe3-_start + + .data + .global tab1 + .type tab1,@object +tab1: + .dword 0,0,0,0,0,0,0,0 + .reloc 0,R_CRIS_32_PCREL,expfn + .reloc 4,R_CRIS_32_PCREL,expfn + .reloc 8,R_CRIS_32_PCREL,expfn + .reloc 12,R_CRIS_32_PCREL,expfn + .reloc 16,R_CRIS_32_PCREL,x + .reloc 20,R_CRIS_32_PCREL,x + .reloc 24,R_CRIS_32_PCREL,x + .reloc 28,R_CRIS_32_PCREL,x + .size tab1,.-tab1 + + .section .data2,"aw",@progbits + .global tab2 + .type tab2,@object +tab2: + .dword 0,0,0,0,0,0,0,0 + .dword 0,0,0,0,0,0,0,0 + .reloc 0,R_CRIS_32_PCREL,expfn + .reloc 4,R_CRIS_32_PCREL,expfn + .reloc 8,R_CRIS_32_PCREL,expfn + .reloc 12,R_CRIS_32_PCREL,expfn + .reloc 16,R_CRIS_32_PCREL,expfn + .reloc 20,R_CRIS_32_PCREL,expfn + .reloc 24,R_CRIS_32_PCREL,expfn + .reloc 28,R_CRIS_32_PCREL,expfn + .reloc 32,R_CRIS_32_PCREL,x + .reloc 36,R_CRIS_32_PCREL,x + .reloc 40,R_CRIS_32_PCREL,x + .reloc 44,R_CRIS_32_PCREL,x + .reloc 48,R_CRIS_32_PCREL,x + .reloc 52,R_CRIS_32_PCREL,x + .reloc 56,R_CRIS_32_PCREL,x + .reloc 60,R_CRIS_32_PCREL,x + .size tab1,.-tab2 diff --git a/binutils-2.24/ld/testsuite/ld-cris/pic-gc-72.d b/binutils-2.24/ld/testsuite/ld-cris/pic-gc-72.d new file mode 100644 index 0000000..7e72752 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/pic-gc-72.d @@ -0,0 +1,29 @@ +#source: pic-gc-72.s +#source: expdref1.s +#source: expdyn1.s +#as: --pic --no-underscore --em=criself -I$srcdir/$subdir +#ld: --shared -m crislinux --gc-sections +#objdump: -s -t -R -p -T + +# Exercise PIC relocs through changed GC sweep function. +# There should be nothing left except from expdyn1.s. + +.*: file format elf32-cris +#... +DYNAMIC RELOCATION RECORDS \(none\) + +Contents of section .hash: +#... +Contents of section .dynsym: +#... +Contents of section .dynstr: +#... +Contents of section .text: + 016e 0f050f05 .* +Contents of section .dynamic: + 2174 .* +#... +Contents of section .got: + 21cc 74210000 00000000 00000000 .* +Contents of section .data: + 21d8 00000000 .* diff --git a/binutils-2.24/ld/testsuite/ld-cris/pic-gc-72.s b/binutils-2.24/ld/testsuite/ld-cris/pic-gc-72.s new file mode 100644 index 0000000..e09aa8a --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/pic-gc-72.s @@ -0,0 +1,3 @@ + .hidden export_1 + .include "dso-2.s" + move.w expobj:GOT16,$r10 diff --git a/binutils-2.24/ld/testsuite/ld-cris/pic-gc-73.d b/binutils-2.24/ld/testsuite/ld-cris/pic-gc-73.d new file mode 100644 index 0000000..1ef22de --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/pic-gc-73.d @@ -0,0 +1,26 @@ +#source: pic-gc-73.s +#source: expdyn1.s +#as: --pic --no-underscore --em=criself -I$srcdir/$subdir +#ld: --shared -m crislinux --gc-sections +#objdump: -s -t -R -p -T + +# Left-over code coverage case from pic-gc-72; local symbol. + +.*: file format elf32-cris +#... +DYNAMIC RELOCATION RECORDS \(none\) + +Contents of section .hash: +#... +Contents of section .dynsym: +#... +Contents of section .dynstr: +#... +Contents of section .text: + 016e 0f050f05 .* +Contents of section .dynamic: +#... +Contents of section .got: + 21cc 74210000 00000000 00000000 .* +Contents of section .data: + 21d8 00000000 .* diff --git a/binutils-2.24/ld/testsuite/ld-cris/pic-gc-73.s b/binutils-2.24/ld/testsuite/ld-cris/pic-gc-73.s new file mode 100644 index 0000000..6fd72db --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/pic-gc-73.s @@ -0,0 +1,5 @@ + .hidden export_1 + .include "dso-2.s" +dsofn: + .type dsofn,@function + move.w expobj:GOT16,$r10 diff --git a/binutils-2.24/ld/testsuite/ld-cris/pv32-1.d b/binutils-2.24/ld/testsuite/ld-cris/pv32-1.d new file mode 100644 index 0000000..c963ed1 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/pv32-1.d @@ -0,0 +1,40 @@ +#source: pv32.s +#as: --march=v32 --no-underscore --em=criself +#ld: -e here -m crislinux tmpdir/libdso-12.so +#objdump: -s -T + +# Trivial test of linking a program to a v32 DSO. + +.*: file format elf32-cris + +DYNAMIC SYMBOL TABLE: +0+8021e DF \*UND\* 0+ expfn +0+82324 g DO \.bss 0+4 expobj +0+82324 g D \.bss 0+ __bss_start +0+80238 DF \*UND\* 0+ dsofn3 +0+82324 g D \.got 0+ _edata +0+82340 g D \.bss 0+ _end +0+80264 g DF \.text 0+8 dsofn + +Contents of section \.interp: + 800d4 2f6c6962 2f6c642e 736f2e31 00 .* +#... +Contents of section \.rela\.dyn: + 801e0 24230800 09020000 00000000 .* +Contents of section \.rela\.plt: + 801ec 1c230800 0b010000 00000000 20230800 .* + 801fc 0b040000 00000000 .* +Contents of section \.plt: + 80204 84e26ffe 14230800 7e7a3f7a 04f26ffa .* + 80214 bf09b005 00000000 00006ffe 1c230800 .* + 80224 6ffabf09 b0053f7e 00000000 bf0ed4ff .* + 80234 ffffb005 6ffe2023 08006ffa bf09b005 .* + 80244 3f7e0c00 0000bf0e baffffff b005 .* +Contents of section \.text: + 80252 b005bfbe caffffff b005bfbe dcffffff .* + 80262 b0056fae 24230800 b0050000 .* +Contents of section \.dynamic: +#... +Contents of section \.got: + 82310 70220800 00000000 00000000 2a020800 .* + 82320 44020800 .* diff --git a/binutils-2.24/ld/testsuite/ld-cris/pv32.s b/binutils-2.24/ld/testsuite/ld-cris/pv32.s new file mode 100644 index 0000000..7606266 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/pv32.s @@ -0,0 +1,24 @@ + .global here + .type here,@function +here: + nop +.Lfe3: + .size here,.Lfe3-here + + .type pfn,@function +pfn: + bsr expfn + nop + bsr dsofn3 + nop +.Lfe1: + .size pfn,.Lfe1-pfn + + .global dsofn + .type dsofn,@function +dsofn: + move.d expobj,$r10 + nop +.Lfe2: + .size dsofn,.Lfe2-dsofn + diff --git a/binutils-2.24/ld/testsuite/ld-cris/stabs1.s b/binutils-2.24/ld/testsuite/ld-cris/stabs1.s new file mode 100644 index 0000000..837d69d --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/stabs1.s @@ -0,0 +1,26 @@ + .stabs "/x/y/z/",100,0,2,Ltext0 + .stabs "/blah/foo.c",100,0,2,Ltext0 + .text +Ltext0: + .global _xyzzy + .type _xyzzy, @function +_xyzzy: + .stabd 46,0,0 + .stabn 68,0,95,LM16-_xyzzy +LM16: + .long 0 + .stabn 68,0,96,LM17-_xyzzy +LM17: + .long globsym1 + .stabn 68,0,88,LM25-_xyzzy +LM25: + .long 0 + .size _xyzzy, .-_xyzzy + .stabn 192,0,0,_xyzzy-_xyzzy + .stabn 224,0,0,Lscope0-_xyzzy +Lscope0: +;# This is the stabs construct that was barfed upon; BFD for +;# a.out expects it to be of two parts, like the construct at +;# the top of this file. + .stabs "",100,0,0,Letext0 +Letext0: diff --git a/binutils-2.24/ld/testsuite/ld-cris/start1.s b/binutils-2.24/ld/testsuite/ld-cris/start1.s new file mode 100644 index 0000000..2f19811 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/start1.s @@ -0,0 +1,5 @@ + .global _start +_start: +; This must be compilable with --march=common_v10_v32. + moveq 1,$r11 + diff --git a/binutils-2.24/ld/testsuite/ld-cris/tls-commx.s b/binutils-2.24/ld/testsuite/ld-cris/tls-commx.s new file mode 100644 index 0000000..3fa4183 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/tls-commx.s @@ -0,0 +1 @@ + .tls_common x,4,4 diff --git a/binutils-2.24/ld/testsuite/ld-cris/tls-dso-dtpoffd2.d b/binutils-2.24/ld/testsuite/ld-cris/tls-dso-dtpoffd2.d new file mode 100644 index 0000000..1db2b9a --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/tls-dso-dtpoffd2.d @@ -0,0 +1,37 @@ +#source: start1.s +#source: tls-dtpoffdx.s +#source: tls-gd-1.s +#source: tls128.s +#source: tls-x.s +#as: --no-underscore --em=criself --pic -I$srcdir/$subdir +#ld: -m crislinux --shared +#objdump: -d -s -t -r -p + +# Linking a file with a DTPOFF from a .dtpoffd of a GD variable, PIC +# (globally defined here but overridable). Making sure it links and +# that the offset is correct, locally. + +.*: file format elf32-cris + +Program Header: +#... + TLS off .* + filesz 0x0+84 memsz 0x0+84 flags r-- +#... +SYMBOL TABLE: +#... +0+80 g .tdata 0+4 x +#... +Contents of section .rela.dyn: + 01a4 b8220000 17030000 00000000 .* +Contents of section .text: + 01b0 41b20000 5fae0c00 .* +#... +Contents of section .got: + 22ac 3c220000 00000000 00000000 00000000 .* + 22bc 00000000 .* +Contents of section .debug_info: + 0000 80000000 .* +#... +Disassembly of section .text: +#pass diff --git a/binutils-2.24/ld/testsuite/ld-cris/tls-dso-dtpoffd4.d b/binutils-2.24/ld/testsuite/ld-cris/tls-dso-dtpoffd4.d new file mode 100644 index 0000000..0f54e61 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/tls-dso-dtpoffd4.d @@ -0,0 +1,37 @@ +#source: start1.s +#source: tls-dtpoffdx.s +#source: tls-gd-1.s +#source: tls128.s +#source: tls-commx.s +#as: --no-underscore --em=criself --pic -I$srcdir/$subdir +#ld: -m crislinux --shared +#objdump: -d -s -t -r -p + +# Linking a file with a DTPOFF from a .dtpoffd of a GD COMMON +# variable, PIC (globally defined here but overridable). Making sure +# it links and that the offset is correct, locally. + +.*: file format elf32-cris + +Program Header: +#... + TLS off .* + filesz 0x0+80 memsz 0x0+84 flags r-- +#... +SYMBOL TABLE: +#... +0+80 g .tbss 0+4 x +#... +Contents of section .rela.dyn: + 01a4 b4220000 17030000 00000000 .* +Contents of section .text: + 01b0 41b20000 5fae0c00 .* +#... +Contents of section .got: + 22a8 38220000 00000000 00000000 00000000 .* + 22b8 00000000 .* +Contents of section .debug_info: + 0000 80000000 .* +#... +Disassembly of section .text: +#pass diff --git a/binutils-2.24/ld/testsuite/ld-cris/tls-dso-tpoffgotcomm1.d b/binutils-2.24/ld/testsuite/ld-cris/tls-dso-tpoffgotcomm1.d new file mode 100644 index 0000000..0a2ee06 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/tls-dso-tpoffgotcomm1.d @@ -0,0 +1,46 @@ +#source: start1.s +#source: tls-dso-tpoffgotcomm1.s +#as: --no-underscore --pic --em=criself -I$srcdir/$subdir +#ld: -m crislinux -shared +#objdump: -d -h -s -t -r -R -p + +# Make sure we can link a file with TPOFFGOT relocs against common +# symbols. + +.*: file format elf32-cris + +Program Header: + LOAD off 0x0+ vaddr 0x0+ paddr 0x0+ align 2\*\*13 + filesz 0x0+1c8 memsz 0x0+1c8 flags r-x + LOAD off .* + filesz .* + DYNAMIC off .* + filesz .* + TLS off .* vaddr .* paddr .* align 2\*\*2 + filesz 0x0+ memsz 0x0+8 flags r-- +#... +Sections: +#... + 7 .got 0+14 0+2240 0+2240 0+240 2\*\*2 + CONTENTS, ALLOC, LOAD, DATA +SYMBOL TABLE: +#... +0+ g \.tbss 0+4 foo +#... +0+4 g \.tbss 0+4 bar + +#... +Contents of section .got: + 2240 c8210000 00000000 00000000 00000000 .* + 2250 00000000 .* + +Disassembly of section \.text: + +0+1b8 <_start>: + 1b8: 41b2 moveq 1,\$r11 + \.\.\. + +0+1bc <do_test>: + 1bc: 2f0e 0c00 0000 add\.d c <bar\+0x8>,\$r0 + 1c2: 1f1e 1000 add\.w 0x10,\$r1 + \.\.\. diff --git a/binutils-2.24/ld/testsuite/ld-cris/tls-dso-tpoffgotcomm1.s b/binutils-2.24/ld/testsuite/ld-cris/tls-dso-tpoffgotcomm1.s new file mode 100644 index 0000000..a7c7421 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/tls-dso-tpoffgotcomm1.s @@ -0,0 +1,9 @@ + .tls_common foo,4,4 + .tls_common bar,4,4 + .text + .align 1 + .type do_test, @function +do_test: + add.d foo:TPOFFGOT,$r0 + add.w bar:TPOFFGOT16,$r1 + .size do_test, .-do_test diff --git a/binutils-2.24/ld/testsuite/ld-cris/tls-dso-x1x2-1.d b/binutils-2.24/ld/testsuite/ld-cris/tls-dso-x1x2-1.d new file mode 100644 index 0000000..b539748 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/tls-dso-x1x2-1.d @@ -0,0 +1,16 @@ +#source: tls-hx.s +#source: tls-x1x2.s +#as: --no-underscore --em=criself +#ld: -m crislinux --shared +#objdump: -T + +# A DSO providing the TLS variables x1 and x2. + +.*: file format elf32-cris + +DYNAMIC SYMBOL TABLE: +#... +0+8 g D \.tdata 0+4 x2 +#... +0+4 g D \.tdata 0+4 x1 +#... diff --git a/binutils-2.24/ld/testsuite/ld-cris/tls-dso-xz-1.d b/binutils-2.24/ld/testsuite/ld-cris/tls-dso-xz-1.d new file mode 100644 index 0000000..9a33b78 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/tls-dso-xz-1.d @@ -0,0 +1,18 @@ +#source: tls128.s +#source: tls-hx1x2.s +#source: tls-x.s +#source: tls-z.s +#as: --no-underscore --em=criself +#ld: -m crislinux --shared +#objdump: -T + +# A DSO providing the TLS variables x and z. + +.*: file format elf32-cris + +DYNAMIC SYMBOL TABLE: +#... +0+88 g D \.tdata 0+4 x +#... +0+8c g D \.tdata 0+4 z +#... diff --git a/binutils-2.24/ld/testsuite/ld-cris/tls-dtpoffdx.s b/binutils-2.24/ld/testsuite/ld-cris/tls-dtpoffdx.s new file mode 100644 index 0000000..99f331c --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/tls-dtpoffdx.s @@ -0,0 +1,2 @@ + .section .debug_info + .dtpoffd x diff --git a/binutils-2.24/ld/testsuite/ld-cris/tls-dtprelm.s b/binutils-2.24/ld/testsuite/ld-cris/tls-dtprelm.s new file mode 100644 index 0000000..f69724b --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/tls-dtprelm.s @@ -0,0 +1,26 @@ + .text + + .ifndef r + .set r,1 + .endif + + .global tlsdsofndtprelm + .type tlsdsofndtprelm,@function + .p2align 1 +tlsdsofndtprelm: + move.w x:DTPREL16,$r10 +.Lfe: + .size tlsdsofndtprelm,.Lfe-tlsdsofndtprelm + + .globl z + .section .tdata,"awT",@progbits + .p2align 2 + .type z,@object + .size z,r +z: + .fill r,1,42 + + .type x,@object + .size x,1 +x: + .byte 42 diff --git a/binutils-2.24/ld/testsuite/ld-cris/tls-e-20.d b/binutils-2.24/ld/testsuite/ld-cris/tls-e-20.d new file mode 100644 index 0000000..6b4e714 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/tls-e-20.d @@ -0,0 +1,71 @@ +#source: start1.s +#source: tls-gd-2.s --pic +#source: tls-hx.s +#source: tls-ld-6.s --pic +#source: tls-ie-10.s --pic +#source: tls-hx1x2.s --pic +#as: --no-underscore --em=criself -I$srcdir/$subdir +#ld: -m crislinux +#objdump: -d -s -h -t -r -p + +# Check that we have proper NPTL/TLS markings and GOT for an +# executable with a R_CRIS_32_GOT_GD, a R_CRIS_DTPREL and a +# R_CRIS_32_GOT_TPREL. + +.*: file format elf32-cris + +Program Header: + LOAD off 0x0+ vaddr 0x0+80000 paddr 0x0+80000 align 2\*\*13 + filesz 0x0+b0 memsz 0x0+b0 flags r-x + LOAD off 0x0+b0 vaddr 0x0+820b0 paddr 0x0+820b0 align 2\*\*13 + filesz 0x0+2c memsz 0x0+2c flags rw- + TLS off 0x0+b0 vaddr 0x0+820b0 paddr 0x0+820b0 align 2\*\*2 + filesz 0x0+c memsz 0x0+c flags r-- +private flags = 0: + +Sections: +Idx Name Size VMA LMA File off Algn + 0 \.text 0000001c 00080094 00080094 00000094 2\*\*1 + CONTENTS, ALLOC, LOAD, READONLY, CODE + 1 \.tdata 0000000c 000820b0 000820b0 000000b0 2\*\*2 + CONTENTS, ALLOC, LOAD, DATA, THREAD_LOCAL + 2 \.got 00000020 000820bc 000820bc 000000bc 2\*\*2 + CONTENTS, ALLOC, LOAD, DATA +SYMBOL TABLE: +0+80094 l d \.text 0+ \.text +0+820b0 l d \.tdata 0+ \.tdata +0+820bc l d \.got 0+ \.got +0+820bc l O \.got 0+ _GLOBAL_OFFSET_TABLE_ +0+ g \.tdata 0+4 \.hidden x +0+80098 g F \.text 0+6 tlsdsofn2 +0+8 g \.tdata 0+4 \.hidden x2 +0+80094 g \.text 0+ _start +0+820dc g \.got 0+ __bss_start +0+800a0 g F \.text 0+6 tlsdsofn +0+4 g \.tdata 0+4 \.hidden x1 +0+820dc g \.got 0+ _edata +0+820e0 g \.got 0+ _end +0+800a8 g F \.text 0+6 tlsdsofn10 + +Contents of section \.text: +#... +Contents of section \.tdata: + 820b0 28000000 29000000 2a000000 .* +Contents of section \.got: + 820bc 00000000 00000000 00000000 01000000 .* + 820cc 00000000 f4ffffff 01000000 00000000 .* + +Disassembly of section \.text: + +00080094 <_start>: + 80094: 41b2 moveq 1,\$r11 +#... +00080098 <tlsdsofn2>: + 80098: 6fae 1800 0000 move\.d 18 <x2\+0x10>,\$r10 +#... +000800a0 <tlsdsofn>: + 800a0: 6fae 0000 0000 move\.d 0 <x>,\$r10 +#... +000800a8 <tlsdsofn10>: + 800a8: 6fae 1400 0000 move\.d 14 <x2\+0xc>,\$r10 +#... diff --git a/binutils-2.24/ld/testsuite/ld-cris/tls-e-20a.d b/binutils-2.24/ld/testsuite/ld-cris/tls-e-20a.d new file mode 100644 index 0000000..13b3be8 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/tls-e-20a.d @@ -0,0 +1,112 @@ +#source: start1.s +#source: got7.s +#source: tls128.s +#source: tls-gd-2.s +#source: tls-ld-6.s +#source: tls-ie-10.s +#source: tls-hx.s +#source: tls-hx1x2.s +#as: --no-underscore --em=criself -I$srcdir/$subdir --pic +#ld: -m crislinux +#objdump: -d -s -h -t -r -p + +# Like tls-e-20.d but with an offset for all TLS GOT entries, and an +# offset for all TLS data we care about. Offsets different for TLS +# than for GOT. + +.*: file format elf32-cris + +Program Header: + LOAD off 0x0+ vaddr 0x0+80000 paddr 0x0+80000 align 2\*\*13 + filesz 0x0+dc memsz 0x0+dc flags r-x + LOAD off 0x0+dc vaddr 0x0+820dc paddr 0x0+820dc align 2\*\*13 + filesz 0x0+e4 memsz 0x0+e4 flags rw- + TLS off 0x0+dc vaddr 0x0+820dc paddr 0x0+820dc align 2\*\*2 + filesz 0x0+8c memsz 0x0+8c flags r-- +private flags = 0: + +Sections: +Idx Name Size VMA LMA File off Algn + 0 \.text 0+48 0+80094 0+80094 0+94 2\*\*1 + CONTENTS, ALLOC, LOAD, READONLY, CODE + 1 \.tdata 0+8c 0+820dc 0+820dc 0+dc 2\*\*2 + CONTENTS, ALLOC, LOAD, DATA, THREAD_LOCAL + 2 \.got 0+3c 0+82168 0+82168 0+168 2\*\*2 + CONTENTS, ALLOC, LOAD, DATA + 3 \.data 0+1c 0+821a4 0+821a4 0+1a4 2\*\*0 + CONTENTS, ALLOC, LOAD, DATA +SYMBOL TABLE: +0+80094 l d \.text 0+ \.text +0+820dc l d \.tdata 0+ \.tdata +0+82168 l d \.got 0+ \.got +0+821a4 l d \.data 0+ \.data +0+ l df \*ABS\* 0+ .* +0+ l \.tdata 0+80 tls128 +0+ l df \*ABS\* 0+ .* +0+82168 l O \.got 0+ _GLOBAL_OFFSET_TABLE_ +0+80 g \.tdata 0+4 \.hidden x +0+800c4 g F \.text 0+6 tlsdsofn2 +0+821b4 g O \.data 0+4 got7var5 +0+88 g \.tdata 0+4 \.hidden x2 +0+821ac g O \.data 0+4 got7var3 +0+821bc g O \.data 0+4 got7var7 +0+80098 g F \.text 0+2a got7fn +0+821b8 g O \.data 0+4 got7var6 +0+80094 g \.text 0+ _start +0+821c0 g \.data 0+ __bss_start +0+821a4 g O \.data 0+4 got7var1 +0+821b0 g O \.data 0+4 got7var4 +0+800cc g F \.text 0+6 tlsdsofn +0+84 g \.tdata 0+4 \.hidden x1 +0+821c0 g \.data 0+ _edata +0+821c0 g \.data 0+ _end +0+821a8 g O \.data 0+4 got7var2 +0+800d4 g F \.text 0+6 tlsdsofn10 + +Contents of section \.text: +#... +Contents of section \.tdata: + 820dc 2f000000 00000000 00000000 00000000 .* + 820ec 00000000 00000000 00000000 00000000 .* + 820fc 00000000 00000000 00000000 00000000 .* + 8210c 00000000 00000000 00000000 00000000 .* + 8211c 00000000 00000000 00000000 00000000 .* + 8212c 00000000 00000000 00000000 00000000 .* + 8213c 00000000 00000000 00000000 00000000 .* + 8214c 00000000 00000000 00000000 00000000 .* + 8215c 28000000 29000000 2a000000 .* +Contents of section \.got: + 82168 00000000 00000000 00000000 01000000 .* + 82178 00000000 f4ffffff 01000000 80000000 .* + 82188 b4210800 ac210800 bc210800 b8210800 .* + 82198 a4210800 b0210800 a8210800 .* +Contents of section \.data: + 821a4 00000000 00000000 00000000 00000000 .* + 821b4 00000000 00000000 00000000 .* + +Disassembly of section \.text: + +00080094 <_start>: + 80094: 41b2 moveq 1,\$r11 +#... +00080098 <got7fn>: + 80098: 6fae 3000 0000 move\.d 30 <tls128\+0x30>,\$r10 + 8009e: 6fae 3800 0000 move\.d 38 <tls128\+0x38>,\$r10 + 800a4: 6fae 2400 0000 move\.d 24 <tls128\+0x24>,\$r10 + 800aa: 6fae 3400 0000 move\.d 34 <tls128\+0x34>,\$r10 + 800b0: 6fae 2000 0000 move\.d 20 <tls128\+0x20>,\$r10 + 800b6: 6fae 2c00 0000 move\.d 2c <tls128\+0x2c>,\$r10 + 800bc: 6fae 2800 0000 move\.d 28 <tls128\+0x28>,\$r10 +#... + +000800c4 <tlsdsofn2>: + 800c4: 6fae 1800 0000 move\.d 18 <tls128\+0x18>,\$r10 +#... + +000800cc <tlsdsofn>: + 800cc: 6fae 8000 0000 move\.d 80 <x>,\$r10 +#... + +000800d4 <tlsdsofn10>: + 800d4: 6fae 1400 0000 move\.d 14 <tls128\+0x14>,\$r10 +#... diff --git a/binutils-2.24/ld/testsuite/ld-cris/tls-e-21.d b/binutils-2.24/ld/testsuite/ld-cris/tls-e-21.d new file mode 100644 index 0000000..fa56b9f --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/tls-e-21.d @@ -0,0 +1,39 @@ +#source: start1.s +#source: tls128.s +#source: tls-gd-2.s +#source: tls-hx.s +#as: --no-underscore --em=criself --pic +#ld: -m crislinux +#objdump: -d -s -t -r -p + +# Check that we have proper NPTL/TLS markings and GOT for an +# executable with a single R_CRIS_32_GOT_GD. + +.*: file format elf32-cris + +Program Header: +#... + TLS off 0x0+a0 vaddr 0x0+820a0 paddr 0x0+820a0 align 2\*\*2 + filesz 0x0+84 memsz 0x0+84 flags r-- +private flags = 0: +#... +SYMBOL TABLE: +#... +0+80 g \.tdata 0+4 \.hidden x +#... +Contents of section \.text: +#... +Contents of section \.tdata: +#... +Contents of section \.got: + 82124 00000000 00000000 00000000 01000000 .* + 82134 80000000 .* + +Disassembly of section \.text: + +00080094 <_start>: + 80094: 41b2 moveq 1,\$r11 +#... +00080098 <tlsdsofn2>: + 80098: 6fae 0c00 0000 move\.d c <tls128\+0xc>,\$r10 +#... diff --git a/binutils-2.24/ld/testsuite/ld-cris/tls-e-22.d b/binutils-2.24/ld/testsuite/ld-cris/tls-e-22.d new file mode 100644 index 0000000..93ab45d --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/tls-e-22.d @@ -0,0 +1,39 @@ +#source: start1.s +#source: tls128.s +#source: tls-ld-6.s +#source: tls-hx.s +#as: --no-underscore --em=criself --pic -I$srcdir/$subdir +#ld: -m crislinux +#objdump: -d -s -t -r -p + +# Check that we have proper NPTL/TLS markings and GOT for an +# executable with a single R_CRIS_DTPREL. + +.*: file format elf32-cris + +Program Header: +#... + TLS off 0x0+a0 vaddr 0x0+820a0 paddr 0x0+820a0 align 2\*\*2 + filesz 0x0+84 memsz 0x0+84 flags r-- +private flags = 0: +#... +SYMBOL TABLE: +#... +0+80 g \.tdata 0+4 \.hidden x +#... +Contents of section \.text: +#... +Contents of section \.tdata: +#... +Contents of section \.got: + 82124 00000000 00000000 00000000 01000000 .* + 82134 00000000 .* + +Disassembly of section \.text: + +00080094 <_start>: + 80094: 41b2 moveq 1,\$r11 +#... +00080098 <tlsdsofn>: + 80098: 6fae 8000 0000 move\.d 80 <x>,\$r10 +#... diff --git a/binutils-2.24/ld/testsuite/ld-cris/tls-e-23.d b/binutils-2.24/ld/testsuite/ld-cris/tls-e-23.d new file mode 100644 index 0000000..499899e --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/tls-e-23.d @@ -0,0 +1,38 @@ +#source: start1.s +#source: tls128.s +#source: tls-ie-10.s +#source: tls-hx.s +#as: --no-underscore --em=criself --pic -I$srcdir/$subdir +#ld: -m crislinux +#objdump: -d -s -t -r -p + +# Check that we have proper NPTL/TLS markings and GOT for an +# executable with a single R_CRIS_32_GOT_TPREL. + +.*: file format elf32-cris + +Program Header: +#... + TLS off 0x0+a0 vaddr 0x0+820a0 paddr 0x0+820a0 align 2\*\*2 + filesz 0x0+84 memsz 0x0+84 flags r-- +private flags = 0: +#... +SYMBOL TABLE: +#... +0+80 g \.tdata 0+4 \.hidden x +#... +Contents of section \.text: +#... +Contents of section \.tdata: +#... +Contents of section \.got: + 82124 00000000 00000000 00000000 fcffffff .* + +Disassembly of section \.text: + +00080094 <_start>: + 80094: 41b2 moveq 1,\$r11 +#... +00080098 <tlsdsofn10>: + 80098: 6fae 0c00 0000 move\.d c <tls128\+0xc>,\$r10 +#... diff --git a/binutils-2.24/ld/testsuite/ld-cris/tls-e-66.d b/binutils-2.24/ld/testsuite/ld-cris/tls-e-66.d new file mode 100644 index 0000000..ba1755d --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/tls-e-66.d @@ -0,0 +1,37 @@ +#source: start1.s +#source: tls-le-12s.s +#source: tls-z.s +#as: --no-underscore --em=criself -I$srcdir/$subdir +#ld: -m crislinux +#objdump: -d -s -t -r -p -h + +# Check that we have proper NPTL/TLS markings and no GOT for an +# executable with a single R_CRIS_16_TPREL. + +.*: file format elf32-cris + +Program Header: +#... + TLS off 0x0+9c vaddr 0x0+8209c paddr 0x0+8209c align 2\*\*2 + filesz 0x0+4 memsz 0x0+4 flags r-- +private flags = 0: +#... + 1 .tdata .* + CONTENTS.* +SYMBOL TABLE: +#... +0+ g \.tdata 0+4 z +#... +Contents of section \.text: +#... +Contents of section \.tdata: +#... + +Disassembly of section \.text: + +00080094 <_start>: + 80094: 41b2 moveq 1,\$r11 +#... +00080098 <tlsfn12>: + 80098: 7fac fcff movs\.w -4,\$r10 +#... diff --git a/binutils-2.24/ld/testsuite/ld-cris/tls-e-80.d b/binutils-2.24/ld/testsuite/ld-cris/tls-e-80.d new file mode 100644 index 0000000..7a6f459 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/tls-e-80.d @@ -0,0 +1,88 @@ +#source: start1.s +#source: tls-tbss64.s +#source: tls-ie-8e.s +#source: tls-gd-2.s --pic +#source: tls-hx.s +#source: tls-le-12.s +#source: tls-z.s +#source: tls-ld-6.s --pic +#source: tls-ie-10.s --pic +#source: tls-hx1x2.s --pic +#as: --no-underscore --em=criself -I$srcdir/$subdir +#ld: -m crislinux +#objdump: -d -s -h -t -r -p + +# Check that we have proper NPTL/TLS markings and GOT for an +# executable with a R_CRIS_32_GOT_GD, a R_CRIS_DTPREL, a +# R_CRIS_32_GOT_TPREL, a R_CRIS_32_TPREL and a R_CRIS_32_IE. + +.*: file format elf32-cris + +Program Header: + LOAD off 0x0+ vaddr 0x0+80000 paddr 0x0+80000 align 2\*\*13 + filesz 0x0+c0 memsz 0x0+c0 flags r-x + LOAD off 0x0+c0 vaddr 0x0+820c0 paddr 0x0+820c0 align 2\*\*13 + filesz 0x0+30 memsz 0x0+30 flags rw- + TLS off 0x0+c0 vaddr 0x0+820c0 paddr 0x0+820c0 align 2\*\*2 + filesz 0x0+10 memsz 0x0+50 flags r-- +private flags = 0: + +Sections: +Idx Name Size VMA LMA File off Algn + 0 \.text 0+2c 0+80094 0+80094 0+94 2\*\*1 + CONTENTS, ALLOC, LOAD, READONLY, CODE + 1 \.tdata 0+10 0+820c0 0+820c0 0+c0 2\*\*2 + CONTENTS, ALLOC, LOAD, DATA, THREAD_LOCAL + 2 \.tbss 0+40 000820d0 0+820d0 0+d0 2\*\*2 + ALLOC, THREAD_LOCAL + 3 \.got 0+20 0+820d0 0+820d0 0+d0 2\*\*2 + CONTENTS, ALLOC, LOAD, DATA +SYMBOL TABLE: +0+80094 l d \.text 0+ \.text +0+820c0 l d \.tdata 0+ \.tdata +0+820d0 l d \.tbss 0+ \.tbss +0+820d0 l d \.got 0+ \.got +0+820d0 l O \.got 0+ _GLOBAL_OFFSET_TABLE_ +0+ g \.tdata 0+4 \.hidden x +0+800a0 g F \.text 0+6 tlsdsofn2 +0+800a8 g F \.text 0+6 tlsfn12 +0+c g \.tdata 0+4 \.hidden x2 +0+4 g \.tdata 0+4 z +0+80094 g \.text 0+ _start +0+80098 g F \.text 0+6 tlsfn +0+820f0 g \.got 0+ __bss_start +0+800b0 g F \.text 0+6 tlsdsofn +0+8 g \.tdata 0+4 \.hidden x1 +0+820f0 g \.got 0+ _edata +0+82100 g \.got 0+ _end +0+10 g \.tbss 0+40 gx +0+800b8 g F \.text 0+6 tlsdsofn10 + +Contents of section \.text: +#... +Contents of section \.tdata: + 820c0 28000000 2a000000 29000000 2a000000 .* +Contents of section \.got: + 820d0 00000000 00000000 00000000 01000000 .* + 820e0 00000000 b0ffffff 01000000 00000000 .* + +Disassembly of section \.text: + +00080094 <_start>: + 80094: 41b2 moveq 1,\$r11 +#... +00080098 <tlsfn>: + 80098: 6fae e420 0800 move.d 820e4 <_GLOBAL_OFFSET_TABLE_\+0x14>,\$r10 +#... +000800a0 <tlsdsofn2>: + 800a0: 6fae 1800 0000 move\.d 18 <gx\+0x8>,\$r10 +#... +000800a8 <tlsfn12>: + 800a8: 6fae b4ff ffff move.d 0xffffffb4,\$r10 +#... +000800b0 <tlsdsofn>: + 800b0: 6fae 0000 0000 move\.d 0 <x>,\$r10 +#... +000800b8 <tlsdsofn10>: + 800b8: 6fae 1400 0000 move\.d 14 <gx\+0x4>,\$r10 +#... diff --git a/binutils-2.24/ld/testsuite/ld-cris/tls-e-dtpoffd1.d b/binutils-2.24/ld/testsuite/ld-cris/tls-e-dtpoffd1.d new file mode 100644 index 0000000..5da24b5 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/tls-e-dtpoffd1.d @@ -0,0 +1,32 @@ +#source: start1.s +#source: tls-dtpoffdx.s +#source: tls-gd-1.s +#source: tls128.s +#source: tls-x.s +#as: --no-underscore --em=criself --pic -I$srcdir/$subdir +#ld: -m crislinux +#objdump: -d -s -t -r -p + +.*: file format elf32-cris + +Program Header: +#... + TLS off .* + filesz 0x0+84 memsz 0x0+84 flags r-- +private flags = 0: + +SYMBOL TABLE: +#... +0+80 g .tdata 0+4 x +#... +Contents of section .text: + 80094 41b20000 5fae0c00 .* +Contents of section .tdata: +#... +Contents of section .got: + 82120 00000000 00000000 00000000 01000000 .* + 82130 80000000 .* +Contents of section .debug_info: + 0000 80000000 .* +Contents of section .debug_line: +#pass diff --git a/binutils-2.24/ld/testsuite/ld-cris/tls-e-dtpoffd3.d b/binutils-2.24/ld/testsuite/ld-cris/tls-e-dtpoffd3.d new file mode 100644 index 0000000..6013a3a --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/tls-e-dtpoffd3.d @@ -0,0 +1,32 @@ +#source: start1.s +#source: tls-dtpoffdx.s +#source: tls-gd-1.s +#source: tls128.s +#source: tls-commx.s +#as: --no-underscore --em=criself --pic -I$srcdir/$subdir +#ld: -m crislinux +#objdump: -d -s -t -r -p + +.*: file format elf32-cris + +Program Header: +#... + TLS off .* + filesz 0x0+80 memsz 0x0+84 flags r-- +private flags = 0: + +SYMBOL TABLE: +#... +0+80 g .tbss 0+4 x +#... +Contents of section .text: + 80094 41b20000 5fae0c00 .* +Contents of section .tdata: +#... +Contents of section .got: + 8211c 00000000 00000000 00000000 01000000 .* + 8212c 80000000 .* +Contents of section .debug_info: + 0000 80000000 .* +Contents of section .debug_line: +#pass diff --git a/binutils-2.24/ld/testsuite/ld-cris/tls-e-tpiecomm1.d b/binutils-2.24/ld/testsuite/ld-cris/tls-e-tpiecomm1.d new file mode 100644 index 0000000..2e0f0f0 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/tls-e-tpiecomm1.d @@ -0,0 +1,47 @@ +#source: start1.s +#source: tls-e-tpiecomm1.s +#as: --no-underscore --em=criself -I$srcdir/$subdir +#ld: -m crislinux +#objdump: -d -s -h -t -r -p + +# Make sure we can link a file with IE relocs against common +# symbols and that the values entered in the GOT are right. + +.*: file format elf32-cris + +Program Header: + LOAD off 0x0+ vaddr 0x0+80000 paddr 0x0+80000 align 2\*\*13 + filesz 0x0+a4 memsz 0x0+a4 flags r-x + LOAD off 0x0+a4 vaddr 0x0+820a4 paddr 0x0+820a4 align 2\*\*13 + filesz 0x0+14 memsz 0x0+14 flags rw- + TLS off 0x0+a4 vaddr 0x0+820a4 paddr 0x0+820a4 align 2\*\*2 + filesz 0x0+ memsz 0x0+8 flags r-- +private flags = 0: + +Sections: +Idx Name Size VMA LMA File off Algn + 0 \.text 0+10 0+80094 0+80094 0+94 2\*\*1 + CONTENTS, ALLOC, LOAD, READONLY, CODE + 1 \.tbss 0+8 0+820a4 0+820a4 0+a4 2\*\*2 + ALLOC, THREAD_LOCAL + 2 \.got 0+14 0+820a4 0+820a4 0+a4 2\*\*2 + CONTENTS, ALLOC, LOAD, DATA +SYMBOL TABLE: +#... +0+ g .tbss 0+4 foo +#... +0+4 g .tbss 0+4 bar +#... +Contents of section \.got: + 820a4 00000000 00000000 00000000 f8ffffff .* + 820b4 fcffffff .* + +Disassembly of section \.text: + +0+80094 <_start>: + 80094: 41b2 moveq 1,\$r11 + \.\.\. + +0+80098 <do_test>: + 80098: 6f0e b020 0800 move\.d 820b0 <_GLOBAL_OFFSET_TABLE_\+0xc>,\$r0 + 8009e: 2f1e b420 0800 add\.d 820b4 <_GLOBAL_OFFSET_TABLE_\+0x10>,\$r1 diff --git a/binutils-2.24/ld/testsuite/ld-cris/tls-e-tpiecomm1.s b/binutils-2.24/ld/testsuite/ld-cris/tls-e-tpiecomm1.s new file mode 100644 index 0000000..ca9aedc --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/tls-e-tpiecomm1.s @@ -0,0 +1,9 @@ + .tls_common foo,4,4 + .tls_common bar,4,4 + .text + .align 1 + .type do_test, @function +do_test: + move.d foo:IE,$r0 + add.d bar:IE,$r1 + .size do_test, .-do_test diff --git a/binutils-2.24/ld/testsuite/ld-cris/tls-e-tpoffcomm1.d b/binutils-2.24/ld/testsuite/ld-cris/tls-e-tpoffcomm1.d new file mode 100644 index 0000000..b1f39ec --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/tls-e-tpoffcomm1.d @@ -0,0 +1,45 @@ +#source: start1.s +#source: tls-e-tpoffcomm1.s +#as: --no-underscore --em=criself -I$srcdir/$subdir +#ld: -m crislinux +#objdump: -d -s -h -t -r -p + +# Make sure we can link a file with TPOFF relocs against common +# symbols. + +.*: file format elf32-cris + +Program Header: + LOAD off 0x0+ vaddr 0x0+80000 paddr 0x0+80000 align 2\*\*13 + filesz 0x0+84 memsz 0x0+84 flags r-x + TLS off 0x0+84 vaddr 0x0+82084 paddr 0x0+82084 align 2\*\*2 + filesz 0x0+ memsz 0x0+8 flags r-- +private flags = 0: + +Sections: +Idx Name Size VMA LMA File off Algn + 0 .text 0+10 0+80074 0+80074 0+74 2\*\*1 + CONTENTS, ALLOC, LOAD, READONLY, CODE + 1 .tbss 0+8 0+82084 0+82084 0+84 2\*\*2 + ALLOC, THREAD_LOCAL +SYMBOL TABLE: +0+80074 l d \.text 0+ \.text +0+82084 l d \.tbss 0+ \.tbss +0+ l df \*ABS\* 0+ .* +0+80078 l F \.text 0+c do_test +0+ l df \*ABS\* 0+ .* +0+80074 g \.text 0+ _start +0+82084 g \.text 0+ __bss_start +0+ g \.tbss 0+4 foo +0+82084 g \.text 0+ _edata +0+820a0 g \.text 0+ _end +0+4 g \.tbss 0+4 bar +#... +Disassembly of section \.text: + +00080074 <_start>: + 80074: 41b2 moveq 1,\$r11 +#... +00080078 <do_test>: + 80078: 2f0e f8ff ffff add.d 0xfffffff8,\$r0 + 8007e: 2f1e fcff ffff add.d 0xfffffffc,\$r1 diff --git a/binutils-2.24/ld/testsuite/ld-cris/tls-e-tpoffcomm1.s b/binutils-2.24/ld/testsuite/ld-cris/tls-e-tpoffcomm1.s new file mode 100644 index 0000000..a9f03ae --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/tls-e-tpoffcomm1.s @@ -0,0 +1,9 @@ + .tls_common foo,4,4 + .tls_common bar,4,4 + .text + .align 1 + .type do_test, @function +do_test: + add.d foo:TPOFF,$r0 + add.d bar:TPOFF,$r1 + .size do_test, .-do_test diff --git a/binutils-2.24/ld/testsuite/ld-cris/tls-e-tpoffgotcomm1.d b/binutils-2.24/ld/testsuite/ld-cris/tls-e-tpoffgotcomm1.d new file mode 100644 index 0000000..9d34f68 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/tls-e-tpoffgotcomm1.d @@ -0,0 +1,43 @@ +#source: start1.s +#source: tls-dso-tpoffgotcomm1.s --pic +#as: --no-underscore --em=criself -I$srcdir/$subdir +#ld: -m crislinux +#objdump: -d -s -h -t -p + +# Like tls-dso-tpoffgotcomm1.d but making sure we can link *an +# executable* with TPOFFGOT relocs against common symbols. + +.*: file format elf32-cris + +Program Header: + LOAD off 0x0+ vaddr 0x0+80000 paddr 0x0+80000 align 2\*\*13 + filesz 0x0+a4 memsz 0x0+a4 flags r-x + LOAD off .* + filesz .* + TLS off 0x0+a4 vaddr .* paddr .* align 2\*\*2 + filesz 0x0+ memsz 0x0+8 flags r-- +private flags = 0: + +Sections: +#... + 2 \.got 0+14 0+820a4 0+820a4 0+a4 2\*\*2 + CONTENTS, ALLOC, LOAD, DATA +SYMBOL TABLE: +#... +0+ g \.tbss 0+4 foo +#... +0+4 g \.tbss 0+4 bar +#... +Contents of section .got: + 820a4 00000000 00000000 00000000 f8ffffff .* + 820b4 fcffffff .* + +Disassembly of section \.text: + +0+80094 <_start>: + 80094: 41b2 moveq 1,\$r11 +#... +0+80098 <do_test>: + 80098: 2f0e 0c00 0000 add.d c <bar\+0x8>,\$r0 + 8009e: 1f1e 1000 add.w 0x10,\$r1 + \.\.\. diff --git a/binutils-2.24/ld/testsuite/ld-cris/tls-err-20x.d b/binutils-2.24/ld/testsuite/ld-cris/tls-err-20x.d new file mode 100644 index 0000000..75e3b03 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/tls-err-20x.d @@ -0,0 +1,11 @@ +#source: init.s +#source: tls-ie-9.s --pic +#source: tls-ld-6.s --pic +#source: tls-ie-10.s --pic +#source: tls-hx.s --pic +#as: --no-underscore --em=criself +#ld: -m crislinux +#error: \A[^\n]*: warning: cannot find entry symbol _start; defaulting to [0-9a-f]*\n[^\n]*: In function `tlsdsofn9':\n[^\n]*: undefined reference to `x1'\n[^\n]*: In function `tlsdsofn9':\n[^n]*: undefined reference to `x2'\Z + +# Code coverage case similar to tls-e-20.d, except with an undefined +# reference. diff --git a/binutils-2.24/ld/testsuite/ld-cris/tls-err-24.d b/binutils-2.24/ld/testsuite/ld-cris/tls-err-24.d new file mode 100644 index 0000000..e1bc88b --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/tls-err-24.d @@ -0,0 +1,7 @@ +#source: tls-le-12s.s +#source: tls-z.s +#as: --no-underscore --em=criself +#ld: --shared -m crislinux +#error: \A[^\n]*\.o, [^\n]*\n[^\n]*mixup[^\n]*\n[^\n]*Invalid operation\Z + +# Check that R_CRIS_16_TPREL in input to a DSO is flagged as an error. diff --git a/binutils-2.24/ld/testsuite/ld-cris/tls-err-25.d b/binutils-2.24/ld/testsuite/ld-cris/tls-err-25.d new file mode 100644 index 0000000..df5ca6b --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/tls-err-25.d @@ -0,0 +1,7 @@ +#source: tls-le-12.s +#source: tls-z.s +#as: --no-underscore --em=criself +#ld: --shared -m crislinux +#error: \A[^\n]*\.o, [^\n]*\n[^\n]*mixup[^\n]*\n[^\n]*Invalid operation\Z + +# Check that R_CRIS_32_TPREL in input to a DSO is flagged as an error. diff --git a/binutils-2.24/ld/testsuite/ld-cris/tls-err-26.d b/binutils-2.24/ld/testsuite/ld-cris/tls-err-26.d new file mode 100644 index 0000000..71ecc9b --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/tls-err-26.d @@ -0,0 +1,8 @@ +#source: tls-ld-4.s +#source: tls-x.s +#as: --no-underscore --em=criself --pic +#ld: --shared -m crislinux +#error: \A[^\n]*\.o,[^\n]*mixup[^\n]*\n[^\n]*Bad value\Z + +# Check that R_CRIS_16_DTPREL on non-module-local symbol in input to a +# DSO is flagged as an error. diff --git a/binutils-2.24/ld/testsuite/ld-cris/tls-err-27.d b/binutils-2.24/ld/testsuite/ld-cris/tls-err-27.d new file mode 100644 index 0000000..3d40b03 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/tls-err-27.d @@ -0,0 +1,8 @@ +#source: tls-ld-6.s +#source: tls-x.s +#as: --no-underscore --em=criself --pic +#ld: --shared -m crislinux +#error: \A[^\n]*\.o,[^\n]*mixup[^\n]*\n[^\n]*Bad value\Z + +# Check that R_CRIS_32_DTPREL on non-module-local symbol in input to a +# DSO is flagged as an error. diff --git a/binutils-2.24/ld/testsuite/ld-cris/tls-err-28.d b/binutils-2.24/ld/testsuite/ld-cris/tls-err-28.d new file mode 100644 index 0000000..d7bfa9d --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/tls-err-28.d @@ -0,0 +1,7 @@ +#source: tls-gd-3.s +#source: tls-x.s +#as: --no-underscore --em=criself +#ld: --shared -m crislinux +#error: \A[^\n]*\.o, [^\n]*\n[^\n]*mixup[^\n]*\n[^\n]*Invalid operation\Z + +# Check that a R_CRIS_32_GD in input to a DSO is flagged as an error. diff --git a/binutils-2.24/ld/testsuite/ld-cris/tls-err-29.d b/binutils-2.24/ld/testsuite/ld-cris/tls-err-29.d new file mode 100644 index 0000000..1024ea8 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/tls-err-29.d @@ -0,0 +1,7 @@ +#source: init.s +#source: tls-gdgotrelm.s --defsym r=8192 +#as: --no-underscore --em=criself --pic +#ld: --shared -m crislinux +#error: \A[^\n]*\.o: In function[^\n]*\n[^\n]*truncated[^\n]*\n[^\n]*too many[^\n]*\Z + +# Check that overflow for R_CRIS_16_GOT_GD is flagged as an error. diff --git a/binutils-2.24/ld/testsuite/ld-cris/tls-err-31.d b/binutils-2.24/ld/testsuite/ld-cris/tls-err-31.d new file mode 100644 index 0000000..b95fa54 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/tls-err-31.d @@ -0,0 +1,6 @@ +#source: tls-dtprelm.s --defsym r=32768 +#as: --no-underscore --em=criself --pic +#ld: --shared -m crislinux +#error: \A[^\n]*\.o: In function[^\n]*\n[^\n]*truncated[^\n]*\n[^\n]*too big[^\n]*\Z + +# Check that overflow for R_CRIS_16_DTPREL is flagged as an error. diff --git a/binutils-2.24/ld/testsuite/ld-cris/tls-err-33.d b/binutils-2.24/ld/testsuite/ld-cris/tls-err-33.d new file mode 100644 index 0000000..6872bbd --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/tls-err-33.d @@ -0,0 +1,6 @@ +#source: tls-gottprelm.s --defsym r=8190 +#as: --no-underscore --em=criself --pic +#ld: --shared -m crislinux +#error: \A[^\n]*\.o: In function[^\n]*\n[^\n]*truncated[^\n]*\n[^\n]*too many[^\n]*\Z + +# Check that overflow for R_CRIS_16_GOT_TPREL is flagged as an error. diff --git a/binutils-2.24/ld/testsuite/ld-cris/tls-err-35.d b/binutils-2.24/ld/testsuite/ld-cris/tls-err-35.d new file mode 100644 index 0000000..9aa7b87 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/tls-err-35.d @@ -0,0 +1,7 @@ +#source: start1.s +#source: tls-tprelm.s --defsym r=32768 +#as: --no-underscore --em=criself +#ld: -m crislinux +#error: \A[^\n]*\.o: In function[^\n]*\n[^\n]*truncated[^\n]*\n[^\n]*too big[^\n]*\Z + +# Check that overflow for R_CRIS_16_TPREL is flagged as an error. diff --git a/binutils-2.24/ld/testsuite/ld-cris/tls-err-37.d b/binutils-2.24/ld/testsuite/ld-cris/tls-err-37.d new file mode 100644 index 0000000..e2efff1 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/tls-err-37.d @@ -0,0 +1,7 @@ +#source: start1.s +#source: tls-gd-2.s --pic +#as: --no-underscore --em=criself +#ld: -m crislinux +#error: \A[^\n]*\.o: In function[^\n]*\n[^\n]*undefined reference[^\n]*\Z + +# Undefined reference for a R_CRIS_32_GOT_GD in an executable. diff --git a/binutils-2.24/ld/testsuite/ld-cris/tls-err-39.d b/binutils-2.24/ld/testsuite/ld-cris/tls-err-39.d new file mode 100644 index 0000000..dab70f2 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/tls-err-39.d @@ -0,0 +1,7 @@ +#source: start1.s +#source: tls-ld-6.s --pic +#as: --no-underscore --em=criself +#ld: -m crislinux +#error: \A[^\n]*\.o: In function[^\n]*\n[^\n]*undefined reference[^\n]*\Z + +# Undefined reference for a R_CRIS_32_DTPREL in an executable. diff --git a/binutils-2.24/ld/testsuite/ld-cris/tls-err-40.d b/binutils-2.24/ld/testsuite/ld-cris/tls-err-40.d new file mode 100644 index 0000000..ef9a18a --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/tls-err-40.d @@ -0,0 +1,6 @@ +#source: tls-ld-6.s --pic +#as: --no-underscore --em=criself +#ld: -m crislinux --shared +#error: \A[^\n]*\.o[^\n]*undefined reference[^\n]*\n[^\n]*Bad value\Z + +# Undefined reference for a R_CRIS_32_DTPREL in a DSO. diff --git a/binutils-2.24/ld/testsuite/ld-cris/tls-err-41.d b/binutils-2.24/ld/testsuite/ld-cris/tls-err-41.d new file mode 100644 index 0000000..b751f0a --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/tls-err-41.d @@ -0,0 +1,7 @@ +#source: start1.s +#source: tls-ie-10.s --pic +#as: --no-underscore --em=criself +#ld: -m crislinux +#error: \A[^\n]*\.o: In function[^\n]*\n[^\n]*undefined reference[^\n]*\Z + +# Undefined reference for a R_CRIS_32_GOT_TPREL in an executable. diff --git a/binutils-2.24/ld/testsuite/ld-cris/tls-err-43.d b/binutils-2.24/ld/testsuite/ld-cris/tls-err-43.d new file mode 100644 index 0000000..f516c6f --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/tls-err-43.d @@ -0,0 +1,7 @@ +#source: start1.s +#source: tls-le-12.s +#as: --no-underscore --em=criself +#ld: -m crislinux +#error: \A[^\n]*\.o: In function[^\n]*\n[^\n]*undefined reference[^\n]*\Z + +# Undefined reference for a R_CRIS_32_TPREL in an executable. diff --git a/binutils-2.24/ld/testsuite/ld-cris/tls-err-44.d b/binutils-2.24/ld/testsuite/ld-cris/tls-err-44.d new file mode 100644 index 0000000..251470d --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/tls-err-44.d @@ -0,0 +1,8 @@ +#source: tls-le-12.s +#as: --no-underscore --em=criself +#ld: -m crislinux --shared +#error: \A[^\n]*\.o, [^\n]*\n[^\n]*mixup[^\n]*\n[^\n]*Invalid operation\Z + +# Undefined reference for a R_CRIS_32_TPREL in a DSO (where it's +# invalid in the first place anyway, so we should see the same +# behavior as for that test, tls-err-25.d). diff --git a/binutils-2.24/ld/testsuite/ld-cris/tls-err-45.d b/binutils-2.24/ld/testsuite/ld-cris/tls-err-45.d new file mode 100644 index 0000000..be847ba --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/tls-err-45.d @@ -0,0 +1,7 @@ +#source: start1.s +#source: tls-gd-1.s --pic +#as: --no-underscore --em=criself +#ld: -m crislinux +#error: \A[^\n]*\.o: In function[^\n]*\n[^\n]*undefined reference[^\n]*\Z + +# Undefined reference for a R_CRIS_16_GOT_GD in an executable. diff --git a/binutils-2.24/ld/testsuite/ld-cris/tls-err-47.d b/binutils-2.24/ld/testsuite/ld-cris/tls-err-47.d new file mode 100644 index 0000000..d9a1a30 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/tls-err-47.d @@ -0,0 +1,7 @@ +#source: start1.s +#source: tls-ld-4.s --pic +#as: --no-underscore --em=criself +#ld: -m crislinux +#error: \A[^\n]*\.o: In function[^\n]*\n[^\n]*undefined reference[^\n]*\Z + +# Undefined reference for a R_CRIS_16_DTPREL in an executable. diff --git a/binutils-2.24/ld/testsuite/ld-cris/tls-err-48.d b/binutils-2.24/ld/testsuite/ld-cris/tls-err-48.d new file mode 100644 index 0000000..9165fcd --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/tls-err-48.d @@ -0,0 +1,6 @@ +#source: tls-ld-4.s --pic +#as: --no-underscore --em=criself +#ld: -m crislinux --shared +#error: \A[^\n]*\.o[^\n]*undefined reference[^\n]*\n[^\n]*Bad value\Z + +# Undefined reference for a R_CRIS_16_DTPREL in a DSO. diff --git a/binutils-2.24/ld/testsuite/ld-cris/tls-err-49.d b/binutils-2.24/ld/testsuite/ld-cris/tls-err-49.d new file mode 100644 index 0000000..6ff4ba5 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/tls-err-49.d @@ -0,0 +1,7 @@ +#source: start1.s +#source: tls-ie-8.s --pic +#as: --no-underscore --em=criself +#ld: -m crislinux +#error: \A[^\n]*\.o: In function[^\n]*\n[^\n]*undefined reference[^\n]*\Z + +# Undefined reference for a R_CRIS_16_GOT_TPREL in an executable. diff --git a/binutils-2.24/ld/testsuite/ld-cris/tls-err-51.d b/binutils-2.24/ld/testsuite/ld-cris/tls-err-51.d new file mode 100644 index 0000000..8e71cc5 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/tls-err-51.d @@ -0,0 +1,7 @@ +#source: start1.s +#source: tls-le-12s.s +#as: --no-underscore --em=criself +#ld: -m crislinux +#error: \A[^\n]*\.o: In function[^\n]*\n[^\n]*undefined reference[^\n]*\Z + +# Undefined reference for a R_CRIS_16_TPREL in an executable. diff --git a/binutils-2.24/ld/testsuite/ld-cris/tls-err-52.d b/binutils-2.24/ld/testsuite/ld-cris/tls-err-52.d new file mode 100644 index 0000000..cf0bbbc --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/tls-err-52.d @@ -0,0 +1,8 @@ +#source: tls-le-12s.s +#as: --no-underscore --em=criself +#ld: -m crislinux --shared +#error: \A[^\n]*\.o, [^\n]*\n[^\n]*mixup[^\n]*\n[^\n]*Invalid operation\Z + +# Undefined reference for a R_CRIS_16_TPREL in a DSO (where it's +# invalid in the first place anyway, so we should see the same +# behavior as for that test, tls-err-24.d). diff --git a/binutils-2.24/ld/testsuite/ld-cris/tls-err-53.d b/binutils-2.24/ld/testsuite/ld-cris/tls-err-53.d new file mode 100644 index 0000000..1ae3d42 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/tls-err-53.d @@ -0,0 +1,7 @@ +#source: start1.s +#source: tls-ld-4.s +#as: --no-underscore --em=criself --pic +#ld: -m crislinux tmpdir/tls-dso-xz-1.so +#error: \A[^\n]*\.o,[^\n]*mixup[^\n]*\n[^\n]*Bad value\Z + +# R_CRIS_16_DTPREL in executable against symbol from DSO. diff --git a/binutils-2.24/ld/testsuite/ld-cris/tls-err-55.d b/binutils-2.24/ld/testsuite/ld-cris/tls-err-55.d new file mode 100644 index 0000000..08f77f3 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/tls-err-55.d @@ -0,0 +1,6 @@ +#source: tls-err-55.s +#as: --pic --no-underscore --em=criself -I$srcdir/$subdir +#ld: --shared -m crislinux +#error: \A[^\n]*\.o[^\n]*relocation R_CRIS_32_GOT_GD with non-zero addend 42 against symbol `tls128'[^\n]*\n[^\n]*Bad value\Z + +# Check that non-zero addend on a R_CRIS_32_GOT_GD is flagged as an error. diff --git a/binutils-2.24/ld/testsuite/ld-cris/tls-err-55.s b/binutils-2.24/ld/testsuite/ld-cris/tls-err-55.s new file mode 100644 index 0000000..aadae0d --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/tls-err-55.s @@ -0,0 +1,8 @@ + .text + .global tlsdsofn2 + .type tlsdsofn2,@function + .p2align 1 +tlsdsofn2: + move.d tls128+42:GDGOTREL,$r10 +.Lfe1: + .size tlsdsofn2,.Lfe1-tlsdsofn2 diff --git a/binutils-2.24/ld/testsuite/ld-cris/tls-err-56.d b/binutils-2.24/ld/testsuite/ld-cris/tls-err-56.d new file mode 100644 index 0000000..2d592a6 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/tls-err-56.d @@ -0,0 +1,7 @@ +#source: tls-err-56.s +#as: --pic --no-underscore --em=criself -I$srcdir/$subdir +#ld: --shared -m crislinux +#error: \A[^\n]*\.o[^\n]*relocation R_CRIS_32_GOT_GD with non-zero addend 42 against symbol `tls128'[^\n]*\n[^\n]*Bad value\Z + +# Check that non-zero addend on a R_CRIS_32_GOT_GD is flagged as an error. +# The difference to tls-err-55.d is that this one refers to a local symbol. diff --git a/binutils-2.24/ld/testsuite/ld-cris/tls-err-56.s b/binutils-2.24/ld/testsuite/ld-cris/tls-err-56.s new file mode 100644 index 0000000..b8a0443 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/tls-err-56.s @@ -0,0 +1,9 @@ + .include "tls128.s" + .text + .global tlsdsofn2 + .type tlsdsofn2,@function + .p2align 1 +tlsdsofn2: + move.d tls128+42:GDGOTREL,$r10 +.Lfe1: + .size tlsdsofn2,.Lfe1-tlsdsofn2 diff --git a/binutils-2.24/ld/testsuite/ld-cris/tls-err-62.d b/binutils-2.24/ld/testsuite/ld-cris/tls-err-62.d new file mode 100644 index 0000000..4434120 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/tls-err-62.d @@ -0,0 +1,7 @@ +#source: tls-err-62.s +#as: --pic --no-underscore --em=criself -I$srcdir/$subdir +#ld: --shared -m crislinux +#error: \A[^\n]*\.o[^\n]*relocation R_CRIS_32_GOT_TPREL with non-zero addend 42 against symbol `tls128'[^\n]*\n[^\n]*Bad value\Z + +# Check that non-zero addend on a R_CRIS_32_GOT_TPREL is flagged as an +# error, local symbol. diff --git a/binutils-2.24/ld/testsuite/ld-cris/tls-err-62.s b/binutils-2.24/ld/testsuite/ld-cris/tls-err-62.s new file mode 100644 index 0000000..b378dc5 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/tls-err-62.s @@ -0,0 +1,9 @@ + .include "tls128.s" + .text + .global tlsdsofn2 + .type tlsdsofn2,@function + .p2align 1 +tlsdsofn2: + move.d tls128+42:TPOFFGOT,$r10 +.Lfe1: + .size tlsdsofn2,.Lfe1-tlsdsofn2 diff --git a/binutils-2.24/ld/testsuite/ld-cris/tls-err-65.d b/binutils-2.24/ld/testsuite/ld-cris/tls-err-65.d new file mode 100644 index 0000000..23c880f --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/tls-err-65.d @@ -0,0 +1,7 @@ +#source: start1.s +#source: tls-le-12s.s +#as: --no-underscore --em=criself +#ld: -m crislinux tmpdir/tls-dso-xz-1.so +#error: \A[^\n]*\.o,[^\n]*mixup[^\n]*\n[^\n]*Bad value\Z + +# R_CRIS_16_TPREL in executable against symbol from DSO. diff --git a/binutils-2.24/ld/testsuite/ld-cris/tls-err-67.d b/binutils-2.24/ld/testsuite/ld-cris/tls-err-67.d new file mode 100644 index 0000000..0a0020b --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/tls-err-67.d @@ -0,0 +1,9 @@ +#source: init.s +#source: tls-gdgotrelm.s --defsym r=8203 +#as: --no-underscore --em=criself --pic +#ld: --shared -m crislinux +#error: \A[^\n]*\.o: In[^\n]*\n[^\n]*truncated[^\n]*\n[^\n]*too many[^\n]*\n[^\n]*\.o: In[^\n]*\n[^\n]*truncated[^\n]*\n[^\n]*too many[^\n]*\n[^\n]*\.o: In[^\n]*\n[^\n]*truncated[^\n]*\n[^\n]*too many[^\n]*\n[^\n]*\.o: In[^\n]*\n[^\n]*truncated[^\n]*\n[^\n]*too many[^\n]*\n[^\n]*\.o: In[^\n]*\n[^\n]*truncated[^\n]*\n[^\n]*too many[^\n]*\n[^\n]*\.o: In[^\n]*\n[^\n]*truncated[^\n]*\n[^\n]*too many[^\n]*\n[^\n]*\.o: In[^\n]*\n[^\n]*truncated[^\n]*\n[^\n]*too many[^\n]*\n[^\n]*\.o: In[^\n]*\n[^\n]*truncated[^\n]*\n[^\n]*too many[^\n]*\n[^\n]*\.o: In[^\n]*\n[^\n]*truncated[^\n]*\n[^\n]*too many[^\n]*\n[^\n]*\.o: In[^\n]*\n[^\n]*truncated[^\n]*\n[^\n]*too many[^\n]*\n[^\n]*\.o: In[^\n]*\n[^\n]*omitted[^\n]*\Z + +# Check that the error messages get the right number of appended +# explanations with default values when bailing out and omitting +# further error messages for overflows. diff --git a/binutils-2.24/ld/testsuite/ld-cris/tls-err-77.d b/binutils-2.24/ld/testsuite/ld-cris/tls-err-77.d new file mode 100644 index 0000000..9c714bf --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/tls-err-77.d @@ -0,0 +1,7 @@ +#source: tls-ie-8e.s +#source: tls-x.s +#as: --no-underscore --em=criself +#ld: --shared -m crislinux +#error: \A[^\n]*\.o, [^\n]*\n[^\n]*mixup[^\n]*\n[^\n]*Invalid operation\Z + +# Check that a R_CRIS_32_IE in input to a DSO is flagged as an error. diff --git a/binutils-2.24/ld/testsuite/ld-cris/tls-gc-68.d b/binutils-2.24/ld/testsuite/ld-cris/tls-gc-68.d new file mode 100644 index 0000000..6d3121b --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/tls-gc-68.d @@ -0,0 +1,33 @@ +#source: start1.s +#source: tls-x.s +#source: tls-local-58.s +#as: --pic --no-underscore --em=criself -I$srcdir/$subdir +#ld: -m crislinux --gc-sections +#objdump: -s -t -r -p + +# An executable with a R_CRIS_32_GOT_GD and a R_CRIS_16_GOT_GD against +# the same local symbol, gc:ed. Check that we have nothing left but +# the start symbol and its code. Can't get rid of the GOT just yet. + +.*: file format elf32-cris + +Program Header: + LOAD off 0x0+ vaddr 0x0+80000 paddr 0x0+80000 align 2\*\*13 + filesz 0x0+78 memsz 0x0+78 flags r-x + LOAD off 0x0+78 vaddr 0x0+82078 paddr 0x0+82078 align 2\*\*13 + filesz 0x0+c memsz 0x0+c flags rw- +private flags = 0: + +SYMBOL TABLE: +0+80074 l d \.text 0+ \.text +0+82078 l d \.got 0+ \.got +0+82084 l \.got 0+ __bss_start +0+82084 l \.got 0+ _edata +0+82078 l O \.got 0+ _GLOBAL_OFFSET_TABLE_ +0+820a0 l \.got 0+ _end +0+80074 g \.text 0+ _start + +Contents of section \.text: + 80074 41b20+ .* +Contents of section \.got: + 82078 0+ 0+ 0+ .* diff --git a/binutils-2.24/ld/testsuite/ld-cris/tls-gc-69.d b/binutils-2.24/ld/testsuite/ld-cris/tls-gc-69.d new file mode 100644 index 0000000..482088c --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/tls-gc-69.d @@ -0,0 +1,34 @@ +#source: start1.s +#source: tls-x.s +#source: tls-local-59.s +#as: --pic --no-underscore --em=criself -I$srcdir/$subdir +#ld: -m crislinux --gc-sections +#objdump: -s -t -r -p + +# An executable with a R_CRIS_32_GOT_GD, a R_CRIS_16_GOT_GD, a +# R_CRIS_32_GOT_TPREL and a R_CRIS_16_GOT_TPREL against the same local +# symbol, gc:ed. Check that we have nothing left but the start symbol +# and its code. Can't get rid of the GOT just yet. + +.*: file format elf32-cris + +Program Header: + LOAD off 0x0+ vaddr 0x0+80000 paddr 0x0+80000 align 2\*\*13 + filesz 0x0+78 memsz 0x0+78 flags r-x + LOAD off 0x0+78 vaddr 0x0+82078 paddr 0x0+82078 align 2\*\*13 + filesz 0x0+c memsz 0x0+c flags rw- +private flags = 0: + +SYMBOL TABLE: +0+80074 l d \.text 0+ \.text +0+82078 l d \.got 0+ \.got +0+82084 l \.got 0+ __bss_start +0+82084 l \.got 0+ _edata +0+82078 l O \.got 0+ _GLOBAL_OFFSET_TABLE_ +0+820a0 l \.got 0+ _end +0+80074 g \.text 0+ _start + +Contents of section .text: + 80074 41b20+ .* +Contents of section .got: + 82078 0+ 0+ 0+ .* diff --git a/binutils-2.24/ld/testsuite/ld-cris/tls-gc-70.d b/binutils-2.24/ld/testsuite/ld-cris/tls-gc-70.d new file mode 100644 index 0000000..83b4c0b --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/tls-gc-70.d @@ -0,0 +1,34 @@ +#source: start1.s +#source: tls128.s +#source: tls-gd-3.s +#source: tls-x.s +#as: --no-underscore --em=criself +#ld: -m crislinux --gc-sections +#objdump: -s -t -r -p + +# An executable with a single R_CRIS_32_GD, with gc. Check that we +# have nothing left but the start symbol and its code. Can't get rid +# of the GOT just yet. + +.*: file format elf32-cris + +Program Header: + LOAD off 0x0+ vaddr 0x0+80000 paddr 0x0+80000 align 2\*\*13 + filesz 0x0+78 memsz 0x0+78 flags r-x + LOAD off 0x0+78 vaddr 0x0+82078 paddr 0x0+82078 align 2\*\*13 + filesz 0x0+c memsz 0x0+c flags rw- +private flags = 0: + +SYMBOL TABLE: +0+80074 l d \.text 0+ \.text +0+82078 l d \.got 0+ \.got +0+82084 l \.got 0+ __bss_start +0+82084 l \.got 0+ _edata +0+82078 l O \.got 0+ _GLOBAL_OFFSET_TABLE_ +0+820a0 l \.got 0+ _end +0+80074 g \.text 0+ _start + +Contents of section \.text: + 80074 41b20+ .* +Contents of section \.got: + 82078 0+ 0+ 0+ .* diff --git a/binutils-2.24/ld/testsuite/ld-cris/tls-gc-71.d b/binutils-2.24/ld/testsuite/ld-cris/tls-gc-71.d new file mode 100644 index 0000000..b580fd3 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/tls-gc-71.d @@ -0,0 +1,32 @@ +#source: tls-gc-71.s +#source: init.s +#source: tls128g.s +#source: tls-hx.s +#as: --pic --no-underscore --em=criself -I$srcdir/$subdir +#ld: --shared -m crislinux --gc-sections +#objdump: -s -t -R -p -T + +# DSO with a single R_CRIS_16_DTPREL against a hidden symbol, gc:ed. +# Check that we still have the other, global, TLS variable. + +.*: file format elf32-cris +#... + TLS off .* + filesz 0x0+80 memsz 0x0+80 flags r-- +#... +DYNAMIC SYMBOL TABLE: +0+18e l d \.text 0+ \.text +0+2194 l d \.tdata 0+ \.tdata +0+2280 l D \.got 0+ __bss_start +0+2280 l D \.got 0+ _edata +0+2280 l D \.got 0+ _end +0+18e g DF \.text 0+2 _init +0+ g D .tdata 0+80 tls128 + +DYNAMIC RELOCATION RECORDS \(none\) +#... +Contents of section \.text: + 018e 0f050000 .* +#... +Contents of section \.got: + 2274 14220000 00000000 00000000 .* diff --git a/binutils-2.24/ld/testsuite/ld-cris/tls-gc-71.s b/binutils-2.24/ld/testsuite/ld-cris/tls-gc-71.s new file mode 100644 index 0000000..a4d6798 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/tls-gc-71.s @@ -0,0 +1,2 @@ + .hidden tlsdsofn + .include "tls-ld-4.s" diff --git a/binutils-2.24/ld/testsuite/ld-cris/tls-gc-75.d b/binutils-2.24/ld/testsuite/ld-cris/tls-gc-75.d new file mode 100644 index 0000000..472f889 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/tls-gc-75.d @@ -0,0 +1,36 @@ +#source: start1.s +#source: tls-x.s +#source: tls-gd-2.s +#source: tls-ie-10.s +#source: tls-gd-1.s +#source: tls-ie-8.s +#as: --pic --no-underscore --em=criself -I$srcdir/$subdir +#ld: -m crislinux --gc-sections +#objdump: -s -t -r -p + +# An executable with a R_CRIS_32_GOT_GD, a R_CRIS_16_GOT_GD, a +# R_CRIS_32_GOT_TPREL and a R_CRIS_16_GOT_TPREL against the same +# symbol, gc:ed. Check that we have proper NPTL/TLS markings and GOT. + +.*: file format elf32-cris + +Program Header: + LOAD off 0x0+ vaddr 0x0+80000 paddr 0x0+80000 align 2\*\*13 + filesz 0x0+78 memsz 0x0+78 flags r-x + LOAD off 0x0+78 vaddr 0x0+82078 paddr 0x0+82078 align 2\*\*13 + filesz 0x0+c memsz 0x0+c flags rw- +private flags = 0: + +SYMBOL TABLE: +0+80074 l d \.text 0+ \.text +0+82078 l d \.got 0+ \.got +0+82084 l \.got 0+ __bss_start +0+82084 l \.got 0+ _edata +0+82078 l O \.got 0+ _GLOBAL_OFFSET_TABLE_ +0+820a0 l \.got 0+ _end +0+80074 g \.text 0+ _start + +Contents of section \.text: + 80074 41b20+ .* +Contents of section \.got: + 82078 0+ 0+ 0+ .* diff --git a/binutils-2.24/ld/testsuite/ld-cris/tls-gc-76.d b/binutils-2.24/ld/testsuite/ld-cris/tls-gc-76.d new file mode 100644 index 0000000..97edbef --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/tls-gc-76.d @@ -0,0 +1,40 @@ +#as: --pic --no-underscore --em=criself -I$srcdir/$subdir +#ld: -m crislinux --gc-sections -u gc76fn +#source: start1.s +#source: tls-gc-76.s +#source: tls-hx.s +#objdump: -s -t -r -p + +# Executable with a single R_CRIS_32_DTPREL, gc:ed away. +# A GOT reference through a local symbol to a variable survives gc. + + +.*: file format elf32-cris + +Program Header: + LOAD off 0x0+ vaddr 0x0+80000 paddr 0x0+80000 align 2\*\*13 + filesz 0x0+80 memsz 0x0+80 flags r-x + LOAD off 0x0+80 vaddr 0x0+82080 paddr 0x0+82080 align 2\*\*13 + filesz 0x0+14 memsz 0x0+14 flags rw- +private flags = 0: + +SYMBOL TABLE: +0+80074 l d \.text 0+ \.text +0+82080 l d \.got 0+ \.got +0+82090 l d \.data 0+ \.data +0+ l df \*ABS\* 0+ .* +0+82090 l O \.data 0+4 gc76var +0+ l df \*ABS\* 0+ .* +0+82094 l \.data 0+ __bss_start +0+82094 l \.data 0+ _edata +0+82080 l O \.got 0+ _GLOBAL_OFFSET_TABLE_ +0+820a0 l \.data 0+ _end +0+80074 g \.text 0+ _start +0+80078 g F \.text 0+6 gc76fn + +Contents of section \.text: + 80074 41b20+ 6fae0c00 0+ .* +Contents of section \.got: + 82080 0+ 0+ 0+ 90200800 .* +Contents of section \.data: + 82090 0+ .* diff --git a/binutils-2.24/ld/testsuite/ld-cris/tls-gc-76.s b/binutils-2.24/ld/testsuite/ld-cris/tls-gc-76.s new file mode 100644 index 0000000..980defd --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/tls-gc-76.s @@ -0,0 +1,23 @@ + .text + .global gc76fn + .type gc76fn,@function +gc76fn: + move.d gc76var:GOT,$r10 +.Lfe: + .size gc76fn,.Lfe-gc76fn + + .data + .type gc76var,@object + .size gc76var,4 +gc76var: + .dword 0 + + .section .text.2,"ax" + .global tlsdsofn + .type tlsdsofn,@function + .p2align 1 +tlsdsofn: + move.d x:DTPREL,$r10 + move.d x:DTPREL,$r10 +.Lfe2: + .size tlsdsofn,.Lfe2-tlsdsofn diff --git a/binutils-2.24/ld/testsuite/ld-cris/tls-gc-79.d b/binutils-2.24/ld/testsuite/ld-cris/tls-gc-79.d new file mode 100644 index 0000000..424bfb0 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/tls-gc-79.d @@ -0,0 +1,34 @@ +#source: start1.s +#source: tls128.s +#source: tls-ie-8e.s +#source: tls-x.s +#as: --no-underscore --em=criself +#ld: -m crislinux --gc-sections +#objdump: -s -t -r -p + +# An executable with a single R_CRIS_32_IE, with gc. Check that we +# have nothing left but the start symbol and its code. Can't get rid +# of the GOT just yet. + +.*: file format elf32-cris + +Program Header: + LOAD off 0x0+ vaddr 0x0+80000 paddr 0x0+80000 align 2\*\*13 + filesz 0x0+78 memsz 0x0+78 flags r-x + LOAD off 0x0+78 vaddr 0x0+82078 paddr 0x0+82078 align 2\*\*13 + filesz 0x0+c memsz 0x0+c flags rw- +private flags = 0: + +SYMBOL TABLE: +0+80074 l d \.text 0+ \.text +0+82078 l d \.got 0+ \.got +0+82084 l \.got 0+ __bss_start +0+82084 l \.got 0+ _edata +0+82078 l O \.got 0+ _GLOBAL_OFFSET_TABLE_ +0+820a0 l \.got 0+ _end +0+80074 g \.text 0+ _start + +Contents of section \.text: + 80074 41b20+ .* +Contents of section \.got: + 82078 0+ 0+ 0+ .* diff --git a/binutils-2.24/ld/testsuite/ld-cris/tls-gd-1.d b/binutils-2.24/ld/testsuite/ld-cris/tls-gd-1.d new file mode 100644 index 0000000..25de32d --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/tls-gd-1.d @@ -0,0 +1,54 @@ +#as: --pic --no-underscore --em=criself +#ld: --shared -m crislinux +#source: tls-gd-1.s +#source: tls128.s +#source: tls-x.s +#objdump: -s -t -R -p -T + +# DSO with a single R_CRIS_16_GOT_GD. Check that we have proper +# NPTL/TLS markings and GOT. + +.*: file format elf32-cris + +Program Header: + LOAD off 0x0+ vaddr 0x0+ paddr 0x0+ align 2\*\*13 + filesz 0x0+1a0 memsz 0x0+1a0 flags r-x + LOAD off 0x0+1a0 vaddr 0x0+21a0 paddr 0x0+21a0 align 2\*\*13 + filesz 0x0+108 memsz 0x0+108 flags rw- + DYNAMIC off 0x0+224 vaddr 0x0+2224 paddr 0x0+2224 align 2\*\*2 + filesz 0x0+70 memsz 0x0+70 flags rw- + TLS off 0x0+1a0 vaddr 0x0+21a0 paddr 0x0+21a0 align 2\*\*2 + filesz 0x0+84 memsz 0x0+84 flags r-- + +Dynamic Section: + HASH 0x0+b4 + STRTAB 0x0+168 + SYMTAB 0x0+e8 + STRSZ 0x0+25 + SYMENT 0x0+10 + RELA 0x0+190 + RELASZ 0x0+c + RELAENT 0x0+c +private flags = 0: + +SYMBOL TABLE: +#... +0+80 g \.tdata 0+4 x +#... +DYNAMIC SYMBOL TABLE: +#... +0+80 g D \.tdata 0+4 x +#... + +DYNAMIC RELOCATION RECORDS +OFFSET TYPE VALUE +0+22a0 R_CRIS_DTP x + +Contents of section \.hash: +#... +Contents of section \.text: + 019c 5fae0c00 .* +#... +Contents of section \.got: + 2294 24220+ 0+ 0+ 0+ .* + 22a4 0+ .* diff --git a/binutils-2.24/ld/testsuite/ld-cris/tls-gd-1.s b/binutils-2.24/ld/testsuite/ld-cris/tls-gd-1.s new file mode 100644 index 0000000..cd3f021 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/tls-gd-1.s @@ -0,0 +1,8 @@ + .text + .global tlsdsofn0 + .type tlsdsofn0,@function + .p2align 1 +tlsdsofn0: + move.w x:GDGOTREL16,$r10 +.Lfe: + .size tlsdsofn0,.Lfe-tlsdsofn0 diff --git a/binutils-2.24/ld/testsuite/ld-cris/tls-gd-1h.d b/binutils-2.24/ld/testsuite/ld-cris/tls-gd-1h.d new file mode 100644 index 0000000..2e024bd --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/tls-gd-1h.d @@ -0,0 +1,50 @@ +#as: --pic --no-underscore --em=criself +#ld: --shared -m crislinux +#source: tls-gd-1.s +#source: tls128g.s +#source: tls-hx.s +#objdump: -s -t -R -p + +# DSO with a single R_CRIS_16_GOT_GD against a hidden symbol. Check +# that we have proper NPTL/TLS markings and GOT. + +.*: file format elf32-cris + +Program Header: + LOAD off 0x0+ vaddr 0x0+ paddr 0x0+ align 2\*\*13 + filesz 0x0+1a4 memsz 0x0+1a4 flags r-x + LOAD off 0x0+1a4 vaddr 0x0+21a4 paddr 0x0+21a4 align 2\*\*13 + filesz 0x0+108 memsz 0x0+108 flags rw- + DYNAMIC off 0x0+228 vaddr 0x0+2228 paddr 0x0+2228 align 2\*\*2 + filesz 0x0+70 memsz 0x0+70 flags rw- + TLS off 0x0+1a4 vaddr 0x0+21a4 paddr 0x0+21a4 align 2\*\*2 + filesz 0x0+84 memsz 0x0+84 flags r-- + +Dynamic Section: + HASH 0x0+b4 + STRTAB 0x0+168 + SYMTAB 0x0+e8 + STRSZ 0x0+2a + SYMENT 0x0+10 + RELA 0x0+194 + RELASZ 0x0+c + RELAENT 0x0+c +private flags = 0: + +SYMBOL TABLE: +#... +0+80 l \.tdata 0+4 x +#... + +DYNAMIC RELOCATION RECORDS +OFFSET TYPE VALUE +0+22a4 R_CRIS_DTP \*ABS\*\+0x0+80 + +Contents of section \.hash: +#... +Contents of section \.text: + 01a0 5fae0c00 .* +#... +Contents of section \.got: + 2298 28220+ 0+ 0+ 0+ .* + 22a8 0+ .* diff --git a/binutils-2.24/ld/testsuite/ld-cris/tls-gd-2.d b/binutils-2.24/ld/testsuite/ld-cris/tls-gd-2.d new file mode 100644 index 0000000..2f2546e --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/tls-gd-2.d @@ -0,0 +1,54 @@ +#as: --pic --no-underscore --em=criself +#ld: --shared -m crislinux +#source: tls-gd-2.s +#source: tls128g.s +#source: tls-x.s +#objdump: -s -t -R -p -T + +# DSO with a single R_CRIS_32_GOT_GD. Check that we have proper +# NPTL/TLS markings and GOT. + +.*: file format elf32-cris + +Program Header: + LOAD off 0x0+ vaddr 0x0+ paddr 0x0+ align 2\*\*13 + filesz 0x0+1bc memsz 0x0+1bc flags r-x + LOAD off 0x0+1bc vaddr 0x0+21bc paddr 0x0+21bc align 2\*\*13 + filesz 0x0+108 memsz 0x0+108 flags rw- + DYNAMIC off 0x0+240 vaddr 0x0+2240 paddr 0x0+2240 align 2\*\*2 + filesz 0x0+70 memsz 0x0+70 flags rw- + TLS off 0x0+1bc vaddr 0x0+21bc paddr 0x0+21bc align 2\*\*2 + filesz 0x0+84 memsz 0x0+84 flags r-- + +Dynamic Section: + HASH 0x0+b4 + STRTAB 0x0+17c + SYMTAB 0x0+ec + STRSZ 0x0+2c + SYMENT 0x0+10 + RELA 0x0+1a8 + RELASZ 0x0+c + RELAENT 0x0+c +private flags = 0: + +SYMBOL TABLE: +#... +0+80 g \.tdata 0+4 x +#... +DYNAMIC SYMBOL TABLE: +#... +0+80 g D \.tdata 0+4 x +#... + +DYNAMIC RELOCATION RECORDS +OFFSET TYPE VALUE +0+22bc R_CRIS_DTP x + +Contents of section \.hash: +#... +Contents of section \.text: + 01b4 6fae0c00 00000000 .* +#... +Contents of section \.got: + 22b0 40220+ 0+ 0+ 0+ .* + 22c0 0+ .* diff --git a/binutils-2.24/ld/testsuite/ld-cris/tls-gd-2.s b/binutils-2.24/ld/testsuite/ld-cris/tls-gd-2.s new file mode 100644 index 0000000..07e8cf5 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/tls-gd-2.s @@ -0,0 +1,9 @@ + .text + .global tlsdsofn2 + .type tlsdsofn2,@function + .p2align 1 +tlsdsofn2: + move.d x:GDGOTREL,$r10 +.Lfe2: + .size tlsdsofn2,.Lfe2-tlsdsofn2 + diff --git a/binutils-2.24/ld/testsuite/ld-cris/tls-gd-2h.d b/binutils-2.24/ld/testsuite/ld-cris/tls-gd-2h.d new file mode 100644 index 0000000..f63be5c --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/tls-gd-2h.d @@ -0,0 +1,50 @@ +#as: --pic --no-underscore --em=criself +#ld: --shared -m crislinux +#source: tls-gd-2.s +#source: tls128g.s +#source: tls-hx.s +#objdump: -s -t -R -p + +# DSO with a single R_CRIS_32_GOT_GD against a hidden symbol. Check +# that we have proper NPTL/TLS markings and GOT. + +.*: file format elf32-cris + +Program Header: + LOAD off 0x0+ vaddr 0x0+ paddr 0x0+ align 2\*\*13 + filesz 0x0+1a8 memsz 0x0+1a8 flags r-x + LOAD off 0x0+1a8 vaddr 0x0+21a8 paddr 0x0+21a8 align 2\*\*13 + filesz 0x0+108 memsz 0x0+108 flags rw- + DYNAMIC off 0x0+22c vaddr 0x0+222c paddr 0x0+222c align 2\*\*2 + filesz 0x0+70 memsz 0x0+70 flags rw- + TLS off 0x0+1a8 vaddr 0x0+21a8 paddr 0x0+21a8 align 2\*\*2 + filesz 0x0+84 memsz 0x0+84 flags r-- + +Dynamic Section: + HASH 0x0+b4 + STRTAB 0x0+168 + SYMTAB 0x0+e8 + STRSZ 0x0+2a + SYMENT 0x0+10 + RELA 0x0+194 + RELASZ 0x0+c + RELAENT 0x0+c +private flags = 0: + +SYMBOL TABLE: +#... +0+80 l \.tdata 0+4 x +#... + +DYNAMIC RELOCATION RECORDS +OFFSET TYPE VALUE +0+22a8 R_CRIS_DTP \*ABS\*\+0x0+80 + +Contents of section \.hash: +#... +Contents of section \.text: + 01a0 6fae0c00 00000000 .* +#... +Contents of section \.got: + 229c 2c220+ 0+ 0+ 0+ .* + 22ac 0+ .* diff --git a/binutils-2.24/ld/testsuite/ld-cris/tls-gd-3.d b/binutils-2.24/ld/testsuite/ld-cris/tls-gd-3.d new file mode 100644 index 0000000..b2de851 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/tls-gd-3.d @@ -0,0 +1,39 @@ +#source: start1.s +#source: tls128.s +#source: tls-gd-3.s +#source: tls-x.s +#as: --no-underscore --em=criself +#ld: -m crislinux +#objdump: -d -s -t -r -p + +# Check that we have proper NPTL/TLS markings and GOT for an +# executable with a single R_CRIS_32_GD. + +.*: file format elf32-cris + +Program Header: +#... + TLS off 0x0+a0 vaddr 0x0+820a0 paddr 0x0+820a0 align 2\*\*2 + filesz 0x0+84 memsz 0x0+84 flags r-- +private flags = 0: +#... +SYMBOL TABLE: +#... +0+80 g \.tdata 0+4 x +#... +Contents of section \.text: +#... +Contents of section \.tdata: +#... +Contents of section \.got: + 82124 00000000 00000000 00000000 01000000 .* + 82134 80000000 .* + +Disassembly of section \.text: + +00080094 <_start>: + 80094: 41b2 moveq 1,\$r11 +#... +00080098 <tlsfn>: + 80098: 6fae 3021 0800 move\.d [^>]+>,\$r10 +#... diff --git a/binutils-2.24/ld/testsuite/ld-cris/tls-gd-3.s b/binutils-2.24/ld/testsuite/ld-cris/tls-gd-3.s new file mode 100644 index 0000000..c427a45 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/tls-gd-3.s @@ -0,0 +1,8 @@ + .text + .global tlsfn + .type tlsfn,@function + .p2align 1 +tlsfn: + move.d x:GD,$r10 +.Lfe1: + .size tlsfn,.Lfe1-tlsfn diff --git a/binutils-2.24/ld/testsuite/ld-cris/tls-gd-3h.d b/binutils-2.24/ld/testsuite/ld-cris/tls-gd-3h.d new file mode 100644 index 0000000..78f109d --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/tls-gd-3h.d @@ -0,0 +1,39 @@ +#source: start1.s +#source: tls128.s +#source: tls-gd-3.s +#source: tls-hx.s +#as: --no-underscore --em=criself +#ld: -m crislinux +#objdump: -d -s -t -r -p + +# Check that we have proper NPTL/TLS markings and GOT for an +# executable with a single R_CRIS_32_GD against a hidden symbol. + +.*: file format elf32-cris + +Program Header: +#... + TLS off 0x0+a0 vaddr 0x0+820a0 paddr 0x0+820a0 align 2\*\*2 + filesz 0x0+84 memsz 0x0+84 flags r-- +private flags = 0: +#... +SYMBOL TABLE: +#... +0+80 g \.tdata 0+4 \.hidden x +#... +Contents of section \.text: +#... +Contents of section \.tdata: +#... +Contents of section \.got: + 82124 00000000 00000000 00000000 01000000 .* + 82134 80000000 .* + +Disassembly of section \.text: + +00080094 <_start>: + 80094: 41b2 moveq 1,\$r11 +#... +00080098 <tlsfn>: + 80098: 6fae 3021 0800 move\.d [^>]+>,\$r10 +#... diff --git a/binutils-2.24/ld/testsuite/ld-cris/tls-gdgotrelm.s b/binutils-2.24/ld/testsuite/ld-cris/tls-gdgotrelm.s new file mode 100644 index 0000000..50310ea --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/tls-gdgotrelm.s @@ -0,0 +1,28 @@ + .text + + .ifndef r + .set r,1 + .endif + + .macro doit + .global tlsdsofngdgotrelm\@ + .type tlsdsofngdgotrelm\@,@function + .p2align 1 +tlsdsofngdgotrelm\@: + move.w x\@:GDGOTREL16,$r10 +.Lfe\@: + .size tlsdsofngdgotrelm\@,.Lfe\@-tlsdsofngdgotrelm\@ + + .globl x\@ + .section .tdata,"awT",@progbits + .p2align 0 + .type x\@, @object + .size x\@, 1 +x\@: + .byte 40 + .previous + .endm + + .rept r + doit + .endr diff --git a/binutils-2.24/ld/testsuite/ld-cris/tls-global-74.d b/binutils-2.24/ld/testsuite/ld-cris/tls-global-74.d new file mode 100644 index 0000000..b70c6a9 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/tls-global-74.d @@ -0,0 +1,28 @@ +#source: start1.s +#source: tls-x.s +#source: tls-gd-2.s +#source: tls-ie-10.s +#source: tls-gd-1.s +#source: tls-ie-8.s +#as: --pic --no-underscore --em=criself -I$srcdir/$subdir +#ld: -m crislinux +#objdump: -s -t -r -p + +# An executable with a R_CRIS_32_GOT_GD, a R_CRIS_16_GOT_GD, a +# R_CRIS_32_GOT_TPREL and a R_CRIS_16_GOT_TPREL against the same +# symbol. Check that we have proper NPTL/TLS markings and GOT. + +.*: file format elf32-cris + +Program Header: +#... + TLS off .* + filesz 0x0+4 memsz 0x0+4 flags r-- +#... +Contents of section .text: + 80094 41b20000 6fae1000 0+ 6fae0c0+ .* + 800a4 0+ 5fae1000 5fae0c00 .* +#... +Contents of section \.got: + 820b4 0+ 0+ 0+ fcffffff .* + 820c4 010+ 0+ .* diff --git a/binutils-2.24/ld/testsuite/ld-cris/tls-gottprelm.s b/binutils-2.24/ld/testsuite/ld-cris/tls-gottprelm.s new file mode 100644 index 0000000..2853b31 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/tls-gottprelm.s @@ -0,0 +1,28 @@ + .text + + .ifndef r + .set r,1 + .endif + + .macro doit + .global tlsdsofngottprelm\@ + .type tlsdsofngottprelm\@,@function + .p2align 1 +tlsdsofngottprelm\@: + move.w x\@:TPOFFGOT16,$r10 +.Lfe\@: + .size tlsdsofngottprelm\@,.Lfe\@-tlsdsofngottprelm\@ + + .globl x\@ + .section .tdata,"awT",@progbits + .p2align 0 + .type x\@, @object + .size x\@, 1 +x\@: + .byte 40 + .previous + .endm + + .rept r + doit + .endr diff --git a/binutils-2.24/ld/testsuite/ld-cris/tls-hx.s b/binutils-2.24/ld/testsuite/ld-cris/tls-hx.s new file mode 100644 index 0000000..8e83164 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/tls-hx.s @@ -0,0 +1,8 @@ + .hidden x + .globl x + .section .tdata,"awT",@progbits + .p2align 2 + .type x, @object + .size x, 4 +x: + .long 40 diff --git a/binutils-2.24/ld/testsuite/ld-cris/tls-hx1x2.s b/binutils-2.24/ld/testsuite/ld-cris/tls-hx1x2.s new file mode 100644 index 0000000..1964504 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/tls-hx1x2.s @@ -0,0 +1,15 @@ + .hidden x1 + .globl x1 + .section .tdata,"awT",@progbits + .p2align 2 + .type x1, @object + .size x1, 4 +x1: + .long 41 + .hidden x2 + .globl x2 + .p2align 2 + .type x2, @object + .size x2, 4 +x2: + .long 42 diff --git a/binutils-2.24/ld/testsuite/ld-cris/tls-ie-10.d b/binutils-2.24/ld/testsuite/ld-cris/tls-ie-10.d new file mode 100644 index 0000000..869173c --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/tls-ie-10.d @@ -0,0 +1,54 @@ +#as: --pic --no-underscore --em=criself +#ld: --shared -m crislinux +#source: tls-ie-10.s +#source: tls128g.s +#source: tls-x.s +#objdump: -s -t -R -p -T + +# DSO with a single R_CRIS_32_GOT_TPREL. Check that we have proper +# NPTL/TLS markings and GOT. + +.*: file format elf32-cris + +Program Header: + LOAD off 0x0+ vaddr 0x0+ paddr 0x0+ align 2\*\*13 + filesz 0x0+1c0 memsz 0x0+1c0 flags r-x + LOAD off 0x0+1c0 vaddr 0x0+21c0 paddr 0x0+21c0 align 2\*\*13 + filesz 0x0+10c memsz 0x0+10c flags rw- + DYNAMIC off 0x0+244 vaddr 0x0+2244 paddr 0x0+2244 align 2\*\*2 + filesz 0x0+78 memsz 0x0+78 flags rw- + TLS off 0x0+1c0 vaddr 0x0+21c0 paddr 0x0+21c0 align 2\*\*2 + filesz 0x0+84 memsz 0x0+84 flags r-- + +Dynamic Section: + HASH 0x0+b4 + STRTAB 0x0+17c + SYMTAB 0x0+ec + STRSZ 0x0+2d + SYMENT 0x0+10 + RELA 0x0+1ac + RELASZ 0x0+c + RELAENT 0x0+c + FLAGS 0x0+10 +private flags = 0: + +SYMBOL TABLE: +#... +0+80 g \.tdata 0+4 x +#... +DYNAMIC SYMBOL TABLE: +#... +0+80 g D \.tdata 0+4 x +#... + +DYNAMIC RELOCATION RECORDS +OFFSET TYPE VALUE +0+22c8 R_CRIS_32_TPREL x + +Contents of section \.hash: +#... +Contents of section \.text: + 01b8 6fae0c00 00000000 .* +#... +Contents of section \.got: + 22bc 44220+ 0+ 0+ 0+ .* diff --git a/binutils-2.24/ld/testsuite/ld-cris/tls-ie-10.s b/binutils-2.24/ld/testsuite/ld-cris/tls-ie-10.s new file mode 100644 index 0000000..a8667cd --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/tls-ie-10.s @@ -0,0 +1,8 @@ + .text + .global tlsdsofn10 + .type tlsdsofn10,@function + .p2align 1 +tlsdsofn10: + move.d x:TPOFFGOT,$r10 +.Lfe10: + .size tlsdsofn10,.Lfe10-tlsdsofn10 diff --git a/binutils-2.24/ld/testsuite/ld-cris/tls-ie-11.d b/binutils-2.24/ld/testsuite/ld-cris/tls-ie-11.d new file mode 100644 index 0000000..d326fbe --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/tls-ie-11.d @@ -0,0 +1,60 @@ +#as: --pic --no-underscore --em=criself +#ld: --shared -m crislinux +#source: tls-ie-11.s +#source: tls128g.s +#source: tls-x1x2.s +#objdump: -s -t -R -p -T + +# DSO with two R_CRIS_32_GOT_TPREL against different symbols. Check +# that we have proper NPTL/TLS markings and GOT. + +.*: file format elf32-cris + +Program Header: + LOAD off 0x0+ vaddr 0x0+ paddr 0x0+ align 2\*\*13 + filesz 0x0+1e4 memsz 0x0+1e4 flags r-x + LOAD off 0x0+1e4 vaddr 0x0+21e4 paddr 0x0+21e4 align 2\*\*13 + filesz 0x0+114 memsz 0x0+114 flags rw- + DYNAMIC off 0x0+26c vaddr 0x0+226c paddr 0x0+226c align 2\*\*2 + filesz 0x0+78 memsz 0x0+78 flags rw- + TLS off 0x0+1e4 vaddr 0x0+21e4 paddr 0x0+21e4 align 2\*\*2 + filesz 0x0+88 memsz 0x0+88 flags r-- + +Dynamic Section: + HASH 0x0+b4 + STRTAB 0x0+190 + SYMTAB 0x0+f0 + STRSZ 0x0+2f + SYMENT 0x0+10 + RELA 0x0+1c0 + RELASZ 0x0+18 + RELAENT 0x0+c + FLAGS 0x0+10 +private flags = 0: + +SYMBOL TABLE: +#... +0+84 g \.tdata 0+4 x2 +#... +0+80 g \.tdata 0+4 x1 +#... +DYNAMIC SYMBOL TABLE: +#... +0+84 g D \.tdata 0+4 x2 +#... +0+80 g D \.tdata 0+4 x1 +#... + +DYNAMIC RELOCATION RECORDS +OFFSET TYPE VALUE +0+22f0 R_CRIS_32_TPREL x2 +0+22f4 R_CRIS_32_TPREL x1 + +Contents of section \.hash: +#... +Contents of section \.text: + 01d8 6fae1000 00006fbe 0c000000 .* +#... +Contents of section \.got: + 22e4 6c220+ 0+ 0+ 0+ .* + 22f4 00000000 .* diff --git a/binutils-2.24/ld/testsuite/ld-cris/tls-ie-11.s b/binutils-2.24/ld/testsuite/ld-cris/tls-ie-11.s new file mode 100644 index 0000000..236bdbb --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/tls-ie-11.s @@ -0,0 +1,9 @@ + .text + .global tlsdsofn + .type tlsdsofn,@function + .p2align 1 +tlsdsofn: + move.d x1:TPOFFGOT,$r10 + move.d x2:TPOFFGOT,$r11 +.Lfe11: + .size tlsdsofn,.Lfe11-tlsdsofn diff --git a/binutils-2.24/ld/testsuite/ld-cris/tls-ie-78.d b/binutils-2.24/ld/testsuite/ld-cris/tls-ie-78.d new file mode 100644 index 0000000..3994df8 --- /dev/null +++ b/binutils-2.24/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 .* diff --git a/binutils-2.24/ld/testsuite/ld-cris/tls-ie-8.d b/binutils-2.24/ld/testsuite/ld-cris/tls-ie-8.d new file mode 100644 index 0000000..3c7769b --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/tls-ie-8.d @@ -0,0 +1,54 @@ +#as: --pic --no-underscore --em=criself +#ld: --shared -m crislinux +#source: tls-ie-8.s +#source: tls128g.s +#source: tls-x.s +#objdump: -s -t -R -p -T + +# DSO with a single R_CRIS_16_GOT_TPREL. Check that we have proper +# NPTL/TLS markings and GOT. + +.*: file format elf32-cris + +Program Header: + LOAD off 0x0+ vaddr 0x0+ paddr 0x0+ align 2\*\*13 + filesz 0x0+1b8 memsz 0x0+1b8 flags r-x + LOAD off 0x0+1b8 vaddr 0x0+21b8 paddr 0x0+21b8 align 2\*\*13 + filesz 0x0+10c memsz 0x0+10c flags rw- + DYNAMIC off 0x0+23c vaddr 0x0+223c paddr 0x0+223c align 2\*\*2 + filesz 0x0+78 memsz 0x0+78 flags rw- + TLS off 0x0+1b8 vaddr 0x0+21b8 paddr 0x0+21b8 align 2\*\*2 + filesz 0x0+84 memsz 0x0+84 flags r-- + +Dynamic Section: + HASH 0x0+b4 + STRTAB 0x0+17c + SYMTAB 0x0+ec + STRSZ 0x0+2b + SYMENT 0x0+10 + RELA 0x0+1a8 + RELASZ 0x0+c + RELAENT 0x0+c + FLAGS 0x0+10 +private flags = 0: + +SYMBOL TABLE: +#... +0+80 g \.tdata 0+4 x +#... +DYNAMIC SYMBOL TABLE: +#... +0+80 g D \.tdata 0+4 x +#... + +DYNAMIC RELOCATION RECORDS +OFFSET TYPE VALUE +0+22c0 R_CRIS_32_TPREL x + +Contents of section \.hash: +#... +Contents of section \.text: + 01b4 5fae0c00 .* +#... +Contents of section \.got: + 22b4 3c220+ 0+ 0+ 0+ .* diff --git a/binutils-2.24/ld/testsuite/ld-cris/tls-ie-8.s b/binutils-2.24/ld/testsuite/ld-cris/tls-ie-8.s new file mode 100644 index 0000000..ed95939 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/tls-ie-8.s @@ -0,0 +1,8 @@ + .text + .global tlsdsofn + .type tlsdsofn,@function + .p2align 1 +tlsdsofn: + move.w x:TPOFFGOT16,$r10 +.Lfe8: + .size tlsdsofn,.Lfe8-tlsdsofn diff --git a/binutils-2.24/ld/testsuite/ld-cris/tls-ie-8e.s b/binutils-2.24/ld/testsuite/ld-cris/tls-ie-8e.s new file mode 100644 index 0000000..fc6e121 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/tls-ie-8e.s @@ -0,0 +1,8 @@ + .text + .global tlsfn + .type tlsfn,@function + .p2align 1 +tlsfn: + move.d x:IE,$r10 +.Lfe8: + .size tlsfn,.Lfe8-tlsfn diff --git a/binutils-2.24/ld/testsuite/ld-cris/tls-ie-8e1.d b/binutils-2.24/ld/testsuite/ld-cris/tls-ie-8e1.d new file mode 100644 index 0000000..0093935 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/tls-ie-8e1.d @@ -0,0 +1,42 @@ +#as: --no-underscore --em=criself +#ld: -m crislinux +#source: start1.s +#source: tls-ie-8e.s +#source: tls128g.s +#source: tls-x.s +#objdump: -d -s -h -t -r -p + +# Executable with a single R_CRIS_32_IE, defined in the executable. +# Check that we have proper NPTL/TLS markings and a constant GOT. + +.*: file format elf32-cris + +Program Header: +#... + TLS off 0x0+a0 vaddr 0x0+820a0 paddr 0x0+820a0 align 2\*\*2 + filesz 0x0+84 memsz 0x0+84 flags r-- +private flags = 0: + +Sections: +#... + 2 .got[ ]+ 0+10 .* + CONTENTS, ALLOC, LOAD, DATA + +SYMBOL TABLE: +#... +0+80 g \.tdata 0+4 x +#... +Contents of section .text: + 80094 41b20000 6fae3021 08000000 .* +#... +Contents of section .got: + 82124 00000000 00000000 00000000 fcffffff .* + +Disassembly of section .text: + +00080094 <_start>: + 80094: 41b2 moveq 1,\$r11 +#... +00080098 <tlsfn>: + 80098: 6fae 3021 0800 move.d 82130 <_GLOBAL_OFFSET_TABLE_\+0xc>,\$r10 +#pass diff --git a/binutils-2.24/ld/testsuite/ld-cris/tls-ie-9.d b/binutils-2.24/ld/testsuite/ld-cris/tls-ie-9.d new file mode 100644 index 0000000..673ae4f --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/tls-ie-9.d @@ -0,0 +1,60 @@ +#as: --pic --no-underscore --em=criself +#ld: --shared -m crislinux +#source: tls-ie-9.s +#source: tls128g.s +#source: tls-x1x2.s +#objdump: -s -t -R -p -T + +# DSO with two R_CRIS_16_GOT_TPREL against different symbols. Check +# that we have proper NPTL/TLS markings and GOT. + +.*: file format elf32-cris + +Program Header: + LOAD off 0x0+ vaddr 0x0+ paddr 0x0+ align 2\*\*13 + filesz 0x0+1e0 memsz 0x0+1e0 flags r-x + LOAD off 0x0+1e0 vaddr 0x0+21e0 paddr 0x0+21e0 align 2\*\*13 + filesz 0x0+114 memsz 0x0+114 flags rw- + DYNAMIC off 0x0+268 vaddr 0x0+2268 paddr 0x0+2268 align 2\*\*2 + filesz 0x0+78 memsz 0x0+78 flags rw- + TLS off 0x0+1e0 vaddr 0x0+21e0 paddr 0x0+21e0 align 2\*\*2 + filesz 0x0+88 memsz 0x0+88 flags r-- + +Dynamic Section: + HASH 0x0+b4 + STRTAB 0x0+190 + SYMTAB 0x0+f0 + STRSZ 0x0+30 + SYMENT 0x0+10 + RELA 0x0+1c0 + RELASZ 0x0+18 + RELAENT 0x0+c + FLAGS 0x0+10 +private flags = 0: + +SYMBOL TABLE: +#... +0+84 g \.tdata 0+4 x2 +#... +0+80 g \.tdata 0+4 x1 +#... +DYNAMIC SYMBOL TABLE: +#... +0+84 g D \.tdata 0+4 x2 +#... +0+80 g D \.tdata 0+4 x1 +#... + +DYNAMIC RELOCATION RECORDS +OFFSET TYPE VALUE +0+22ec R_CRIS_32_TPREL x2 +0+22f0 R_CRIS_32_TPREL x1 + +Contents of section \.hash: +#... +Contents of section \.text: + 01d8 5fae1000 5fbe0c00 .* +#... +Contents of section \.got: + 22e0 68220+ 0+ 0+ 0+ .* + 22f0 00000000 .* diff --git a/binutils-2.24/ld/testsuite/ld-cris/tls-ie-9.s b/binutils-2.24/ld/testsuite/ld-cris/tls-ie-9.s new file mode 100644 index 0000000..69cecd7 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/tls-ie-9.s @@ -0,0 +1,9 @@ + .text + .global tlsdsofn9 + .type tlsdsofn9,@function + .p2align 1 +tlsdsofn9: + move.w x1:TPOFFGOT16,$r10 + move.w x2:TPOFFGOT16,$r11 +.Lfe9: + .size tlsdsofn9,.Lfe9-tlsdsofn9 diff --git a/binutils-2.24/ld/testsuite/ld-cris/tls-js1.d b/binutils-2.24/ld/testsuite/ld-cris/tls-js1.d new file mode 100644 index 0000000..0c1509f --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/tls-js1.d @@ -0,0 +1,32 @@ +#source: dsov32-1.s +#source: tls-ld-4.s +#source: dsov32-2.s +#source: expdyn1.s +#source: tls-hx.s +#source: dso-1.s +#as: --pic --no-underscore --em=criself --march=v32 +#ld: --shared -m crislinux +#readelf: -a + +# DSO with a R_CRIS_16_DTPREL and a R_CRIS_32_PLT_PCREL. The .got.plt +# byte index (a) and .rela.plt item index (b) are in sync as b=a/4-3 +# *except* when there's a R_CRIS_DTPMOD, because while the relocated +# contents goes in .got.plt, the relocation goes in .rela.got, not +# .rela.plt. And, it'd cover 8 bytes in .got.plt, not 4 bytes. +# Making sure .rela.plt has the right contents; no R_CRIS_NONE entries. + +#... + .* .got[ ]+PROGBITS[ ]+0+2348 0+348 0+20 04 WA 0 0 4 +#... +Relocation section '\.rela\.dyn' at offset 0x20c contains 2 entries: + Offset Info Type Sym\.Value Sym\. Name \+ Addend +00002354 0000001e R_CRIS_DTPMOD +0 +00002364 0000050a R_CRIS_GLOB_DAT 00002368 expobj \+ 0 + +Relocation section '\.rela\.plt' at offset 0x224 contains 2 entries: + Offset Info Type Sym\.Value Sym\. Name \+ Addend +0000235c 0000030b R_CRIS_JUMP_SLOT 00000296 dsofn4 \+ 0 +00002360 00000c0b R_CRIS_JUMP_SLOT 000002ae dsofn \+ 0 + +The decoding of unwind sections for machine type Axis Communications 32-bit embedded processor is not currently supported. +#pass diff --git a/binutils-2.24/ld/testsuite/ld-cris/tls-ld-4.d b/binutils-2.24/ld/testsuite/ld-cris/tls-ld-4.d new file mode 100644 index 0000000..2ac3d71 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/tls-ld-4.d @@ -0,0 +1,50 @@ +#as: --pic --no-underscore --em=criself +#ld: --shared -m crislinux +#source: tls-ld-4.s +#source: tls128g.s +#source: tls-hx.s +#objdump: -s -t -R -p + +# DSO with a single R_CRIS_16_DTPREL against a hidden symbol. Check +# that we have proper NPTL/TLS markings and GOT. + +.*: file format elf32-cris + +Program Header: + LOAD off 0x0+ vaddr 0x0+ paddr 0x0+ align 2\*\*13 + filesz 0x0+1a4 memsz 0x0+1a4 flags r-x + LOAD off 0x0+1a4 vaddr 0x0+21a4 paddr 0x0+21a4 align 2\*\*13 + filesz 0x0+108 memsz 0x0+108 flags rw- + DYNAMIC off 0x0+228 vaddr 0x0+2228 paddr 0x0+2228 align 2\*\*2 + filesz 0x0+70 memsz 0x0+70 flags rw- + TLS off 0x0+1a4 vaddr 0x0+21a4 paddr 0x0+21a4 align 2\*\*2 + filesz 0x0+84 memsz 0x0+84 flags r-- + +Dynamic Section: + HASH 0x0+b4 + STRTAB 0x0+168 + SYMTAB 0x0+e8 + STRSZ 0x0+29 + SYMENT 0x0+10 + RELA 0x0+194 + RELASZ 0x0+c + RELAENT 0x0+c +private flags = 0: + +SYMBOL TABLE: +#... +0+80 l \.tdata 0+4 x +#... + +DYNAMIC RELOCATION RECORDS +OFFSET TYPE VALUE +0+22a4 R_CRIS_DTPMOD \*ABS\* + +Contents of section \.hash: +#... +Contents of section \.text: + 01a0 5fae8000 .* +#... +Contents of section \.got: + 2298 28220+ 0+ 0+ 0+ .* + 22a8 0+ .* diff --git a/binutils-2.24/ld/testsuite/ld-cris/tls-ld-4.s b/binutils-2.24/ld/testsuite/ld-cris/tls-ld-4.s new file mode 100644 index 0000000..7990689 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/tls-ld-4.s @@ -0,0 +1,8 @@ + .text + .global tlsdsofn + .type tlsdsofn,@function + .p2align 1 +tlsdsofn: + move.w x:DTPREL16,$r10 +.Lfe1: + .size tlsdsofn,.Lfe1-tlsdsofn diff --git a/binutils-2.24/ld/testsuite/ld-cris/tls-ld-5.d b/binutils-2.24/ld/testsuite/ld-cris/tls-ld-5.d new file mode 100644 index 0000000..c2ea111 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/tls-ld-5.d @@ -0,0 +1,51 @@ +#as: --pic --no-underscore --em=criself +#ld: --shared -m crislinux +#source: tls-ld-5.s +#source: tls128g.s +#source: tls-hx1x2.s +#objdump: -s -t -R -p + +# DSO with two R_CRIS_16_DTPRELs against different hidden symbols. +# Check that we have proper NPTL/TLS markings and GOT. + +.*: file format elf32-cris + +Program Header: + LOAD off 0x0+ vaddr 0x0+ paddr 0x0+ align 2\*\*13 + filesz 0x0+1a8 memsz 0x0+1a8 flags r-x + LOAD off 0x0+1a8 vaddr 0x0+21a8 paddr 0x0+21a8 align 2\*\*13 + filesz 0x0+10c memsz 0x0+10c flags rw- + DYNAMIC off 0x0+230 vaddr 0x0+2230 paddr 0x0+2230 align 2\*\*2 + filesz 0x0+70 memsz 0x0+70 flags rw- + TLS off 0x0+1a8 vaddr 0x0+21a8 paddr 0x0+21a8 align 2\*\*2 + filesz 0x0+88 memsz 0x0+88 flags r-- + +Dynamic Section: + HASH 0x0+b4 + STRTAB 0x0+168 + SYMTAB 0x0+e8 + STRSZ 0x0+29 + SYMENT 0x0+10 + RELA 0x0+194 + RELASZ 0x0+c + RELAENT 0x0+c +private flags = 0: + +SYMBOL TABLE: +#... +0+84 l \.tdata 0+4 x2 +0+80 l \.tdata 0+4 x1 +#... + +DYNAMIC RELOCATION RECORDS +OFFSET TYPE VALUE +0+22ac R_CRIS_DTPMOD \*ABS\* + +Contents of section \.hash: +#... +Contents of section \.text: + 01a0 5fae8000 5fbe8400 .* +#... +Contents of section \.got: + 22a0 30220+ 0+ 0+ 0+ .* + 22b0 0+ .* diff --git a/binutils-2.24/ld/testsuite/ld-cris/tls-ld-5.s b/binutils-2.24/ld/testsuite/ld-cris/tls-ld-5.s new file mode 100644 index 0000000..910a79d --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/tls-ld-5.s @@ -0,0 +1,10 @@ + .text + .global tlsdsofn + .type tlsdsofn,@function + .p2align 1 +tlsdsofn: + move.w x1:DTPREL16,$r10 + move.w x2:DTPREL16,$r11 +.Lfe5: + .size tlsdsofn,.Lfe5-tlsdsofn + diff --git a/binutils-2.24/ld/testsuite/ld-cris/tls-ld-6.d b/binutils-2.24/ld/testsuite/ld-cris/tls-ld-6.d new file mode 100644 index 0000000..0b54114 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/tls-ld-6.d @@ -0,0 +1,50 @@ +#as: --pic --no-underscore --em=criself -I$srcdir/$subdir +#ld: --shared -m crislinux +#source: tls128g.s +#source: tls-ld-6.s +#source: tls-hx.s +#objdump: -s -t -R -p + +# DSO with a single R_CRIS_32_DTPREL against a hidden symbol. Check +# that we have proper NPTL/TLS markings and GOT. + +.*: file format elf32-cris + +Program Header: + LOAD off 0x0+ vaddr 0x0+ paddr 0x0+ align 2\*\*13 + filesz 0x0+1a8 memsz 0x0+1a8 flags r-x + LOAD off 0x0+1a8 vaddr 0x0+21a8 paddr 0x0+21a8 align 2\*\*13 + filesz 0x0+108 memsz 0x0+108 flags rw- + DYNAMIC off 0x0+22c vaddr 0x0+222c paddr 0x0+222c align 2\*\*2 + filesz 0x0+70 memsz 0x0+70 flags rw- + TLS off 0x0+1a8 vaddr 0x0+21a8 paddr 0x0+21a8 align 2\*\*2 + filesz 0x0+84 memsz 0x0+84 flags r-- + +Dynamic Section: + HASH 0x0+b4 + STRTAB 0x0+168 + SYMTAB 0x0+e8 + STRSZ 0x0+29 + SYMENT 0x0+10 + RELA 0x0+194 + RELASZ 0x0+c + RELAENT 0x0+c +private flags = 0: + +SYMBOL TABLE: +#... +0+80 l \.tdata 0+4 x +#... + +DYNAMIC RELOCATION RECORDS +OFFSET TYPE VALUE +0+22a8 R_CRIS_DTPMOD \*ABS\* + +Contents of section \.hash: +#... +Contents of section \.text: + 01a0 6fae8000 00000000 .* +#... +Contents of section \.got: + 229c 2c220+ 0+ 0+ 0+ .* + 22ac 0+ .* diff --git a/binutils-2.24/ld/testsuite/ld-cris/tls-ld-6.s b/binutils-2.24/ld/testsuite/ld-cris/tls-ld-6.s new file mode 100644 index 0000000..d0a98f6 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/tls-ld-6.s @@ -0,0 +1,8 @@ + .text + .global tlsdsofn + .type tlsdsofn,@function + .p2align 1 +tlsdsofn: + move.d x:DTPREL,$r10 +.Lfe6: + .size tlsdsofn,.Lfe6-tlsdsofn diff --git a/binutils-2.24/ld/testsuite/ld-cris/tls-ld-7.d b/binutils-2.24/ld/testsuite/ld-cris/tls-ld-7.d new file mode 100644 index 0000000..c537050 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/tls-ld-7.d @@ -0,0 +1,51 @@ +#as: --pic --no-underscore --em=criself +#ld: --shared -m crislinux +#source: tls-ld-7.s +#source: tls128g.s +#source: tls-hx1x2.s +#objdump: -s -t -R -p + +# DSO with two R_CRIS_32_DTPRELs against different hidden symbols. +# Check that we have proper NPTL/TLS markings and GOT. + +.*: file format elf32-cris + +Program Header: + LOAD off 0x0+ vaddr 0x0+ paddr 0x0+ align 2\*\*13 + filesz 0x0+1ac memsz 0x0+1ac flags r-x + LOAD off 0x0+1ac vaddr 0x0+21ac paddr 0x0+21ac align 2\*\*13 + filesz 0x0+10c memsz 0x0+10c flags rw- + DYNAMIC off 0x0+234 vaddr 0x0+2234 paddr 0x0+2234 align 2\*\*2 + filesz 0x0+70 memsz 0x0+70 flags rw- + TLS off 0x0+1ac vaddr 0x0+21ac paddr 0x0+21ac align 2\*\*2 + filesz 0x0+88 memsz 0x0+88 flags r-- + +Dynamic Section: + HASH 0x0+b4 + STRTAB 0x0+168 + SYMTAB 0x0+e8 + STRSZ 0x0+29 + SYMENT 0x0+10 + RELA 0x0+194 + RELASZ 0x0+c + RELAENT 0x0+c +private flags = 0: + +SYMBOL TABLE: +#... +0+84 l \.tdata 0+4 x2 +0+80 l \.tdata 0+4 x1 +#... + +DYNAMIC RELOCATION RECORDS +OFFSET TYPE VALUE +0+22b0 R_CRIS_DTPMOD \*ABS\* + +Contents of section \.hash: +#... +Contents of section \.text: + 01a0 6fae80+ 0+6fbe 840+ .* +#... +Contents of section \.got: + 22a4 34220+ 0+ 0+ 0+ .* + 22b4 0+ .* diff --git a/binutils-2.24/ld/testsuite/ld-cris/tls-ld-7.s b/binutils-2.24/ld/testsuite/ld-cris/tls-ld-7.s new file mode 100644 index 0000000..c64c1db --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/tls-ld-7.s @@ -0,0 +1,9 @@ + .text + .global tlsdsofn + .type tlsdsofn,@function + .p2align 1 +tlsdsofn: + move.d x1:DTPREL,$r10 + move.d x2:DTPREL,$r11 +.Lfe7: + .size tlsdsofn,.Lfe7-tlsdsofn diff --git a/binutils-2.24/ld/testsuite/ld-cris/tls-ldgd-14.d b/binutils-2.24/ld/testsuite/ld-cris/tls-ldgd-14.d new file mode 100644 index 0000000..4634dd2 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/tls-ldgd-14.d @@ -0,0 +1,71 @@ +#source: tls128g.s +#source: tls-ld-5.s +#source: tls-gd-1.s +#source: tls-ldgd-14.s +#source: tls-x.s +#source: tls-z.s +#source: tls-hx1x2.s +#as: --pic --no-underscore --em=criself +#ld: --shared -m crislinux +#objdump: -s -t -R -p -T + +# Check that we have proper NPTL/TLS markings and GOT for two +# R_CRIS_16_GOT_GD and two R_CRIS_16_DTPRELs against different +# variables in a DSO. + +.*: file format elf32-cris + +Program Header: + LOAD off 0x0+ vaddr 0x0+ paddr 0x0+ align 2\*\*13 + filesz 0x0+230 memsz 0x0+230 flags r-x + LOAD off 0x0+230 vaddr 0x0+2230 paddr 0x0+2230 align 2\*\*13 + filesz 0x0+124 memsz 0x0+124 flags rw- + DYNAMIC off 0x0+2c0 vaddr 0x0+22c0 paddr 0x0+22c0 align 2\*\*2 + filesz 0x0+70 memsz 0x0+70 flags rw- + TLS off 0x0+230 vaddr 0x0+2230 paddr 0x0+2230 align 2\*\*2 + filesz 0x0+90 memsz 0x0+90 flags r-- + +Dynamic Section: + HASH 0x0+b4 + STRTAB 0x0+1b8 + SYMTAB 0x0+f8 + STRSZ 0x0+42 + SYMENT 0x0+10 + RELA 0x0+1fc + RELASZ 0x0+24 + RELAENT 0x0+c +private flags = 0: + +SYMBOL TABLE: +#... +0+8c l \.tdata 0+4 x2 +#... +0+88 l \.tdata 0+4 x1 +#... +0+80 g \.tdata 0+4 x +#... +0+84 g \.tdata 0+4 z +#... +DYNAMIC SYMBOL TABLE: +#... +0+80 g D \.tdata 0+4 x +#... +0+84 g D \.tdata 0+4 z +#... + +DYNAMIC RELOCATION RECORDS +OFFSET TYPE VALUE +0+233c R_CRIS_DTPMOD \*ABS\* +0+2344 R_CRIS_DTP x +0+234c R_CRIS_DTP z + +Contents of section \.hash: +#... +Contents of section \.text: + 0220 5fae8800 5fbe8c00 5fae1400 5fae1c00 .* +Contents of section .tdata: +#... +Contents of section \.got: + 2330 c0220+ 0+ 0+ 0+ .* + 2340 0+ 0+ 0+ 0+ .* + 2350 0+ .* diff --git a/binutils-2.24/ld/testsuite/ld-cris/tls-ldgd-14.s b/binutils-2.24/ld/testsuite/ld-cris/tls-ldgd-14.s new file mode 100644 index 0000000..3de8f87 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/tls-ldgd-14.s @@ -0,0 +1,8 @@ + .text + .global tlsdsofn14 + .type tlsdsofn14,@function + .p2align 1 +tlsdsofn14: + move.w z:GDGOTREL16,$r10 +.Lfe14: + .size tlsdsofn14,.Lfe14-tlsdsofn14 diff --git a/binutils-2.24/ld/testsuite/ld-cris/tls-ldgd-15.d b/binutils-2.24/ld/testsuite/ld-cris/tls-ldgd-15.d new file mode 100644 index 0000000..8583bd2 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/tls-ldgd-15.d @@ -0,0 +1,72 @@ +#source: tls128g.s +#source: tls-ld-7.s +#source: tls-gd-2.s +#source: tls-ldgd-15.s +#source: tls-x.s +#source: tls-z.s +#source: tls-hx1x2.s +#as: --pic --no-underscore --em=criself +#ld: --shared -m crislinux +#objdump: -s -t -R -p -T + +# Check that we have proper NPTL/TLS markings and GOT for two +# R_CRIS_32_GOT_GD and two R_CRIS_32_DTPRELs against different +# variables in a DSO. + +.*: file format elf32-cris + +Program Header: + LOAD off 0x0+ vaddr 0x0+ paddr 0x0+ align 2\*\*13 + filesz 0x0+23c memsz 0x0+23c flags r-x + LOAD off 0x0+23c vaddr 0x0+223c paddr 0x0+223c align 2\*\*13 + filesz 0x0+124 memsz 0x0+124 flags rw- + DYNAMIC off 0x0+2cc vaddr 0x0+22cc paddr 0x0+22cc align 2\*\*2 + filesz 0x0+70 memsz 0x0+70 flags rw- + TLS off 0x0+23c vaddr 0x0+223c paddr 0x0+223c align 2\*\*2 + filesz 0x0+90 memsz 0x0+90 flags r-- + +Dynamic Section: + HASH 0x0+b4 + STRTAB 0x0+1b8 + SYMTAB 0x0+f8 + STRSZ 0x0+42 + SYMENT 0x0+10 + RELA 0x0+1fc + RELASZ 0x0+24 + RELAENT 0x0+c +private flags = 0: + +SYMBOL TABLE: +#... +0+8c l \.tdata 0+4 x2 +#... +0+88 l \.tdata 0+4 x1 +#... +0+80 g \.tdata 0+4 x +#... +0+84 g \.tdata 0+4 z +#... +DYNAMIC SYMBOL TABLE: +#... +0+80 g D \.tdata 0+4 x +#... +0+84 g D \.tdata 0+4 z +#... + +DYNAMIC RELOCATION RECORDS +OFFSET TYPE VALUE +0+2348 R_CRIS_DTPMOD \*ABS\* +0+2350 R_CRIS_DTP x +0+2358 R_CRIS_DTP z + +Contents of section \.hash: +#... +Contents of section \.text: + 0220 6fae8800 00006fbe 8c000000 6fae1400 .* + 0230 0+ 6fae1c00 0+ .* +Contents of section .tdata: +#... +Contents of section \.got: + 233c cc220+ 0+ 0+ 0+ .* + 234c 0+ 0+ 0+ 0+ .* + 235c 0+ .* diff --git a/binutils-2.24/ld/testsuite/ld-cris/tls-ldgd-15.s b/binutils-2.24/ld/testsuite/ld-cris/tls-ldgd-15.s new file mode 100644 index 0000000..2b55243 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/tls-ldgd-15.s @@ -0,0 +1,9 @@ + .text + .global tlsdsofn14 + .type tlsdsofn14,@function + .p2align 1 +tlsdsofn14: + move.d z:GDGOTREL,$r10 +.Lfe15: + .size tlsdsofn14,.Lfe15-tlsdsofn14 + diff --git a/binutils-2.24/ld/testsuite/ld-cris/tls-ldgde-14.d b/binutils-2.24/ld/testsuite/ld-cris/tls-ldgde-14.d new file mode 100644 index 0000000..9eada3e --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/tls-ldgde-14.d @@ -0,0 +1,61 @@ +#source: start1.s +#source: tls128.s +#source: tls-ld-5.s +#source: tls-gd-1.s +#source: tls-ldgd-14.s +#source: tls-x.s +#source: tls-z.s +#source: tls-hx1x2.s +#as: --pic --no-underscore --em=criself +#ld: -m crislinux +#objdump: -d -s -h -t -r -p + +# Check that we have proper NPTL/TLS markings and GOT for two +# R_CRIS_16_GOT_GD and two R_CRIS_16_DTPRELs against different +# variables, for an executable. + +.*: file format elf32-cris + +Program Header: +#... + TLS off 0x0+a8 vaddr 0x0+820a8 paddr 0x0+820a8 align 2\*\*2 + filesz 0x0+90 memsz 0x0+90 flags r-- +private flags = 0: +#... + 1 .tdata .* + CONTENTS.* + 2 .got .* + CONTENTS.* +SYMBOL TABLE: +#... +0+80 g \.tdata 0+4 x +#... +0+8c g .tdata 00000004 \.hidden x2 +#... +0+84 g \.tdata 0+4 z +#... +0+88 g .tdata 00000004 \.hidden x1 +#... +Contents of section \.text: +#... +Contents of section \.tdata: +#... +Contents of section \.got: + 82138 00000000 00000000 00000000 01000000 .* + 82148 00000000 01000000 80000000 01000000 .* + 82158 84000000 .* + +Disassembly of section \.text: + +00080094 <_start>: + 80094: 41b2 moveq 1,\$r11 +#... +00080098 <tlsdsofn>: + 80098: 5fae 8800 move\.w 0x88,\$r10 + 8009c: 5fbe 8c00 move\.w 0x8c,\$r11 + +000800a0 <tlsdsofn0>: + 800a0: 5fae 1400 move\.w 0x14,\$r10 + +000800a4 <tlsdsofn14>: + 800a4: 5fae 1c00 move\.w 0x1c,\$r10 diff --git a/binutils-2.24/ld/testsuite/ld-cris/tls-ldgde-15.d b/binutils-2.24/ld/testsuite/ld-cris/tls-ldgde-15.d new file mode 100644 index 0000000..d5e993d --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/tls-ldgde-15.d @@ -0,0 +1,61 @@ +#source: start1.s +#source: tls128.s +#source: tls-ld-7.s +#source: tls-gd-2.s +#source: tls-ldgd-15.s +#source: tls-x.s +#source: tls-z.s +#source: tls-hx1x2.s +#as: --pic --no-underscore --em=criself +#ld: -m crislinux +#objdump: -d -s -h -t -r -p + +# Check that we have proper NPTL/TLS markings and GOT for two +# R_CRIS_32_GOT_GD and two R_CRIS_32_DTPRELs against different +# variables, for an executable. + +.*: file format elf32-cris + +Program Header: +#... + TLS off 0x0+b4 vaddr 0x0+820b4 paddr 0x0+820b4 align 2\*\*2 + filesz 0x0+90 memsz 0x0+90 flags r-- +private flags = 0: +#... + 1 .tdata .* + CONTENTS.* + 2 .got .* + CONTENTS.* +SYMBOL TABLE: +#... +0+80 g \.tdata 0+4 x +#... +0+8c g .tdata 00000004 \.hidden x2 +#... +0+84 g \.tdata 0+4 z +#... +0+88 g .tdata 00000004 \.hidden x1 +#... +Contents of section \.text: +#... +Contents of section \.tdata: +#... +Contents of section \.got: + 82144 00000000 00000000 00000000 01000000 .* + 82154 00000000 01000000 80000000 01000000 .* + 82164 84000000 .* + +Disassembly of section \.text: + +00080094 <_start>: + 80094: 41b2 moveq 1,\$r11 +#... +00080098 <tlsdsofn>: + 80098: 6fae 8800 0000 move.d 88 <x1>,\$r10 + 8009e: 6fbe 8c00 0000 move.d 8c <x2>,\$r11 +000800a4 <tlsdsofn2>: + 800a4: 6fae 1400 0000 move.d 14 <tls128\+0x14>,\$r10 +#... +000800ac <tlsdsofn14>: + 800ac: 6fae 1c00 0000 move.d 1c <tls128\+0x1c>,\$r10 +#... diff --git a/binutils-2.24/ld/testsuite/ld-cris/tls-ldgdex-14.d b/binutils-2.24/ld/testsuite/ld-cris/tls-ldgdex-14.d new file mode 100644 index 0000000..83d94a7 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/tls-ldgdex-14.d @@ -0,0 +1,54 @@ +#source: start1.s +#source: tls128.s +#source: tls-ld-5.s +#source: tls-gd-1.s +#source: tls-ldgd-14.s +#source: tls-hx1x2.s +#as: --pic --no-underscore --em=criself +#ld: -m crislinux 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 two +# R_CRIS_16_GOT_GD and two R_CRIS_16_DTPRELs against different +# variables, for an executable, GD symbols defined elsewhere. + +.*: file format elf32-cris + +Program Header: +#... + TLS off .* + filesz 0x0+88 memsz 0x0+88 flags r-- + +Dynamic Section: + NEEDED tmpdir/tls-dso-xz-1.so +#... +private flags = 0: +#... + 8 .got .* + CONTENTS.* +SYMBOL TABLE: +#... +0+ \*UND\* 0+ x +#... +0+ \*UND\* 0+ z +#... +DYNAMIC SYMBOL TABLE: +0+ D \*UND\* 0+ x +0+ D \*UND\* 0+ z +#... +DYNAMIC RELOCATION RECORDS +OFFSET TYPE VALUE +0008230c R_CRIS_DTP x +00082314 R_CRIS_DTP z + +Contents of section .interp: +#... +Contents of section \.text: + 801dc 41b20000 5fae8000 5fbe8400 5fae1400 .* + 801ec 5fae1c00 .* +Contents of section \.tdata: +#... +Contents of section \.got: + 822f8 78220800 0+ 0+ 010+ .* + 82308 0+ 0+ 0+ 0+ .* + 82318 0+ .* diff --git a/binutils-2.24/ld/testsuite/ld-cris/tls-ldgdex-15.d b/binutils-2.24/ld/testsuite/ld-cris/tls-ldgdex-15.d new file mode 100644 index 0000000..fca739b --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/tls-ldgdex-15.d @@ -0,0 +1,54 @@ +#source: start1.s +#source: tls128.s +#source: tls-ld-7.s +#source: tls-gd-2.s +#source: tls-ldgd-15.s +#source: tls-hx1x2.s +#as: --pic --no-underscore --em=criself +#ld: -m crislinux 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 two +# R_CRIS_32_GOT_GD and two R_CRIS_32_DTPRELs against different +# variables, for an executable, GD symbols defined elsewhere. + +.*: file format elf32-cris + +Program Header: +#... + TLS off .* + filesz 0x0+88 memsz 0x0+88 flags r-- + +Dynamic Section: + NEEDED tmpdir/tls-dso-xz-1.so +#... +private flags = 0: +#... + 8 .got .* + CONTENTS.* +SYMBOL TABLE: +#... +0+ \*UND\* 0+ x +#... +0+ \*UND\* 0+ z +#... +DYNAMIC SYMBOL TABLE: +0+ D \*UND\* 0+ x +0+ D \*UND\* 0+ z +#... +DYNAMIC RELOCATION RECORDS +OFFSET TYPE VALUE +00082318 R_CRIS_DTP x +00082320 R_CRIS_DTP z + +Contents of section \.interp: +#... +Contents of section \.text: + 801dc 41b20000 6fae8000 00006fbe 84000000 .* + 801ec 6fae1400 00000000 6fae1c00 00000000 .* +Contents of section \.tdata: +#... +Contents of section \.got: + 82304 84220800 0+ 0+ 010+ .* + 82314 0+ 0+ 0+ 0+ .* + 82324 0+ .* diff --git a/binutils-2.24/ld/testsuite/ld-cris/tls-ldgdx-14.d b/binutils-2.24/ld/testsuite/ld-cris/tls-ldgdx-14.d new file mode 100644 index 0000000..53fde9c --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/tls-ldgdx-14.d @@ -0,0 +1,55 @@ +#source: tls128.s +#source: tls-ld-5.s +#source: tls-gd-1.s +#source: tls-ldgd-14.s +#source: tls-hx1x2.s +#as: --pic --no-underscore --em=criself +#ld: --shared -m crislinux 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 two +# R_CRIS_16_GOT_GD and two R_CRIS_16_DTPRELs against different +# variables in a DSO, GD symbols defined elsewhere. + +.*: file format elf32-cris + +Program Header: +#... + TLS off .* + filesz 0x0+88 memsz 0x0+88 flags r-- + +Dynamic Section: + NEEDED tmpdir/tls-dso-xz-1.so +#... +private flags = 0: +#... + 7 .got .* + CONTENTS.* +SYMBOL TABLE: +#... +0+ \*UND\* 0+ x +#... +0+ \*UND\* 0+ z +#... +DYNAMIC SYMBOL TABLE: +#... +0+ D \*UND\* 0+ x +#... +0+ D \*UND\* 0+ z +#... +DYNAMIC RELOCATION RECORDS +OFFSET TYPE VALUE +00002338 R_CRIS_DTPMOD \*ABS\* +00002340 R_CRIS_DTP x +00002348 R_CRIS_DTP z + +Contents of section \.hash: +#... +Contents of section \.text: + 021c 5fae8000 5fbe8400 5fae1400 5fae1c00 .* +Contents of section .tdata: +#... +Contents of section \.got: + 232c b4220+ 0+ 0+ 0+ .* + 233c 0+ 0+ 0+ 0+ .* + 234c 0+ .* diff --git a/binutils-2.24/ld/testsuite/ld-cris/tls-ldgdx-15.d b/binutils-2.24/ld/testsuite/ld-cris/tls-ldgdx-15.d new file mode 100644 index 0000000..8b0af3f --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/tls-ldgdx-15.d @@ -0,0 +1,56 @@ +#source: tls128.s +#source: tls-ld-7.s +#source: tls-gd-2.s +#source: tls-ldgd-15.s +#source: tls-hx1x2.s +#as: --pic --no-underscore --em=criself +#ld: --shared -m crislinux 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 two +# R_CRIS_32_GOT_GD and two R_CRIS_32_DTPRELs against different +# variables in a DSO, GD symbols defined elsewhere. + +.*: file format elf32-cris + +Program Header: +#... + TLS off .* + filesz 0x0+88 memsz 0x0+88 flags r-- + +Dynamic Section: + NEEDED tmpdir/tls-dso-xz-1.so +#... +private flags = 0: +#... + 7 .got .* + CONTENTS.* +SYMBOL TABLE: +#... +0+ \*UND\* 0+ x +#... +0+ \*UND\* 0+ z +#... +DYNAMIC SYMBOL TABLE: +#... +0+ D \*UND\* 0+ x +#... +0+ D \*UND\* 0+ z +#... +DYNAMIC RELOCATION RECORDS +OFFSET TYPE VALUE +00002344 R_CRIS_DTPMOD \*ABS\* +0000234c R_CRIS_DTP x +00002354 R_CRIS_DTP z + +Contents of section \.hash: +#... +Contents of section \.text: + 021c 6fae8000 00006fbe 84000000 6fae1400 .* + 022c 0+ 6fae1c00 0+ .* +Contents of section .tdata: +#... +Contents of section \.got: + 2338 c0220+ 0+ 0+ 0+ .* + 2348 0+ 0+ 0+ 0+ .* + 2358 0+ .* diff --git a/binutils-2.24/ld/testsuite/ld-cris/tls-le-12.d b/binutils-2.24/ld/testsuite/ld-cris/tls-le-12.d new file mode 100644 index 0000000..d24b21b --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/tls-le-12.d @@ -0,0 +1,38 @@ +#source: start1.s +#source: tls128.s +#source: tls-le-12.s +#source: tls-z.s +#as: --no-underscore --em=criself -I$srcdir/$subdir +#ld: -m crislinux +#objdump: -d -s -t -r -p -h + +# Check that we have proper NPTL/TLS markings and no GOT for an +# executable with a single R_CRIS_32_TPREL. + +.*: file format elf32-cris + +Program Header: +#... + TLS off 0x0+a0 vaddr 0x0+820a0 paddr 0x0+820a0 align 2\*\*2 + filesz 0x0+84 memsz 0x0+84 flags r-- +private flags = 0: +#... + 1 .tdata .* + CONTENTS.* +SYMBOL TABLE: +#... +0+80 g \.tdata 0+4 z +#... +Contents of section \.text: +#... +Contents of section \.tdata: +#... + +Disassembly of section \.text: + +00080094 <_start>: + 80094: 41b2 moveq 1,\$r11 +#... +00080098 <tlsfn12>: + 80098: 6fae fcff ffff move\.d 0xfffffffc,\$r10 +#... diff --git a/binutils-2.24/ld/testsuite/ld-cris/tls-le-12.s b/binutils-2.24/ld/testsuite/ld-cris/tls-le-12.s new file mode 100644 index 0000000..18974ef --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/tls-le-12.s @@ -0,0 +1,8 @@ + .text + .global tlsfn12 + .type tlsfn12,@function + .p2align 1 +tlsfn12: + move.d z:TPOFF,$r10 +.Lfe12: + .size tlsfn12,.Lfe12-tlsfn12 diff --git a/binutils-2.24/ld/testsuite/ld-cris/tls-le-12s.d b/binutils-2.24/ld/testsuite/ld-cris/tls-le-12s.d new file mode 100644 index 0000000..96570e9 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/tls-le-12s.d @@ -0,0 +1,38 @@ +#source: start1.s +#source: tls-le-12s.s +#source: tls-z.s +#source: tls128.s +#as: --no-underscore --em=criself -I$srcdir/$subdir +#ld: -m crislinux +#objdump: -d -s -t -r -p -h + +# Check that we have proper NPTL/TLS markings and no GOT for an +# executable with a single R_CRIS_16_TPREL. + +.*: file format elf32-cris + +Program Header: +#... + TLS off 0x0+9c vaddr 0x0+8209c paddr 0x0+8209c align 2\*\*2 + filesz 0x0+84 memsz 0x0+84 flags r-- +private flags = 0: +#... + 1 .tdata .* + CONTENTS.* +SYMBOL TABLE: +#... +0+ g \.tdata 0+4 z +#... +Contents of section \.text: +#... +Contents of section \.tdata: +#... + +Disassembly of section \.text: + +00080094 <_start>: + 80094: 41b2 moveq 1,\$r11 +#... +00080098 <tlsfn12>: + 80098: 7fac 7cff movs\.w -132,\$r10 +#... diff --git a/binutils-2.24/ld/testsuite/ld-cris/tls-le-12s.s b/binutils-2.24/ld/testsuite/ld-cris/tls-le-12s.s new file mode 100644 index 0000000..12e00e1 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/tls-le-12s.s @@ -0,0 +1,8 @@ + .text + .global tlsfn12 + .type tlsfn12,@function + .p2align 1 +tlsfn12: + movs.w z:TPOFF16,$r10 +.Lfe12: + .size tlsfn12,.Lfe12-tlsfn12 diff --git a/binutils-2.24/ld/testsuite/ld-cris/tls-le-13.d b/binutils-2.24/ld/testsuite/ld-cris/tls-le-13.d new file mode 100644 index 0000000..3d969ac --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/tls-le-13.d @@ -0,0 +1,41 @@ +#source: start1.s +#source: tls128.s +#source: tls-le-13.s +#source: tls-x1x2.s +#as: --no-underscore --em=criself -I$srcdir/$subdir +#ld: -m crislinux +#objdump: -d -s -t -r -p -h + +# Check that we have proper NPTL/TLS markings and GOT for an +# executable with a single R_CRIS_32_TPREL. + +.*: file format elf32-cris + +Program Header: +#... + TLS off 0x0+a4 vaddr 0x0+820a4 paddr 0x0+820a4 align 2\*\*2 + filesz 0x0+88 memsz 0x0+88 flags r-- +private flags = 0: +#... + 1 .tdata .* + CONTENTS.* +SYMBOL TABLE: +#... +0+84 g \.tdata 0+4 x2 +#... +0+80 g \.tdata 0+4 x1 +#... +Contents of section \.text: +#... +Contents of section \.tdata: +#... + +Disassembly of section \.text: + +00080094 <_start>: + 80094: 41b2 moveq 1,\$r11 +#... +00080098 <tlsfn13>: + 80098: 6fae f8ff ffff move\.d 0xfffffff8,\$r10 + 8009e: 6fae fcff ffff move\.d 0xfffffffc,\$r10 +#... diff --git a/binutils-2.24/ld/testsuite/ld-cris/tls-le-13.s b/binutils-2.24/ld/testsuite/ld-cris/tls-le-13.s new file mode 100644 index 0000000..a1183ea --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/tls-le-13.s @@ -0,0 +1,9 @@ + .text + .global tlsfn13 + .type tlsfn13,@function + .p2align 1 +tlsfn13: + move.d x1:TPOFF,$r10 + move.d x2:TPOFF,$r10 +.Lfe13: + .size tlsfn13,.Lfe13-tlsfn13 diff --git a/binutils-2.24/ld/testsuite/ld-cris/tls-le-13s.d b/binutils-2.24/ld/testsuite/ld-cris/tls-le-13s.d new file mode 100644 index 0000000..146c913 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/tls-le-13s.d @@ -0,0 +1,40 @@ +#source: start1.s +#source: tls128.s +#source: tls-le-13s.s +#source: tls-x1x2.s +#as: --no-underscore --em=criself -I$srcdir/$subdir +#ld: -m crislinux +#objdump: -d -s -t -r -p -h + +# Check that we have proper NPTL/TLS markings and GOT for an +# executable with two R_CRIS_16_TPREL, different symbols. + +.*: file format elf32-cris + +Program Header: +#... + TLS off 0x0+a0 vaddr 0x0+820a0 paddr 0x0+820a0 align 2\*\*2 + filesz 0x0+88 memsz 0x0+88 flags r-- +private flags = 0: +#... + 1 .tdata .* + CONTENTS.* +SYMBOL TABLE: +#... +0+84 g \.tdata 0+4 x2 +#... +0+80 g \.tdata 0+4 x1 +#... +Contents of section \.text: +#... +Contents of section \.tdata: +#... + +Disassembly of section \.text: + +00080094 <_start>: + 80094: 41b2 moveq 1,\$r11 +#... +00080098 <tlsfn13>: + 80098: 5fae f8ff move\.w 0xfff8,\$r10 + 8009c: 5fae fcff move\.w 0xfffc,\$r10 diff --git a/binutils-2.24/ld/testsuite/ld-cris/tls-le-13s.s b/binutils-2.24/ld/testsuite/ld-cris/tls-le-13s.s new file mode 100644 index 0000000..09e4966 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/tls-le-13s.s @@ -0,0 +1,9 @@ + .text + .global tlsfn13 + .type tlsfn13,@function + .p2align 1 +tlsfn13: + move.w x1:TPOFF16,$r10 + move.w x2:TPOFF16,$r10 +.Lfe13s: + .size tlsfn13,.Lfe13s-tlsfn13 diff --git a/binutils-2.24/ld/testsuite/ld-cris/tls-legd-16.d b/binutils-2.24/ld/testsuite/ld-cris/tls-legd-16.d new file mode 100644 index 0000000..092d39e --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/tls-legd-16.d @@ -0,0 +1,59 @@ +#source: start1.s +#source: tls128.s +#source: tls-le-13.s +#source: tls-gd-3.s +#source: tls-legd-16.s +#source: tls-x.s +#source: tls-z.s +#source: tls-x1x2.s +#as: --no-underscore --em=criself +#ld: -m crislinux +#objdump: -d -s -h -t -r -p + +# Check that we have proper NPTL/TLS markings and GOT for an +# executable with two R_CRIS_32_TPREL and two R_CRIS_32_GD, different +# symbols. + +.*: file format elf32-cris + +Program Header: +#... + TLS off 0x0+b4 vaddr 0x0+820b4 paddr 0x0+820b4 align 2\*\*2 + filesz 0x0+90 memsz 0x0+90 flags r-- +private flags = 0: + +#... + 2 .got .* + CONTENTS.* +SYMBOL TABLE: +#... +0+80 g \.tdata 0+4 x +#... +0+8c g \.tdata 0+4 x2 +#... +0+84 g \.tdata 0+4 z +#... +0+88 g \.tdata 0+4 x1 +#... +Contents of section \.text: +#... +Contents of section \.got: + 82144 0+ 0+ 0+ 010+ .* + 82154 80+ 010+ 840+ .* + +Disassembly of section \.text: + +00080094 <_start>: + 80094: 41b2 moveq 1,\$r11 +#... +00080098 <tlsfn13>: + 80098: 6fae f8ff ffff move.d 0xfffffff8,\$r10 + 8009e: 6fae fcff ffff move.d 0xfffffffc,\$r10 + +000800a4 <tlsfn>: + 800a4: 6fae 5021 0800 move.d 82150 <_GLOBAL_OFFSET_TABLE_\+0xc>,\$r10 +#... + +000800ac <tlsfn16>: + 800ac: 6fae 5821 0800 move.d 82158 <_GLOBAL_OFFSET_TABLE_\+0x14>,\$r10 +#... diff --git a/binutils-2.24/ld/testsuite/ld-cris/tls-legd-16.s b/binutils-2.24/ld/testsuite/ld-cris/tls-legd-16.s new file mode 100644 index 0000000..3716082 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/tls-legd-16.s @@ -0,0 +1,8 @@ + .text + .global tlsfn16 + .type tlsfn15,@function + .p2align 1 +tlsfn16: + move.d z:GD,$r10 +.Lfe16: + .size tlsfn16,.Lfe16-tlsfn16 diff --git a/binutils-2.24/ld/testsuite/ld-cris/tls-legd-17.d b/binutils-2.24/ld/testsuite/ld-cris/tls-legd-17.d new file mode 100644 index 0000000..49f2d45 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/tls-legd-17.d @@ -0,0 +1,58 @@ +#source: start1.s +#source: tls128.s +#source: tls-le-13s.s +#source: tls-gd-2.s --pic +#source: tls-ldgd-14.s --pic +#source: tls-x.s +#source: tls-z.s +#source: tls-x1x2.s +#as: --no-underscore --em=criself +#ld: -m crislinux +#objdump: -d -s -h -t -r -p + +# Check that we have proper NPTL/TLS markings and GOT for an +# executable with two R_CRIS_16_TPREL a R_CRIS_32_GOT_GD and a +# R_CRIS_16_GOT_GD, different symbols. + +.*: file format elf32-cris + +Program Header: +#... + TLS off 0x0+ac vaddr 0x0+820ac paddr 0x0+820ac align 2\*\*2 + filesz 0x0+90 memsz 0x0+90 flags r-- +private flags = 0: + +#... + 2 .got .* + CONTENTS.* +SYMBOL TABLE: +#... +0+80 g \.tdata 0+4 x +#... +0+8c g \.tdata 0+4 x2 +#... +0+84 g \.tdata 0+4 z +#... +0+88 g \.tdata 0+4 x1 +#... +Contents of section \.text: +#... +Contents of section \.got: + 8213c 0+ 0+ 0+ 010+ .* + 8214c 80+ 010+ 840+ .* + +Disassembly of section \.text: + +00080094 <_start>: + 80094: 41b2 moveq 1,\$r11 +#... +00080098 <tlsfn13>: + 80098: 5fae f8ff move.w 0xfff8,\$r10 + 8009c: 5fae fcff move.w 0xfffc,\$r10 + +000800a0 <tlsdsofn2>: + 800a0: 6fae 0c00 0000 move.d c <tls128\+0xc>,\$r10 +#... + +000800a8 <tlsdsofn14>: + 800a8: 5fae 1400 move.w 0x14,\$r10 diff --git a/binutils-2.24/ld/testsuite/ld-cris/tls-legdx-16.d b/binutils-2.24/ld/testsuite/ld-cris/tls-legdx-16.d new file mode 100644 index 0000000..1e3bc3e --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/tls-legdx-16.d @@ -0,0 +1,52 @@ +#source: start1.s +#source: tls128.s +#source: tls-le-13.s +#source: tls-gd-3.s +#source: tls-legd-16.s +#source: tls-x1x2.s +#as: --no-underscore --em=criself +#ld: -m crislinux 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 an +# executable with two R_CRIS_32_TPREL and two R_CRIS_32_GD, different +# symbols, GD symbols defined elsewhere. + +.*: file format elf32-cris + +Program Header: +#... + TLS off .* + filesz 0x0+88 memsz 0x0+88 flags r-- +Dynamic Section: + NEEDED tmpdir/tls-dso-xz-1.so +#... +private flags = 0: + +#... + 8 .got .* + CONTENTS.* +SYMBOL TABLE: +#... +0+ \*UND\* 0+ x +#... +0+ \*UND\* 0+ z +#... +DYNAMIC SYMBOL TABLE: +0+ D \*UND\* 0+ x +0+ D \*UND\* 0+ z +#... +DYNAMIC RELOCATION RECORDS +OFFSET TYPE VALUE +00082310 R_CRIS_DTP x +00082318 R_CRIS_DTP z + +Contents of section .interp: +#... +Contents of section \.text: + 801dc 41b20000 6faef8ff ffff6fae fcffffff .* + 801ec 6fae1023 08000000 6fae1823 08000000 .* +#... +Contents of section \.got: + 82304 84220800 0+ 0+ 0+ .* + 82314 0+ 0+ 0+ .* diff --git a/binutils-2.24/ld/testsuite/ld-cris/tls-legdx-17.d b/binutils-2.24/ld/testsuite/ld-cris/tls-legdx-17.d new file mode 100644 index 0000000..1d1c5ea --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/tls-legdx-17.d @@ -0,0 +1,54 @@ +#source: start1.s +#source: tls128.s +#source: tls-le-13s.s +#source: tls-gd-2.s --pic +#source: tls-ldgd-14.s --pic +#source: tls-x1x2.s +#as: --no-underscore --em=criself +#ld: -m crislinux 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 an +# executable with two R_CRIS_16_TPREL a R_CRIS_32_GOT_GD and a +# R_CRIS_16_GOT_GD, different symbols, GD symbols defined elsewhere. + +.*: file format elf32-cris + +Program Header: +#... + TLS off .* + filesz 0x0+88 memsz 0x0+88 flags r-- +Dynamic Section: + NEEDED tmpdir/tls-dso-xz-1.so +#... +private flags = 0: + +#... + 8 .got .* + CONTENTS.* +SYMBOL TABLE: +#... +0+ \*UND\* 0+ x +#... +0+ \*UND\* 0+ z +#... +DYNAMIC SYMBOL TABLE: +#... +0+ D \*UND\* 0+ x +#... +0+ D \*UND\* 0+ z +#... +DYNAMIC RELOCATION RECORDS +OFFSET TYPE VALUE +00082308 R_CRIS_DTP x +00082310 R_CRIS_DTP z + +Contents of section .interp: +#... +Contents of section \.text: + 801dc 41b20000 5faef8ff 5faefcff 6fae0c00 .* + 801ec 00000000 5fae1400 .* +#... +Contents of section \.got: + 822fc 7c220800 0+ 0+ 0+ .* + 8230c 0+ 0+ 0+ .* diff --git a/binutils-2.24/ld/testsuite/ld-cris/tls-leie-18.d b/binutils-2.24/ld/testsuite/ld-cris/tls-leie-18.d new file mode 100644 index 0000000..edff43c --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/tls-leie-18.d @@ -0,0 +1,47 @@ +#source: start1.s +#source: tls128.s +#source: tls-le-13s.s +#source: tls-ie-9.s --pic +#source: tls-x1x2.s +#as: --no-underscore --em=criself +#ld: -m crislinux +#objdump: -d -s -h -t -r -p + +# Check that we have proper NPTL/TLS markings and GOT for an +# executable with two R_CRIS_16_TPREL and two R_CRIS_16_GOT_TPREL, no +# same reloc to same symbol; two different symbols. + +.*: file format elf32-cris + +Program Header: +#... + TLS off 0x0+a8 vaddr 0x0+820a8 paddr 0x0+820a8 align 2\*\*2 + filesz 0x0+88 memsz 0x0+88 flags r-- +private flags = 0: +#... + 2 .got .* + CONTENTS.* +SYMBOL TABLE: +#... +0+84 g \.tdata 0+4 x2 +#... +0+80 g \.tdata 0+4 x1 +#... +Contents of section \.text: +#... +Contents of section \.got: + 82130 0+ 0+ 0+ fcffffff .* + 82140 f8ffffff .* + +Disassembly of section \.text: + +00080094 <_start>: + 80094: 41b2 moveq 1,\$r11 +#... +00080098 <tlsfn13>: + 80098: 5fae f8ff move.w 0xfff8,\$r10 + 8009c: 5fae fcff move.w 0xfffc,\$r10 + +000800a0 <tlsdsofn9>: + 800a0: 5fae 1000 move.w 0x10,\$r10 + 800a4: 5fbe 0c00 move.w 0xc,\$r11 diff --git a/binutils-2.24/ld/testsuite/ld-cris/tls-leie-19.d b/binutils-2.24/ld/testsuite/ld-cris/tls-leie-19.d new file mode 100644 index 0000000..6cf69b2 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/tls-leie-19.d @@ -0,0 +1,58 @@ +#source: start1.s +#source: tls128.s +#source: tls-leie-19.s +#source: tls-le-12.s +#source: tls-ie-11.s --pic +#source: tls-hx1x2.s +#source: tls-x.s +#source: tls-z.s +#as: --no-underscore --em=criself +#ld: -m crislinux +#objdump: -d -s -h -t -r -p + +# Check that we have proper NPTL/TLS markings and GOT for an +# executable with two R_CRIS_32_TPREL and two R_CRIS_32_GOT_TPREL, +# four different symbols. + +.*: file format elf32-cris + +Program Header: +#... + TLS off 0x0+b4 vaddr 0x0+820b4 paddr 0x0+820b4 align 2\*\*2 + filesz 0x0+90 memsz 0x0+90 flags r-- +private flags = 0: +#... + 2 .got .* + CONTENTS.* +SYMBOL TABLE: +#... +0+88 g .tdata 0+4 x +#... +0+84 g \.tdata 0+4 \.hidden x2 +#... +0+8c g .tdata 0+4 z +#... +0+80 g \.tdata 0+4 \.hidden x1 +#... +Contents of section \.text: +#... +Contents of section \.got: + 82144 0+ 0+ 0+ f4ffffff .* + 82154 f0ffffff .* + +Disassembly of section \.text: + +00080094 <_start>: + 80094: 41b2 moveq 1,\$r11 +#... +00080098 <tlsfn19>: + 80098: 6fae f8ff ffff move.d 0xfffffff8,\$r10 +#... + +000800a0 <tlsfn12>: + 800a0: 6fae fcff ffff move.d 0xfffffffc,\$r10 +#... + +000800a8 <tlsdsofn>: + 800a8: 6fae 1000 0000 move.d 10 <tls128\+0x10>,\$r10 + 800ae: 6fbe 0c00 0000 move.d c <tls128\+0xc>,\$r11 diff --git a/binutils-2.24/ld/testsuite/ld-cris/tls-leie-19.s b/binutils-2.24/ld/testsuite/ld-cris/tls-leie-19.s new file mode 100644 index 0000000..a3a65ce --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/tls-leie-19.s @@ -0,0 +1,8 @@ + .text + .global tlsfn19 + .type tlsfn19,@function + .p2align 1 +tlsfn19: + move.d x:TPOFF,$r10 +.Lfe19: + .size tlsfn19,.Lfe19-tlsfn19 diff --git a/binutils-2.24/ld/testsuite/ld-cris/tls-local-54.d b/binutils-2.24/ld/testsuite/ld-cris/tls-local-54.d new file mode 100644 index 0000000..7c0deb6 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/tls-local-54.d @@ -0,0 +1,27 @@ +#source: tls-local-54.s +#as: --pic --no-underscore --em=criself -I$srcdir/$subdir +#ld: --shared -m crislinux +#objdump: -s -t -R -p -T + +# A DSO with a R_CRIS_32_GOT_GD against a local symbol. +# Check that we have proper NPTL/TLS markings and GOT. + +.*: file format elf32-cris + +Program Header: +#... + TLS off .* + filesz 0x00000080 memsz 0x00000080 flags r-- +#... +DYNAMIC RELOCATION RECORDS +OFFSET TYPE VALUE +00002288 R_CRIS_DTP \*ABS\*\+0x0000002a + +Contents of section .hash: +#... +Contents of section \.text: + 0184 6fae0c00 00000000 .* +#... +Contents of section \.got: + 227c 0c220000 0+ 0+ 0+ .* + 228c 0+ .* diff --git a/binutils-2.24/ld/testsuite/ld-cris/tls-local-54.s b/binutils-2.24/ld/testsuite/ld-cris/tls-local-54.s new file mode 100644 index 0000000..2bbe756 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/tls-local-54.s @@ -0,0 +1,3 @@ + .include "tls-gd-2.s" + .include "tls128.s" + .set x, tls128+42 diff --git a/binutils-2.24/ld/testsuite/ld-cris/tls-local-57.d b/binutils-2.24/ld/testsuite/ld-cris/tls-local-57.d new file mode 100644 index 0000000..cce2486 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/tls-local-57.d @@ -0,0 +1,23 @@ +#source: start1.s +#source: tls-x.s +#source: tls-local-57.s +#as: --pic --no-underscore --em=criself -I$srcdir/$subdir +#ld: -m crislinux +#objdump: -s -t -r -p + +# An executable with a R_CRIS_32_GOT_GD against a local symbol. +# Check that we have proper NPTL/TLS markings and GOT. + +.*: file format elf32-cris + +Program Header: +#... + TLS off .* + filesz 0x00000084 memsz 0x00000084 flags r-- +#... +Contents of section .text: + 80094 41b20000 6fae0c00 0+ .* +#... +Contents of section \.got: + 82124 0+ 0+ 0+ 010+ .* + 82134 040+ .* diff --git a/binutils-2.24/ld/testsuite/ld-cris/tls-local-57.s b/binutils-2.24/ld/testsuite/ld-cris/tls-local-57.s new file mode 100644 index 0000000..7c524fc --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/tls-local-57.s @@ -0,0 +1,3 @@ + .include "tls128.s" + .set x,tls128 + .include "tls-gd-2.s" diff --git a/binutils-2.24/ld/testsuite/ld-cris/tls-local-58.d b/binutils-2.24/ld/testsuite/ld-cris/tls-local-58.d new file mode 100644 index 0000000..d7926bd --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/tls-local-58.d @@ -0,0 +1,24 @@ +#source: start1.s +#source: tls-x.s +#source: tls-local-58.s +#as: --pic --no-underscore --em=criself -I$srcdir/$subdir +#ld: -m crislinux +#objdump: -s -t -r -p + +# An executable with a R_CRIS_32_GOT_GD and a R_CRIS_16_GOT_GD against +# the same local symbol. Check that we have proper NPTL/TLS markings +# and GOT. + +.*: file format elf32-cris + +Program Header: +#... + TLS off .* + filesz 0x00000084 memsz 0x00000084 flags r-- +#... +Contents of section .text: + 80094 41b20000 6fae0c00 00005fae 0c000000 .* +#... +Contents of section \.got: + 82128 0+ 0+ 0+ 010+ .* + 82138 040+ .* diff --git a/binutils-2.24/ld/testsuite/ld-cris/tls-local-58.s b/binutils-2.24/ld/testsuite/ld-cris/tls-local-58.s new file mode 100644 index 0000000..ceb2f69 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/tls-local-58.s @@ -0,0 +1,4 @@ + .include "tls128.s" + .set x,tls128 + .include "tls-gd-2.s" + .include "tls-gd-1.s" diff --git a/binutils-2.24/ld/testsuite/ld-cris/tls-local-59.d b/binutils-2.24/ld/testsuite/ld-cris/tls-local-59.d new file mode 100644 index 0000000..c37584b --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/tls-local-59.d @@ -0,0 +1,25 @@ +#source: start1.s +#source: tls-x.s +#source: tls-local-59.s +#as: --pic --no-underscore --em=criself -I$srcdir/$subdir +#ld: -m crislinux +#objdump: -s -t -r -p + +# An executable with a R_CRIS_32_GOT_GD, a R_CRIS_16_GOT_GD, a +# R_CRIS_32_GOT_TPREL and a R_CRIS_16_GOT_TPREL against the same local +# symbol. Check that we have proper NPTL/TLS markings and GOT. + +.*: file format elf32-cris + +Program Header: +#... + TLS off .* + filesz 0x00000084 memsz 0x00000084 flags r-- +#... +Contents of section .text: + 80094 41b20000 6fae1000 00006fae 0c000000 .* + 800a4 5fae1000 5fae0c00 .* +#... +Contents of section \.got: + 82130 0+ 0+ 0+ 80ffffff .* + 82140 010+ 040+ .* diff --git a/binutils-2.24/ld/testsuite/ld-cris/tls-local-59.s b/binutils-2.24/ld/testsuite/ld-cris/tls-local-59.s new file mode 100644 index 0000000..9a0d4e4 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/tls-local-59.s @@ -0,0 +1,6 @@ + .include "tls128.s" + .set x,tls128 + .include "tls-gd-2.s" + .include "tls-ie-10.s" + .include "tls-gd-1.s" + .include "tls-ie-8.s" diff --git a/binutils-2.24/ld/testsuite/ld-cris/tls-local-60.d b/binutils-2.24/ld/testsuite/ld-cris/tls-local-60.d new file mode 100644 index 0000000..958a296 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/tls-local-60.d @@ -0,0 +1,33 @@ +#source: tls-x.s +#source: tls-local-59.s +#as: --pic --no-underscore --em=criself -I$srcdir/$subdir +#ld: -m crislinux --shared +#objdump: -s -t -r -p -R -T + +# A DSO with a R_CRIS_32_GOT_GD, a R_CRIS_16_GOT_GD, a +# R_CRIS_32_GOT_TPREL and a R_CRIS_16_GOT_TPREL against the same local +# symbol. Check that we have proper NPTL/TLS markings and GOT. + +.*: file format elf32-cris + +Program Header: +#... + TLS off .* + filesz 0x00000084 memsz 0x00000084 flags r-- +#... + FLAGS 0x00000010 +#... +DYNAMIC RELOCATION RECORDS +OFFSET TYPE VALUE +0000231c R_CRIS_32_TPREL \*ABS\*\+0x0+4 +00002320 R_CRIS_DTP \*ABS\*\+0x0+4 + +Contents of section \.hash: +#... +Contents of section \.text: + 0200 6fae1000 00006fae 0c000000 5fae1000 .* + 0210 5fae0c00 .* +#... +Contents of section \.got: + 2310 98220+ 0+ 0+ 040+ .* + 2320 0+ 0+ .* diff --git a/binutils-2.24/ld/testsuite/ld-cris/tls-local-61.d b/binutils-2.24/ld/testsuite/ld-cris/tls-local-61.d new file mode 100644 index 0000000..bfa4a25 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/tls-local-61.d @@ -0,0 +1,32 @@ +#source: tls-local-59.s +#as: --pic --no-underscore --em=criself -I$srcdir/$subdir +#ld: -m crislinux --shared +#objdump: -s -t -r -p -R -T + +# A DSO with a R_CRIS_32_GOT_GD, a R_CRIS_16_GOT_GD, a +# R_CRIS_32_GOT_TPREL and a R_CRIS_16_GOT_TPREL against the same local +# symbol. Check that we have proper NPTL/TLS markings and GOT. + +.*: file format elf32-cris + +Program Header: +#... + TLS off .* + filesz 0x00000080 memsz 0x00000080 flags r-- +#... + FLAGS 0x00000010 +#... +DYNAMIC RELOCATION RECORDS +OFFSET TYPE VALUE +00002304 R_CRIS_32_TPREL \*ABS\* +00002308 R_CRIS_DTP \*ABS\* + +Contents of section \.hash: +#... +Contents of section \.text: + 01ec 6fae1000 00006fae 0c000000 5fae1000 .* + 01fc 5fae0c00 .* +#... +Contents of section \.got: + 22f8 80220+ 0+ 0+ 0+ .* + 2308 0+ 0+ .* diff --git a/binutils-2.24/ld/testsuite/ld-cris/tls-local-63.d b/binutils-2.24/ld/testsuite/ld-cris/tls-local-63.d new file mode 100644 index 0000000..320e717 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/tls-local-63.d @@ -0,0 +1,31 @@ +#source: tls-ie-8.s --pic +#source: tls-hx.s +#as: --no-underscore --em=criself +#ld: -m crislinux --shared +#readelf: -a -x 6 -x 8 -x 5 + +# A R_CRIS_16_GOT_TPREL in a DSO against a hidden symbol. Make sure +# the relocation, GOT, .text and .tdata have the right contents. + +#... +Relocation section '.rela.dyn' at offset 0x.* contains 1 entries: + Offset Info Type Sym.Value Sym. Name \+ Addend +00002210 0000001c R_CRIS_32_TPREL[ ]+0 + +The decoding of unwind sections for machine type Axis Communications 32-bit embedded processor is not currently supported. + +Symbol table '.dynsym' contains 7 entries: + Num: Value Size Type Bind Vis Ndx Name +#... +Symbol table '.symtab' contains 16 entries: +#... + .: 00000000 +4 +TLS +LOCAL +DEFAULT +6 x +#... +Hex dump of section '.text': + 0x00000184 5fae0c00 .* +#... +Hex dump of section '.tdata': + 0x00002188 280+ .* +#... +Hex dump of section '.got': + 0x0+2204 8c210000 0+ 0+ 0+ .* diff --git a/binutils-2.24/ld/testsuite/ld-cris/tls-local-64.d b/binutils-2.24/ld/testsuite/ld-cris/tls-local-64.d new file mode 100644 index 0000000..8fb44ee --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/tls-local-64.d @@ -0,0 +1,37 @@ +#source: tls-ie-8.s --pic +#source: tls128.s +#source: tls-hx.s +#as: --no-underscore --em=criself +#ld: -m crislinux --shared +#readelf: -a -x 6 -x 8 -x 5 + +# A R_CRIS_16_GOT_TPREL in a DSO against a hidden symbol, at an offset +# into .data. Make sure the relocation, GOT, .text and .tdata have +# the right contents. + +#... +Relocation section '.rela.dyn' at offset 0x.* contains 1 entries: + Offset Info Type Sym.Value Sym. Name \+ Addend +00002290 0000001c R_CRIS_32_TPREL[ ]+80 + +The decoding of unwind sections for machine type Axis Communications 32-bit embedded processor is not currently supported. + +Symbol table '.dynsym' contains 7 entries: + Num: Value Size Type Bind Vis Ndx Name +#... +Symbol table '.symtab' contains [0-9]+ entries: +#... + ..: 00000080 +4 +TLS +LOCAL +DEFAULT +6 x +#... +Hex dump of section '.text': + 0x00000184 5fae0c00 .* +#... +Hex dump of section '.tdata': + 0x00002188 2f0+ 0+ 0+ 0+ .* + 0x00002198 0+ 0+ 0+ 0+ .* +#... + 0x000021f8 0+ 0+ 0+ 0+ .* + 0x00002208 280+ .* +#... +Hex dump of section '.got': + 0x0+2284 0c220000 0+ 0+ 80+ .* diff --git a/binutils-2.24/ld/testsuite/ld-cris/tls-ok-30.d b/binutils-2.24/ld/testsuite/ld-cris/tls-ok-30.d new file mode 100644 index 0000000..94ed194 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/tls-ok-30.d @@ -0,0 +1,29 @@ +#source: tls-gdgotrelm.s --defsym r=8191 +#as: --no-underscore --em=criself --pic +#ld: --shared -m crislinux +#objdump: -s -j .got -R + +# Verify that the first and last R_CRIS_16_GOT_GD entries are ok just +# below the limit, in a DSO. Beware, the order here is quite random, +# supposedly depending on symbol hashes. + +.*: file format elf32-cris + +DYNAMIC RELOCATION RECORDS +OFFSET TYPE VALUE +000b3910 R_CRIS_DTP x2814 +#... +000b8350 R_CRIS_DTP x8190 +#... +000c1308 R_CRIS_DTP x0 +#... +000c3900 R_CRIS_DTP x1345 + +Contents of section .got: + b3904 94380b00 00000000 00000000 00000000 .* + b3914 00000000 00000000 00000000 00000000 .* +#... + c38e4 00000000 00000000 00000000 00000000 .* + c38f4 00000000 00000000 00000000 00000000 .* + c3904 00000000 .* +#PASS diff --git a/binutils-2.24/ld/testsuite/ld-cris/tls-ok-32.d b/binutils-2.24/ld/testsuite/ld-cris/tls-ok-32.d new file mode 100644 index 0000000..8042e28 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/tls-ok-32.d @@ -0,0 +1,23 @@ +#source: tls-dtprelm.s --defsym r=32767 +#as: --no-underscore --em=criself --pic +#ld: --shared -m crislinux +#objdump: -s -j .got -j .text -j .tdata -R + +# Check that a R_CRIS_16_DTPREL just below the theoretical limit +# works, in a DSO. + +.*: file format elf32-cris + +DYNAMIC RELOCATION RECORDS +OFFSET TYPE VALUE +0000a220 R_CRIS_DTPMOD \*ABS\* + +Contents of section \.text: + 01a0 5faeff7f .* +Contents of section \.tdata: + 21a4 2a2a2a2a 2a2a2a2a 2a2a2a2a 2a2a2a2a .* +#... + a194 2a2a2a2a 2a2a2a2a 2a2a2a2a 2a2a2a2a .* +Contents of section \.got: + a214 a4a10000 00000000 00000000 00000000 .* + a224 00000000 .* diff --git a/binutils-2.24/ld/testsuite/ld-cris/tls-ok-34.d b/binutils-2.24/ld/testsuite/ld-cris/tls-ok-34.d new file mode 100644 index 0000000..f534c993 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/tls-ok-34.d @@ -0,0 +1,28 @@ +#source: tls-gottprelm.s --defsym r=8189 +#as: --no-underscore --em=criself --pic +#ld: --shared -m crislinux +#objdump: -s -j .got -R + +# Check that a R_CRIS_16_DTPREL just below the theoretical limit +# works. Verify that the first and last R_CRIS_16_GOT_TPREL entries +# are ok, in a DSO. Beware, the order here is quite random, +# supposedly depending on symbol hashes. + +.*: file format elf32-cris + +DYNAMIC RELOCATION RECORDS +OFFSET TYPE VALUE +000b3870 R_CRIS_32_TPREL x2814 +#... +000b485c R_CRIS_32_TPREL x8188 +#... +000ba564 R_CRIS_32_TPREL x0 +#... +000bb860 R_CRIS_32_TPREL x1345 + +Contents of section .got: + b3864 ec370b00 00000000 00000000 00000000 .* + b3874 00000000 00000000 00000000 00000000 .* +#... + bb844 00000000 00000000 00000000 00000000 .* + bb854 00000000 00000000 00000000 00000000 .* diff --git a/binutils-2.24/ld/testsuite/ld-cris/tls-ok-36.d b/binutils-2.24/ld/testsuite/ld-cris/tls-ok-36.d new file mode 100644 index 0000000..fcfecb9 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/tls-ok-36.d @@ -0,0 +1,16 @@ +#source: start1.s +#source: tls-tprelm.s --defsym r=32767 +#as: --no-underscore --em=criself +#ld: -m crislinux +#objdump: -s -j .got -j .text -j .tdata + +# Check that a R_CRIS_16_TPREL just below the theoretical limit works. + +.*: file format elf32-cris + +Contents of section \.text: + 80094 41b20000 5fae0080 .* +Contents of section \.tdata: + 8209c 2a2a2a2a 2a2a2a2a 2a2a2a2a 2a2a2a2a .* +#... + 8a08c 2a2a2a2a 2a2a2a2a 2a2a2a2a 2a2a2a2a .* diff --git a/binutils-2.24/ld/testsuite/ld-cris/tls-tbss64.s b/binutils-2.24/ld/testsuite/ld-cris/tls-tbss64.s new file mode 100644 index 0000000..feb3d28 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/tls-tbss64.s @@ -0,0 +1,7 @@ + .global gx + .section .tbss,"awT",@nobits + .align 2 + .type gx, @object + .size gx, 64 +gx: + .zero 64 diff --git a/binutils-2.24/ld/testsuite/ld-cris/tls-tprelm.s b/binutils-2.24/ld/testsuite/ld-cris/tls-tprelm.s new file mode 100644 index 0000000..93fd671 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/tls-tprelm.s @@ -0,0 +1,26 @@ + .text + + .ifndef r + .set r,1 + .endif + + .global tlsfntprelm + .type tlsfntprelm,@function + .p2align 1 +tlsfntprelm: + move.w x:TPOFF16,$r10 +.Lfe: + .size tlsfntprelm,.Lfe-tlsfntprelm + + .section .tdata,"awT",@progbits + .p2align 2 + .type x,@object + .size x,1 +x: + .byte 42 + + .globl z + .type z,@object + .size z,r +z: + .fill r,1,42 diff --git a/binutils-2.24/ld/testsuite/ld-cris/tls-und-38.d b/binutils-2.24/ld/testsuite/ld-cris/tls-und-38.d new file mode 100644 index 0000000..7830672 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/tls-und-38.d @@ -0,0 +1,27 @@ +#source: tls-gd-2.s --pic +#as: --no-underscore --em=criself +#ld: -m crislinux --shared +#readelf: -a -x 7 + +# Undefined reference for a R_CRIS_32_GOT_GD in a DSO. Not an error; +# it's ok for a DSO to have undefined references upon creation for +# global symbols that can be overridden. Just make sure GOT, dynsyms +# and dynrelocs look right. + +#... +Relocation section '.rela.dyn' at offset 0x.* contains 1 entries: + Offset +Info +Type +Sym.Value +Sym. Name \+ Addend +000021ec +00000217 R_CRIS_DTP +00000000 +x \+ 0 + +The decoding of unwind sections for machine type Axis Communications 32-bit embedded processor is not currently supported. + +Symbol table '.dynsym' contains . entries: + +Num: +Value +Size +Type +Bind +Vis +Ndx +Name +#... + +[0-9]: 00000000 +0 +TLS +GLOBAL +DEFAULT +UND x +#... +Symbol table '.symtab' contains .. entries: +#... +Hex dump of section '.got': + 0x0+21e0 70210000 00000000 00000000 00000000 .* + 0x0+21f0 00000000 .* diff --git a/binutils-2.24/ld/testsuite/ld-cris/tls-und-42.d b/binutils-2.24/ld/testsuite/ld-cris/tls-und-42.d new file mode 100644 index 0000000..db45264 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/tls-und-42.d @@ -0,0 +1,26 @@ +#source: tls-ie-10.s --pic +#as: --no-underscore --em=criself +#ld: -m crislinux --shared +#readelf: -a -x 7 + +# Undefined reference for a R_CRIS_32_GOT_TPREL in a DSO. Not an +# error; it's ok for a DSO to have undefined references upon creation +# for global symbols that can be overridden. Just make sure GOT, +# dynsyms and dynrelocs look right. + +#... +Relocation section '.rela.dyn' at offset 0x.* contains 1 entries: + Offset +Info +Type +Sym.Value +Sym. Name \+ Addend +000021f4 +0000021c R_CRIS_32_TPREL +0+ +x \+ 0 + +The decoding of unwind sections for machine type Axis Communications 32-bit embedded processor is not currently supported. + +Symbol table '.dynsym' contains . entries: + +Num: +Value +Size +Type +Bind +Vis +Ndx +Name +#... + +[0-9]: 0+ +0 +TLS +GLOBAL +DEFAULT +UND x +#... +Symbol table '.symtab' contains .. entries: +#... +Hex dump of section '.got': + 0x0+21e8 70210000 00000000 00000000 00000000 .* diff --git a/binutils-2.24/ld/testsuite/ld-cris/tls-und-46.d b/binutils-2.24/ld/testsuite/ld-cris/tls-und-46.d new file mode 100644 index 0000000..92755d4 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/tls-und-46.d @@ -0,0 +1,27 @@ +#source: tls-gd-1.s --pic +#as: --no-underscore --em=criself +#ld: -m crislinux --shared +#readelf: -a -x 7 + +# Undefined reference for a R_CRIS_16_GOT_GD in a DSO. Not an error; +# it's ok for a DSO to have undefined references upon creation for +# global symbols that can be overridden. Just make sure GOT, dynsyms +# and dynrelocs look right. + +#... +Relocation section '.rela.dyn' at offset 0x.* contains 1 entries: + Offset +Info +Type +Sym.Value +Sym. Name \+ Addend +000021e8 +00000217 R_CRIS_DTP +00000000 +x \+ 0 + +The decoding of unwind sections for machine type Axis Communications 32-bit embedded processor is not currently supported. + +Symbol table '.dynsym' contains . entries: + +Num: +Value +Size +Type +Bind +Vis +Ndx +Name +#... + +[0-9]: 00000000 +0 +TLS +GLOBAL +DEFAULT +UND x +#... +Symbol table '.symtab' contains .. entries: +#... +Hex dump of section '.got': + 0x0+21dc 6c210000 00000000 00000000 00000000 .* + 0x0+21ec 00000000 .* diff --git a/binutils-2.24/ld/testsuite/ld-cris/tls-und-50.d b/binutils-2.24/ld/testsuite/ld-cris/tls-und-50.d new file mode 100644 index 0000000..6814aac --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/tls-und-50.d @@ -0,0 +1,26 @@ +#source: tls-ie-8.s --pic +#as: --no-underscore --em=criself +#ld: -m crislinux --shared +#readelf: -a -x 7 + +# Undefined reference for a R_CRIS_16_GOT_TPREL in a DSO. Not an +# error; it's ok for a DSO to have undefined references upon creation +# for global symbols that can be overridden. Just make sure GOT, +# dynsyms and dynrelocs look right. + +#... +Relocation section '.rela.dyn' at offset 0x.* contains 1 entries: + Offset +Info +Type +Sym.Value +Sym. Name \+ Addend +000021ec +0000021c R_CRIS_32_TPREL +0+ +x \+ 0 + +The decoding of unwind sections for machine type Axis Communications 32-bit embedded processor is not currently supported. + +Symbol table '.dynsym' contains . entries: + +Num: +Value +Size +Type +Bind +Vis +Ndx +Name +#... + +[0-9]: 00000000 +0 +TLS +GLOBAL +DEFAULT +UND x +#... +Symbol table '.symtab' contains .. entries: +#... +Hex dump of section '.got': + 0x0+21e0 68210000 00000000 00000000 00000000 .* diff --git a/binutils-2.24/ld/testsuite/ld-cris/tls-x.s b/binutils-2.24/ld/testsuite/ld-cris/tls-x.s new file mode 100644 index 0000000..504377a --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/tls-x.s @@ -0,0 +1,7 @@ + .globl x + .section .tdata,"awT",@progbits + .p2align 2 + .type x, @object + .size x, 4 +x: + .long 40 diff --git a/binutils-2.24/ld/testsuite/ld-cris/tls-x1x2.s b/binutils-2.24/ld/testsuite/ld-cris/tls-x1x2.s new file mode 100644 index 0000000..fd5d349 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/tls-x1x2.s @@ -0,0 +1,13 @@ + .globl x1 + .section .tdata,"awT",@progbits + .p2align 2 + .type x1, @object + .size x1, 4 +x1: + .long 41 + .globl x2 + .p2align 2 + .type x2, @object + .size x2, 4 +x2: + .long 42 diff --git a/binutils-2.24/ld/testsuite/ld-cris/tls-z.s b/binutils-2.24/ld/testsuite/ld-cris/tls-z.s new file mode 100644 index 0000000..25d97cd --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/tls-z.s @@ -0,0 +1,7 @@ + .globl z + .section .tdata,"awT",@progbits + .p2align 2 + .type z, @object + .size z, 4 +z: + .long 42 diff --git a/binutils-2.24/ld/testsuite/ld-cris/tls128.s b/binutils-2.24/ld/testsuite/ld-cris/tls128.s new file mode 100644 index 0000000..71d6b84 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/tls128.s @@ -0,0 +1,8 @@ +; Just something allocating 128 bytes TLS data. + .section .tdata,"awT",@progbits + .p2align 2 + .type tls128, @object +tls128: + .long 47 + .fill 124,1,0 + .size tls128, 128 diff --git a/binutils-2.24/ld/testsuite/ld-cris/tls128g.s b/binutils-2.24/ld/testsuite/ld-cris/tls128g.s new file mode 100644 index 0000000..766b7d9 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/tls128g.s @@ -0,0 +1,9 @@ +; Just something allocating 128 bytes TLS data, with the symbol being global. + .section .tdata,"awT",@progbits + .p2align 2 + .global tls128 + .type tls128, @object +tls128: + .long 47 + .fill 124,1,0 + .size tls128, 128 diff --git a/binutils-2.24/ld/testsuite/ld-cris/undef1.d b/binutils-2.24/ld/testsuite/ld-cris/undef1.d new file mode 100644 index 0000000..cec00cb --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/undef1.d @@ -0,0 +1,13 @@ +#source: dso-1.s +#source: gotrel1.s --pic +#as: --no-underscore --em=criself +#ld: -m crislinux tmpdir/libdso-4.so +#objdump: -T + +# The DSO used has an undef reference to the symbol "dsofn", which is +# supposed to cause the program to automatically export it as a dynamic +# symbol; no --export-dynamic is supposed to be needed. + +#... +[0-9a-f]+ g DF .text 0+2 dsofn +#pass diff --git a/binutils-2.24/ld/testsuite/ld-cris/undef2.d b/binutils-2.24/ld/testsuite/ld-cris/undef2.d new file mode 100644 index 0000000..46015c0 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/undef2.d @@ -0,0 +1,6 @@ +# source: start1.s +# source: stabs1.s +# target: cris-*-*elf* cris-*-*aout* +# as: --em=crisaout +# ld: -mcrisaout +# error: .o:/blah/foo.c:96: undefined reference to `globsym1'$ diff --git a/binutils-2.24/ld/testsuite/ld-cris/undef3.d b/binutils-2.24/ld/testsuite/ld-cris/undef3.d new file mode 100644 index 0000000..e7bca10 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/undef3.d @@ -0,0 +1,6 @@ +#source: start1.s +#source: stabs1.s +#target: cris-*-*elf* cris-*-*aout* +#as: --em=criself +#ld: -mcriself +#error: .o:/blah/foo.c:96: undefined reference to `globsym1'$ diff --git a/binutils-2.24/ld/testsuite/ld-cris/v10-v32.d b/binutils-2.24/ld/testsuite/ld-cris/v10-v32.d new file mode 100644 index 0000000..d692926 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/v10-v32.d @@ -0,0 +1,10 @@ +# notarget: cris*-*-linux-gnu +# source: start1.s --march=v32 +# source: move-1.s --march=v0_v10 +# as: --em=criself +# ld: -m criself +# error: contains non-CRIS-v32 code + +# Test that linking a (classic) v10 object to a v32 object does +# not work. Source code and "-m criself" doesn't work with *-linux-gnu. + diff --git a/binutils-2.24/ld/testsuite/ld-cris/v10-va.d b/binutils-2.24/ld/testsuite/ld-cris/v10-va.d new file mode 100644 index 0000000..c6db037 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/v10-va.d @@ -0,0 +1,14 @@ +# notarget: cris*-*-linux-gnu +# source: start1.s --march=common_v10_v32 +# source: move-1.s --march=v0_v10 +# as: --em=criself +# ld: -m criself +# objdump: -p + +# Test that linking a v10 compatible object to a v10+v32 object +# does work and results in the output marked as a v10 object. +# Source code and "-m criself" doesn't work with *-linux-gnu. + +#... +private flags = 1: \[symbols have a _ prefix\] +#pass diff --git a/binutils-2.24/ld/testsuite/ld-cris/v32-ba-1.d b/binutils-2.24/ld/testsuite/ld-cris/v32-ba-1.d new file mode 100644 index 0000000..b4ce78d --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/v32-ba-1.d @@ -0,0 +1,20 @@ +# notarget: cris*-*-linux-gnu +# as: --march=v32 --em=criself +# ld: -m criself +# objdump: -d + +# Check that 32-bit branches (PCREL:s) are relocated right. +# Source code and "-m criself" doesn't work with *-linux-gnu. + +.*: file format elf32-us-cris + +Disassembly of section \.text: + +0+ <(a|__Stext)>: + 0: bf0e 0800 0000 ba 8 <b> + 6: 5e82 moveq 30,r8 + +0+8 <b>: + 8: 4312 moveq 3,r1 + a: bf0e f6ff ffff ba 0 <[^>]*> + 10: 4db2 moveq 13,r11 diff --git a/binutils-2.24/ld/testsuite/ld-cris/v32-ba-1.s b/binutils-2.24/ld/testsuite/ld-cris/v32-ba-1.s new file mode 100644 index 0000000..189769e --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/v32-ba-1.s @@ -0,0 +1,11 @@ + .global a +a: + ba b + moveq 30,r8 + + .section .text.2,"ax" + .global b +b: + moveq 3,r1 + ba a + moveq 13,r11 diff --git a/binutils-2.24/ld/testsuite/ld-cris/v32-bin-1.d b/binutils-2.24/ld/testsuite/ld-cris/v32-bin-1.d new file mode 100644 index 0000000..3a8714b --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/v32-bin-1.d @@ -0,0 +1,13 @@ +#notarget: cris*-*-linux-gnu +#as: --em=criself --march=v32 +#ld: -m criself --oformat binary --defsym ext1=0x4000 --defsym ext2=0x6000 +#objdump: -s -b binary + +# Test that pcrel relocs work with --oformat binary. +# Source code and "-m criself" doesn't work with *-linux-gnu. + +.*: file format binary + +Contents of section \.data: + 0000 7f5d0020 0000bfbe fa7f0000 b0057f3d .* + 0010 f23f0000 bfbeec5f 0000b005 .* diff --git a/binutils-2.24/ld/testsuite/ld-cris/v32-bin-1.s b/binutils-2.24/ld/testsuite/ld-cris/v32-bin-1.s new file mode 100644 index 0000000..1f021d8 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/v32-bin-1.s @@ -0,0 +1,7 @@ +x: + lapc 0x2000,r5 + bsr 0x8000 + nop + lapc ext1,r3 + bsr ext2 + nop diff --git a/binutils-2.24/ld/testsuite/ld-cris/v32-v10.d b/binutils-2.24/ld/testsuite/ld-cris/v32-v10.d new file mode 100644 index 0000000..a96120f --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/v32-v10.d @@ -0,0 +1,10 @@ +# notarget: cris*-*-linux-gnu +# source: start1.s --march=v0_v10 +# source: move-1.s --march=v32 +# as: --em=criself +# ld: -m criself +# error: contains CRIS v32 code + +# Test that linking a v32 object to a (classic) v10 object does +# not work. +# Source code and "-m criself" doesn't work with *-linux-gnu. diff --git a/binutils-2.24/ld/testsuite/ld-cris/v32-va.d b/binutils-2.24/ld/testsuite/ld-cris/v32-va.d new file mode 100644 index 0000000..526d3c3 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/v32-va.d @@ -0,0 +1,14 @@ +# notarget: cris*-*-linux-gnu +# source: start1.s --march=common_v10_v32 +# source: move-1.s --march=v32 +# as: --em=criself +# ld: -m criself +# objdump: -p + +# Test that linking a v32 object to a v10+v32 object +# does work and results in the output marked as a v32 object. +# Source code and "-m criself" doesn't work with *-linux-gnu. + +#... +private flags = 3: \[symbols have a _ prefix\] \[v32\] +#pass diff --git a/binutils-2.24/ld/testsuite/ld-cris/va-v10.d b/binutils-2.24/ld/testsuite/ld-cris/va-v10.d new file mode 100644 index 0000000..d6bda58 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/va-v10.d @@ -0,0 +1,14 @@ +# notarget: cris*-*-linux-gnu +# source: start1.s --march=v0_v10 +# source: move-1.s --march=common_v10_v32 +# as: --em=criself +# ld: -m criself +# objdump: -p + +# Test that linking a v10+v32 compatible object to a v10 object +# does work and results in the output marked as a v10 object. +# Source code and "-m criself" doesn't work with *-linux-gnu. + +#... +private flags = 1: \[symbols have a _ prefix\] +#pass diff --git a/binutils-2.24/ld/testsuite/ld-cris/va-v32.d b/binutils-2.24/ld/testsuite/ld-cris/va-v32.d new file mode 100644 index 0000000..b598ff5 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/va-v32.d @@ -0,0 +1,14 @@ +# notarget: cris*-*-linux-gnu +# source: start1.s --march=v32 +# source: move-1.s --march=common_v10_v32 +# as: --em=criself +# ld: -m criself +# objdump: -p + +# Test that linking a v10+v32 compatible object to a v32 object +# does work and results in the output marked as a v32 object. +# Source code and "-m criself" doesn't work with *-linux-gnu. + +#... +private flags = 3: \[symbols have a _ prefix\] \[v32\] +#pass diff --git a/binutils-2.24/ld/testsuite/ld-cris/warn1.d b/binutils-2.24/ld/testsuite/ld-cris/warn1.d new file mode 100644 index 0000000..ecdf19e --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/warn1.d @@ -0,0 +1,11 @@ +#source: start1.s +#source: globsym1ref.s +#source: globsymw1.s +#target: cris-*-*elf* cris-*-*aout* +#as: --em=crisaout +#ld: -mcrisaout +#objdump: -p +# There should be no warning, since the symbol warned about is +# missing from the construct. +.*: file format a\.out-cris +#pass diff --git a/binutils-2.24/ld/testsuite/ld-cris/warn2.d b/binutils-2.24/ld/testsuite/ld-cris/warn2.d new file mode 100644 index 0000000..96f089e --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/warn2.d @@ -0,0 +1,11 @@ +#source: start1.s +#source: globsym1ref.s +#source: globsymw1.s +#target: cris-*-*elf* cris-*-*aout* +#as: --em=criself +#ld: -mcriself +#objdump: -p +# There should be no warning, since the symbol warned about is +# missing from the construct. +.*: file format elf32.*-cris +#pass diff --git a/binutils-2.24/ld/testsuite/ld-cris/warn3.d b/binutils-2.24/ld/testsuite/ld-cris/warn3.d new file mode 100644 index 0000000..c01b6cb --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/warn3.d @@ -0,0 +1,10 @@ +#source: start1.s +#source: globsym1ref.s +#source: globsymw2.s +#target: cris-*-*elf* cris-*-*aout* +#as: --em=crisaout +#ld: -mcrisaout +#warning: warning: isatty is not implemented and will always fail$ +#objdump: -p +.*: file format a\.out-cris +#pass diff --git a/binutils-2.24/ld/testsuite/ld-cris/warn4.d b/binutils-2.24/ld/testsuite/ld-cris/warn4.d new file mode 100644 index 0000000..dc096b6 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/warn4.d @@ -0,0 +1,13 @@ +#source: start1.s +#source: globsym1ref.s +#source: globsymw2.s +#target: cris-*-*elf* cris-*-*aout* +#as: --em=criself +#ld: -mcriself +#warning: warning: isatty is not implemented and will always fail$ +#objdump: -p +#xfail: *-*-* +# The test is xfailed because ELF stabs doesn't handle the stabs +# warning construct. +.*: file format elf32.*-cris +#pass diff --git a/binutils-2.24/ld/testsuite/ld-cris/weakhid.s b/binutils-2.24/ld/testsuite/ld-cris/weakhid.s new file mode 100644 index 0000000..e4c419f --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/weakhid.s @@ -0,0 +1,13 @@ + .weak xweakobj + .weak xweakhidobj + .hidden xweakhidobj + + .data + .global x + .type x,@object +x: + .dword xweakhidobj + .dword xweakobj + .dword xregobj +.Lfe1: + .size x,.Lfe1-x diff --git a/binutils-2.24/ld/testsuite/ld-cris/weakhiddso.d b/binutils-2.24/ld/testsuite/ld-cris/weakhiddso.d new file mode 100644 index 0000000..01940f7 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/weakhiddso.d @@ -0,0 +1,31 @@ +#source: weakhid.s +#as: --pic --no-underscore --em=criself +#ld: --shared -m crislinux -z nocombreloc +#objdump: -s -R -T + +# Check that .weak and .weak .hidden object references are handled +# correctly when generating a DSO. For now, we have to live with the +# R_CRIS_NONE entry. + +.*: file format elf32-cris + +DYNAMIC SYMBOL TABLE: +0+2214 l d \.data 0+ \.data +0+2214 g DO \.data 0+c x +0+ D \*UND\* 0+ xregobj +0+2220 g D \.data 0+ __bss_start +0+ w D \*UND\* 0+ xweakobj +0+2220 g D \.data 0+ _edata +0+2220 g D \.data 0+ _end + + +DYNAMIC RELOCATION RECORDS +OFFSET TYPE VALUE +0+ R_CRIS_NONE \*ABS\* +0+2218 R_CRIS_32 xweakobj +0+221c R_CRIS_32 xregobj + +Contents of section \.hash: +#... +Contents of section \.data: + 2214 00000000 00000000 00000000 .* diff --git a/binutils-2.24/ld/testsuite/ld-cris/weakref1.d b/binutils-2.24/ld/testsuite/ld-cris/weakref1.d new file mode 100644 index 0000000..6dab5e4 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/weakref1.d @@ -0,0 +1,17 @@ +#source: gotrel2.s +#as: --pic --no-underscore --em=criself +#ld: -m crislinux tmpdir/libdso-1.so +#objdump: -R + +# A dynamic reloc for an undefined weak reference in a program got a +# confused symbol reference count mismatch with a bfd assertion. Linking +# with a DSO was needed as a catalyst to get to the faulty code; nothing +# in the DSO was needed. We just check that we don't get the bfd +# assertion. Note that no actual dynamic reloc is created for the +# unresolved weak. Perhaps it should; the symbol could be defined in a +# preloaded object or a new version of the DSO. FIXME: Revisit and adjust +# test-result. + +.*: file format elf32-cris + +DYNAMIC RELOCATION RECORDS \(none\) diff --git a/binutils-2.24/ld/testsuite/ld-cris/weakref2.d b/binutils-2.24/ld/testsuite/ld-cris/weakref2.d new file mode 100644 index 0000000..b78ccca --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-cris/weakref2.d @@ -0,0 +1,10 @@ +#source: gotrel2.s +#as: --pic --no-underscore --em=criself +#ld: -m crislinux tmpdir/libdso-1.so +#objdump: -s -j .got + +# Like weakref1.d, but check contents of .got. + +.*: file format elf32-cris +Contents of section \.got: + 821e4 7c210800 00000000 00000000 00000000 .* diff --git a/binutils-2.24/ld/testsuite/ld-cris/weakref3.d b/binutils-2.24/ld/testsuite/ld-cris/weakref3.d new file mode 100644 index 0000000..aea3ad6 --- /dev/null +++ b/binutils-2.24/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-9a-f]* [0-9a-f]* 000010 .* +#... + +\[[0-9]+\] .bss +NOBITS +[0-9a-f]* [0-9a-f]* 000010 .* +#... +Relocation section '.rela.dyn' at offset 0x... contains 1 entries: + Offset +Info +Type +Sym.Value +Sym. Name \+ Addend +.* R_CRIS_COPY .* __expobj2 \+ 0 + +Relocation section '.rela.plt' at offset 0x... contains 1 entries: + Offset +Info +Type +Sym.Value +Sym. Name \+ Addend +.* R_CRIS_JUMP_SLOT .* expfn2 \+ 0 + +The decoding of unwind sections for machine type Axis Communications 32-bit embedded processor is not currently supported. + +Symbol table '.dynsym' contains . entries: +#... + +.: [0-9a-f]* +4 +OBJECT +GLOBAL +DEFAULT +13 __expobj2@TST3 \(2\) +#... + +.: [0-9a-f]* +0 +FUNC +GLOBAL +DEFAULT +UND expfn2@TST3 \(2\) +#... +Symbol table '.symtab' contains .. entries: +#... +Hex dump of section '\.text': + 0x000801f8 41b20000 6faed022 08006fae e4010800 .* diff --git a/binutils-2.24/ld/testsuite/ld-cris/weakref4.d b/binutils-2.24/ld/testsuite/ld-cris/weakref4.d new file mode 100644 index 0000000..79de291 --- /dev/null +++ b/binutils-2.24/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-9a-f]* [0-9a-f]* 000004 .* +#... + +\[[0-9]+\] .bss +NOBITS +[0-9a-f]* [0-9a-f]* 00000c .* +#... +Relocation section '.rela.dyn' at offset 0x... contains 1 entries: +#... +.* R_CRIS_COPY .* __expobj2 \+ 0 + +The decoding of unwind sections for machine type Axis Communications 32-bit embedded processor is not currently supported. + +Symbol table '.dynsym' contains . entries: +#... + +.: [0-9a-f]* +4 +OBJECT +GLOBAL +DEFAULT +12 __expobj2@TST3 \(2\) +#... +Symbol table '.symtab' contains .. entries: +#... +Hex dump of section '.data': + 0x00082250 54220800 .* + |