Tolerate some whitespace differences in readelf output.
[deliverable/binutils-gdb.git] / ld / testsuite / ld-sh / sh64 / sh64.exp
CommitLineData
1b19eb81 1# Expect script for ld-sh tests
aa820537 2# Copyright (C) 2000, 2001, 2002, 2003, 2005, 2007 Free Software Foundation
1b19eb81 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
1b19eb81 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
1b19eb81 9# (at your option) any later version.
3e8cba19 10#
1b19eb81
AO
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.
3e8cba19 15#
1b19eb81
AO
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.
1b19eb81
AO
20#
21
22# Test SH linking; all types of relocs. This tests the assembler and
23# tools like objdump as well as the linker.
24
25if ![istarget sh64-*-*] {
26 return
27}
28
24d1feef
SC
29if [istarget sh64*-*-linux*] {
30 return
31}
32
f19ae42f
KK
33if { [istarget sh64*-*-netbsd*] || [istarget sh5*-*-netbsd*] } then {
34 return
35}
36
1b19eb81
AO
37# List contains test-items with 3 items followed by 2 lists:
38# 0:name 1:ld options 2:assembler options
bffbf940 39# 3:filenames of assembler files 4: action and options. 5: name of output file
1b19eb81
AO
40
41# Actions:
42# objdump: Apply objdump options on result. Compare with regex (last arg).
43# nm: Apply nm options on result. Compare with regex (last arg).
bffbf940 44# readelf: Apply readelf options on result. Compare with regex (last arg).
1b19eb81
AO
45
46# Note that the contents dump is the same for "inter-file datalabel
47# references, 64-bit ABI" as for 32-bit ABI and ELF so we re-use it.
48
49set sh64tests {
50 {"SH64 linking, 64-bit ABI" "-mshelf64"
51 "--abi=64" {sh64-1.s sh64-2.s}
bffbf940 52 {{objdump -sr abi64.sd} {objdump -x abi64.xd}} "abi64.bin" }
1b19eb81
AO
53 {"SH64 linking, 64-bit ABI, -no-expand" "-mshelf64"
54 "--abi=64 -no-expand" {sh64-1.s sh64-2.s}
bffbf940 55 {{objdump -sr abixx-noexp.sd}} "abi64-noexp.bin" }
1b19eb81
AO
56 {"SH64 linking, 32-bit ABI" "-mshelf32"
57 "--abi=32" {sh64-1.s sh64-2.s}
bffbf940 58 {{objdump -sr abi32.sd} {objdump -x abi32.xd}} "abi32.bin" }
1b19eb81
AO
59 {"SH64 linking, 32-bit ABI, -no-expand" "-mshelf32"
60 "--abi=32 -no-expand" {sh64-1.s sh64-2.s}
bffbf940 61 {{objdump -sr abixx-noexp.sd}} "abi32-noexp.bin" }
1b19eb81
AO
62 {"SH64 linking, single multi-ISA object" "-mshelf32"
63 "--abi=32" {shmix-1.s}
bffbf940 64 {{objdump -sr mix1.sd} {objdump -x mix1.xd}} "mix1.bin" }
1b19eb81
AO
65 {"SH64 linking, single multi-ISA object, -no-expand" "-mshelf32"
66 "--abi=32 -no-expand" {shmix-1.s}
bffbf940 67 {{objdump -sr mix1-noexp.sd}} "mix1-noexp.bin" }
1b19eb81
AO
68 {"SH64 linking, two different-ISA objects" "-mshelf32"
69 "--abi=32" {shmix-2.s shmix-3.s}
bffbf940 70 {{objdump -sr mix2.sd} {objdump -x mix2.xd}} "mix2.bin" }
1b19eb81
AO
71 {"SH64 linking, two different-ISA objects, -no-expand" "-mshelf32"
72 "--abi=32 -no-expand" {shmix-2.s shmix-3.s}
bffbf940 73 {{objdump -sr mix2-noexp.sd}} "mix2-noexp.bin" }
1b19eb81
AO
74 {"SH64 linking, single SHcompact" "-mshelf32"
75 "--isa=SHcompact" {shcmp-1.s}
bffbf940 76 {{objdump -sr cmpct1.sd} {objdump -x cmpct1.xd}} "cmpct1.bin" }
1b19eb81
AO
77 {"SH64 inter-file datalabel references, 64-bit ABI" "-mshelf64"
78 "--abi=64" {shdl-1.s shdl-2.s}
bffbf940 79 {{objdump -sr shdl64.sd} {objdump -x shdl64.xd}} "shdl64.bin" }
1b19eb81
AO
80 {"SH64 inter-file datalabel references, 32-bit ABI" "-mshelf32"
81 "--abi=32" {shdl-1.s shdl-2.s}
bffbf940 82 {{objdump -sr shdl64.sd} {objdump -x shdl32.xd}} "shdl32.bin" }
0b65791f
SC
83 {"SH64 inter-file datalabel references and gc-sections, 32-bit ABI" "-mshelf32 --gc-sections"
84 "--abi=32" {dlsection-1.s }
bffbf940 85 {{objdump -sr dlsection.sd}} "dlsection32.bin" }
0b65791f
SC
86 {"SH64 inter-file datalabel references and gc-sections, 64-bit ABI" "-mshelf64 --gc-sections"
87 "--abi=64" {dlsection-1.s }
bffbf940 88 {{objdump -sr dlsection.sd}} "dlsection64.bin" }
1b19eb81
AO
89 {"SH64 simple partial linking, 32-bit ABI" "-mshelf32 -r"
90 "--abi=32" {rel-1.s rel-2.s}
bffbf940 91 {{objdump -sx rel32.xd}} "rel32.bin" }
1b19eb81
AO
92 {"SH64 simple partial linking, 64-bit ABI" "-mshelf64 -r"
93 "--abi=64" {rel-1.s rel-2.s}
bffbf940 94 {{objdump -sx rel64.xd}} "rel64.bin" }
1b19eb81
AO
95 {"SH64 partial linking with datalabel references, 32-bit ABI" "-mshelf32 -r"
96 "--abi=32" {reldl-1.s reldl-2.s}
bffbf940 97 {{readelf {-s -r -x 1 -x 3} reldl32.rd}} "reldl32.bin" }
1b19eb81
AO
98 {"SH64 partial linking with datalabel references, 64-bit ABI" "-mshelf64 -r"
99 "--abi=64" {reldl-1.s reldl-2.s}
bffbf940 100 {{readelf {-s -r -x 1 -x 3} reldl64.rd}} "reldl64.bin" }
1b19eb81
AO
101 {"Handling SH64 assembler-generated .cranges" "-mshelf32"
102 "--abi=32" {crange-2a.s crange-1.s}
85167a84 103 {{readelf {-S -s -r -x 1 -x 2 -x 4} crange1.rd}} "crange1.bin" }
1b19eb81
AO
104 {"Handling SH64 assembler-generated .cranges, partial linking" "-mshelf32 -r"
105 "--abi=32" {crange-2a.s}
f19ae42f 106 {{readelf {-S -s -r -x 2 -x 6} crangerel1.rd}} "crangerel1.bin" }
1b19eb81
AO
107 {"Mixing SH64 assembler-generated with linker-generated .cranges" "-mshelf32"
108 "--abi=32" {crange-2a.s crange-2b.s crange-1.s}
85167a84 109 {{readelf {-S -s -r -x 2 -x 4} crange2.rd}} "crange2.bin" }
1b19eb81
AO
110 {"Mixing SH64 assembler-generated with linker-generated .cranges, partial linking"
111 "-mshelf32 -r"
112 "--abi=32" {crange-2a.s crange-2c.s crange-2d.s crange-2e.s}
f19ae42f 113 {{readelf {-S -s -r -x 2 -x 6} crangerel2.rd}} "crangerel2.bin" }
1b19eb81
AO
114 {"Merge and use of SH64 .cranges, some not originally in order" "-mshelf32"
115 "--abi=32"
116 {crange-2e.s crange-2f.s crange-2g.s crange-2a.s crange-2d.s crange-2i.s
117 crange-2h.s crange-1.s}
85167a84 118 {{readelf {-S -s -x 2 -x 4} crange3.rd} {objdump -d crange3.dd}} "crange3.bin" }
1b19eb81
AO
119 {"Sorted SH64 .cranges, entry at SHcompact code" "-mshelf32 --entry diversion"
120 "--abi=32"
121 {crange-2e.s crange-2f.s crange-2g.s crange-2a.s crange-2d.s crange-2i.s
122 crange-2h.s crange-1.s}
85167a84 123 {{readelf {-h -S -s -x 2 -x 4} crange3-cmpct.rd}} "crange3-cmpct.bin" }
1b19eb81
AO
124 {"Sorted SH64 .cranges, entry at SHmedia code" "-mshelf32 --entry diversion2"
125 "--abi=32"
126 {crange-2e.s crange-2f.s crange-2g.s crange-2a.s crange-2d.s crange-2i.s
127 crange-2h.s crange-1.s}
85167a84 128 {{readelf {-h -S -s -x 2 -x 4} crange3-media.rd}} "crange3-media.bin" }
1b19eb81
AO
129 {"SH64 Big Endianness" "-mshelf64 -Tendian.ld"
130 "--abi=64" {endian.s}
bffbf940 131 {{objdump -s endian.sbd} {objdump -d endian.dbd}} "endianb.bin" }
1b19eb81
AO
132 {"SH64 Little Endianness" "-mshlelf64 -Tendian.ld"
133 "--abi=64 --little" {endian.s}
bffbf940 134 {{objdump -s endian.sld} {objdump -d endian.dld}} "endinanl.bin" }
1b19eb81
AO
135}
136
137run_ld_link_tests $sh64tests
This page took 0.320161 seconds and 4 git commands to generate.