fixed bash/dash/sh issue (Ubuntu)
[zpugcc/jano.git] / toolchain / binutils / ld / testsuite / ld-i386 / i386.exp
blob7f572da729a4ef242b00f214bb8ccebbc059e3f0
1 # Expect script for ld-i386 tests
2 # Copyright (C) 2002 Free Software Foundation
4 # This file is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; either version 2 of the License, or
7 # (at your option) any later version.
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19 # Test i386 linking; all types of relocs. This tests the assembler and
20 # tools like objdump as well as the linker.
22 if { !([istarget "i?86-*-elf*"]
23 || ([istarget "i?86-*-linux*"]
24 && ![istarget "*-*-*aout*"]
25 && ![istarget "*-*-*oldld*"])) } {
26 return
29 # List contains test-items with 3 items followed by 2 lists:
30 # 0:name 1:ld options 2:assembler options
31 # 3:filenames of assembler files 4: action and options. 5: name of output file
33 # Actions:
34 # objdump: Apply objdump options on result. Compare with regex (last arg).
35 # nm: Apply nm options on result. Compare with regex (last arg).
36 # readelf: Apply readelf options on result. Compare with regex (last arg).
38 set i386tests {
39 {"TLS -fpic -shared transitions" "-shared -melf_i386"
40 "--32" {tlspic1.s tlspic2.s}
41 {{readelf -Ssrl tlspic.rd} {objdump -drj.text tlspic.dd}
42 {objdump -sj.got tlspic.sd} {objdump -sj.tdata tlspic.td}}
43 "libtlspic.so"}
44 {"Helper shared library" "-shared -melf_i386"
45 "--32" {tlslib.s} {} "libtlslib.so"}
46 {"TLS -fpic and -fno-pic exec transitions"
47 "-melf_i386 tmpdir/libtlslib.so" "--32" {tlsbinpic.s tlsbin.s}
48 {{readelf -Ssrl tlsbin.rd} {objdump -drj.text tlsbin.dd}
49 {objdump -sj.got tlsbin.sd} {objdump -sj.tdata tlsbin.td}}
50 "tlsbin"}
51 {"TLS -fno-pic -shared" "-shared -melf_i386"
52 "--32" {tlsnopic1.s tlsnopic2.s}
53 {{readelf -Ssrl tlsnopic.rd} {objdump -drj.text tlsnopic.dd}
54 {objdump -sj.got tlsnopic.sd}} "libtlsnopic.so"}
55 {"TLS in debug sections" "-melf_i386"
56 "--32" {tlsg.s}
57 {{objdump -sj.debug_foobar tlsg.sd}} "tlsg"}
58 {"TLS @indntpoff with %eax" "-melf_i386" "--32" {tlsindntpoff.s}
59 {{objdump -drj.text tlsindntpoff.dd}} "tlsindntpoff"}
60 {"Reloc section order" "-shared -melf_i386 -z nocombreloc" "--32"
61 {reloc.s} {{objdump -hw reloc.d}} "reloc.so"}
62 {"-z combreloc relocation sections" "-shared -melf_i386 -z combreloc"
63 "--32" {combreloc.s} {{readelf -r combreloc.d}} "combreloc.so"}
66 run_ld_link_tests $i386tests