Update sources to GPLv3
[deliverable/binutils-gdb.git] / ld / testsuite / ld-i386 / i386.exp
CommitLineData
37e55690 1# Expect script for ld-i386 tests
f96b4a7b 2# Copyright (C) 2002, 2005, 2006, 2007 Free Software Foundation
37e55690 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
37e55690 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
37e55690
JJ
9# (at your option) any later version.
10#
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.
15#
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.
37e55690
JJ
20#
21
22# Test i386 linking; all types of relocs. This tests the assembler and
23# tools like objdump as well as the linker.
24
b9201bb3
RS
25if {[istarget "i?86-*-vxworks"]} {
26 set i386tests {
27 {"VxWorks shared library test 1" "-shared -Tvxworks1.ld"
28 "" {vxworks1-lib.s}
711de32c 29 {{readelf --relocs vxworks1-lib.rd} {objdump -dr vxworks1-lib.dd}
e68ed250 30 {readelf --symbols vxworks1-lib.nd} {readelf -d vxworks1-lib.td}}
b9201bb3 31 "libvxworks1.so"}
4f471f39
RS
32 {"VxWorks executable test 1 (dynamic)" \
33 "tmpdir/libvxworks1.so -Tvxworks1.ld -q --force-dynamic"
34 "" {vxworks1.s}
b9201bb3
RS
35 {{readelf --relocs vxworks1.rd} {objdump -dr vxworks1.dd}}
36 "vxworks1"}
4f471f39
RS
37 {"VxWorks executable test 2 (dynamic)" \
38 "-Tvxworks1.ld -q --force-dynamic"
39 "" {vxworks2.s}
40 {{readelf --segments vxworks2.sd}}
41 "vxworks2"}
42 {"VxWorks executable test 2 (static)"
43 "-Tvxworks1.ld"
44 "" {vxworks2.s}
45 {{readelf --segments vxworks2-static.sd}}
46 "vxworks2"}
b9201bb3
RS
47 }
48 run_ld_link_tests $i386tests
4f471f39 49 run_dump_test "vxworks1-static"
b9201bb3
RS
50}
51
c7749bd6
AM
52if { !([istarget "i?86-*-elf*"]
53 || ([istarget "i?86-*-linux*"]
54 && ![istarget "*-*-*aout*"]
67a4f2b7
AO
55 && ![istarget "*-*-*oldld*"])
56 || [istarget "x86_64-*-linux*"]
57 || [istarget "amd64-*-linux*"]) } {
37e55690
JJ
58 return
59}
60
37e55690
JJ
61# List contains test-items with 3 items followed by 2 lists:
62# 0:name 1:ld options 2:assembler options
63# 3:filenames of assembler files 4: action and options. 5: name of output file
64
65# Actions:
66# objdump: Apply objdump options on result. Compare with regex (last arg).
67# nm: Apply nm options on result. Compare with regex (last arg).
68# readelf: Apply readelf options on result. Compare with regex (last arg).
69
70set i386tests {
71 {"TLS -fpic -shared transitions" "-shared -melf_i386"
72 "--32" {tlspic1.s tlspic2.s}
73 {{readelf -Ssrl tlspic.rd} {objdump -drj.text tlspic.dd}
74 {objdump -sj.got tlspic.sd} {objdump -sj.tdata tlspic.td}}
75 "libtlspic.so"}
67a4f2b7
AO
76 {"TLS descriptor -fpic -shared transitions" "-shared -melf_i386"
77 "--32" {tlsdesc.s tlspic2.s}
78 {{readelf -Ssrl tlsdesc.rd} {objdump -drj.text tlsdesc.dd}
79 {objdump "-s -j.got -j.got.plt" tlsdesc.sd} {objdump -sj.tdata tlsdesc.td}}
80 "libtlsdesc.so"}
37e55690
JJ
81 {"Helper shared library" "-shared -melf_i386"
82 "--32" {tlslib.s} {} "libtlslib.so"}
83 {"TLS -fpic and -fno-pic exec transitions"
84 "-melf_i386 tmpdir/libtlslib.so" "--32" {tlsbinpic.s tlsbin.s}
85 {{readelf -Ssrl tlsbin.rd} {objdump -drj.text tlsbin.dd}
86 {objdump -sj.got tlsbin.sd} {objdump -sj.tdata tlsbin.td}}
87 "tlsbin"}
67a4f2b7
AO
88 {"TLS descriptor -fpic and -fno-pic exec transitions"
89 "-melf_i386 tmpdir/libtlslib.so" "--32" {tlsbindesc.s tlsbin.s}
90 {{readelf -Ssrl tlsbindesc.rd} {objdump -drj.text tlsbindesc.dd}
91 {objdump -sj.got tlsbindesc.sd} {objdump -sj.tdata tlsbindesc.td}}
92 "tlsbindesc"}
37e55690
JJ
93 {"TLS -fno-pic -shared" "-shared -melf_i386"
94 "--32" {tlsnopic1.s tlsnopic2.s}
95 {{readelf -Ssrl tlsnopic.rd} {objdump -drj.text tlsnopic.dd}
96 {objdump -sj.got tlsnopic.sd}} "libtlsnopic.so"}
67a4f2b7
AO
97 {"TLS with global dynamic and descriptors"
98 "-shared -melf_i386" "--32" {tlsgdesc.s}
99 {{readelf -Ssrl tlsgdesc.rd} {objdump -drj.text tlsgdesc.dd}}
100 "libtlsgdesc.so"}
a45bb67d
JJ
101 {"TLS in debug sections" "-melf_i386"
102 "--32" {tlsg.s}
103 {{objdump -sj.debug_foobar tlsg.sd}} "tlsg"}
7c445aa3
JJ
104 {"TLS @indntpoff with %eax" "-melf_i386" "--32" {tlsindntpoff.s}
105 {{objdump -drj.text tlsindntpoff.dd}} "tlsindntpoff"}
4565652e
AM
106 {"Reloc section order" "-shared -melf_i386 -z nocombreloc" "--32"
107 {reloc.s} {{objdump -hw reloc.d}} "reloc.so"}
5ae0bfb6
RS
108 {"Basic --emit-relocs support" "-shared -melf_i386 --emit-relocs" "--32"
109 {emit-relocs.s} {{readelf --relocs emit-relocs.d}} "emit-relocs.so"}
2030e6d7
JJ
110 {"-z combreloc relocation sections" "-shared -melf_i386 -z combreloc"
111 "--32" {combreloc.s} {{readelf -r combreloc.d}} "combreloc.so"}
37e55690
JJ
112}
113
37e55690 114run_ld_link_tests $i386tests
ac2aa337
JB
115
116run_dump_test "abs"
117run_dump_test "pcrel8"
118run_dump_test "pcrel16"
ab96bf03 119run_dump_test "pcrel16abs"
0920dee7 120run_dump_test "alloc"
9267588c 121run_dump_test "warn1"
This page took 0.224973 seconds and 4 git commands to generate.