* elf32-spu.c (build_stub): Fix malloc under-allocation.
[binutils.git] / ld / testsuite / ld-versados / versados.exp
blob422fd4a507fb9be81a00e22cf53f4c6b97d013ac
1 # Expect script for ld-versados tests
2 # Copyright 1995, 1997, 2005, 2007 Free Software Foundation, Inc.
4 # This file is part of the GNU Binutils.
6 # This program is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 3 of the License, or
9 # (at your option) any later version.
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.
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
18 # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
19 # MA 02110-1301, USA.
21 # Written by Steve Chamberlain (sac@cygnus.com)
24 # Make sure that ld can read versados images and
25 # generate binaries which are identical to the customer's
26 # old method.
28 # This test can only be run if ld generates native executables.
30 # This test can only be run on 68k coff targets
31 # Square bracket expressions seem to confuse istarget.
32 if { ![istarget m68k-*-coff*] } then {
33 return
36 set testname "LD VERSADOS"
39 proc inspect { whichone } {
40 global objdump
41 global exec_output
42 global srcdir
43 global subdir
44 global testname
46 send_log "$objdump -s tmpdir/$whichone.out >tmpdir/$whichone.dump\n"
47 catch "exec $objdump -s tmpdir/$whichone.out | grep -v srec >tmpdir/$whichone.dump" exec_output
49 if ![string match "" $exec_output] {
50 send_log "$exec_output\n"
51 verbose $exec_output
52 unresolved $testname
53 return 0
56 send_log "$objdump -s $srcdir/$subdir/$whichone.ook >tmpdir/$whichone.dok\n"
57 catch "exec $objdump -s $srcdir/$subdir/$whichone.ook | grep -v srec >tmpdir/$whichone.dok" exec_output
59 if ![string match "" $exec_output] {
60 send_log "$exec_output\n"
61 verbose $exec_output
62 unresolved $testname
63 return 0
66 # compare it with the correct output
67 catch "exec diff tmpdir/$whichone.dump tmpdir/$whichone.dok" exec_output
68 if ![string match "" $exec_output] {
69 send_log "$exec_output\n"
70 verbose $exec_output
71 fail $testname
72 return 0
75 return 1
78 if ![ld_simple_link $ld tmpdir/t1.out \
79 " -T $srcdir/$subdir/t1.ld $srcdir/$subdir/t1-1.ro $srcdir/$subdir/t1-2.ro"] {
80 fail $testname
81 return
82 } else {
83 # Get a dump of what we've got, and what we should have
84 if ![inspect t1] {
85 return
90 if ![ld_simple_link $ld tmpdir/t2.out \
91 " -T $srcdir/$subdir/t2.ld $srcdir/$subdir/t2-2.ro \
92 $srcdir/$subdir/t2-1.ro $srcdir/$subdir/t2-3.ro"] {
93 fail $testname
94 return
95 } else {
96 # Get a dump of what we've got, and what we should have
97 if ![inspect t2] {
98 return
102 pass $testname