Commit | Line | Data |
---|---|---|
7739e068 | 1 | # Expect script for run_dump_test based ld-sh tests. |
aa820537 | 2 | # Copyright 2001, 2002, 2003, 2005, 2006, 2007 Free Software Foundation, Inc. |
7739e068 | 3 | # |
f96b4a7b NC |
4 | # This file is part of the GNU Binutils. |
5 | # | |
6 | # This program is free software; you can redistribute it and/or modify | |
7739e068 | 7 | # it under the terms of the GNU General Public License as published by |
f96b4a7b | 8 | # the Free Software Foundation; either version 3 of the License, or |
7739e068 | 9 | # (at your option) any later version. |
f96b4a7b | 10 | # |
7739e068 HPN |
11 | # This program is distributed in the hope that it will be useful, |
12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
14 | # GNU General Public License for more details. | |
f96b4a7b | 15 | # |
7739e068 HPN |
16 | # You should have received a copy of the GNU General Public License |
17 | # along with this program; if not, write to the Free Software | |
f96b4a7b NC |
18 | # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, |
19 | # MA 02110-1301, USA. | |
7739e068 HPN |
20 | # |
21 | # Written by Hans-Peter Nilsson (hp@bitrange.com) | |
22 | # | |
23 | ||
24 | # This file is kept separate from sh.exp, because having it separate | |
25 | # simplifies selective testing, like in "make check-ld | |
26 | # RUNTESTFLAGS=rd-sh.exp=shared-1". It is assumed that sh.exp is a place | |
27 | # for constructs where the name of the test is harder to extract and | |
28 | # select than here. | |
29 | ||
30 | if ![istarget sh*-*-*] { | |
31 | return | |
32 | } | |
33 | ||
5e622545 | 34 | global ASFLAGS |
f19ae42f | 35 | global LDFLAGS |
5e622545 | 36 | set asflags_save "$ASFLAGS" |
f19ae42f | 37 | set ldflags_save "$LDFLAGS" |
5e622545 | 38 | |
935cac6e | 39 | if {[istarget sh64*-*-*] || [istarget sh5*-*-*]} then { |
935cac6e | 40 | set ASFLAGS "$ASFLAGS -isa=SHcompact" |
f19ae42f KK |
41 | if [istarget sh64*-*-linux*] { |
42 | set LDFLAGS "$LDFLAGS -mshlelf32_linux" | |
43 | } elseif { [istarget sh64*-*-netbsd*] || [istarget sh5*-*-netbsd*] } { | |
44 | set LDFLAGS "$LDFLAGS -mshlelf32_nbsd -e_start" | |
45 | } else { | |
46 | set LDFLAGS "$LDFLAGS -mshlelf32" | |
47 | } | |
935cac6e KK |
48 | } |
49 | ||
7739e068 HPN |
50 | set rd_test_list [lsort [glob -nocomplain $srcdir/$subdir/*.d]] |
51 | foreach shtest $rd_test_list { | |
52 | # We need to strip the ".d", but can leave the dirname. | |
53 | verbose [file rootname $shtest] | |
55e6e397 RS |
54 | # vxworks-static.d relies on files created by sh-vxworks.exp. |
55 | # We run it there instead of here. | |
56 | if { [file tail $shtest] != "vxworks1-static.d" } { | |
57 | run_dump_test [file rootname $shtest] | |
58 | } | |
6c381eeb KK |
59 | if [string match $srcdir/$subdir/*-dso.d $shtest] { |
60 | # Copy the output of the DSO-createing test to .so file. | |
61 | # Notice that a DSO-creating test must preceed the tests | |
62 | # which need that DSO in sort-order by name. | |
63 | set cmd "cp tmpdir/dump tmpdir/[file rootname [file tail $shtest]].so" | |
64 | send_log "$cmd\n" | |
65 | set cmdret [catch "exec $cmd" comp_output] | |
66 | send_log "$comp_output\n" | |
67 | # FIXME: What if it fails? Need we do something? | |
68 | } | |
7739e068 | 69 | } |
935cac6e | 70 | set ASFLAGS "$asflags_save" |
f19ae42f | 71 | set LDFLAGS "$ldflags_save" |