2006-03-13 Jim Blandy <jimb@codesourcery.com>
[deliverable/binutils-gdb.git] / ld / testsuite / ld-mips-elf / mips-elf.exp
CommitLineData
a657e7c1 1# Expect script for MIPS ELF linker tests
f4e584bd 2# Copyright 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
a657e7c1
CD
3#
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.
8#
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.
13#
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
75be928b 16# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
a657e7c1
CD
17#
18
fbf18a5c
TS
19if {![istarget mips*-*-*] || ![is_elf_format]} {
20 return
21}
30a2f863 22
fbf18a5c
TS
23set has_newabi [expr [istarget *-*-irix6*] || [istarget mips64*-*-linux*]]
24set linux_gnu [expr [istarget mips*-*-linux*]]
25set embedded_elf [expr [istarget mips*-*-elf]]
30a2f863 26
30a2f863 27
fbf18a5c
TS
28# Check MIPS16 markings being passed through link.
29run_dump_test "mips16-1"
8914585c 30
fbf18a5c
TS
31# MIPS branch offset final link checking.
32run_dump_test "branch-misc-1"
7d6c7577 33
732be173
DJ
34# Test multi-got link. We only do this on GNU/Linux because it requires
35# the "traditional" emulations.
36if { $linux_gnu } {
37 run_dump_test "multi-got-1"
bbe506e8 38 run_dump_test "multi-got-no-shared"
732be173 39}
30a2f863 40
fbf18a5c
TS
41if $has_newabi {
42 run_dump_test "elf-rel-got-n32"
43 run_dump_test "elf-rel-xgot-n32"
48fe7bda 44 if { $linux_gnu } {
fbf18a5c
TS
45 run_dump_test "elf-rel-got-n64-linux"
46 run_dump_test "elf-rel-xgot-n64-linux"
47 } else {
48 run_dump_test "elf-rel-got-n64"
49 run_dump_test "elf-rel-xgot-n64"
48fe7bda
AO
50 }
51
fbf18a5c
TS
52 run_dump_test "relax-jalr-n32"
53 run_dump_test "relax-jalr-n32-shared"
54 run_dump_test "relax-jalr-n64"
55 run_dump_test "relax-jalr-n64-shared"
56}
48fe7bda 57
fbf18a5c
TS
58if { $linux_gnu } {
59 run_dump_test "rel32-o32"
60 run_dump_test "rel32-n32"
61 run_dump_test "rel64"
62}
a657e7c1 63
fbf18a5c 64if { $embedded_elf } {
fbf18a5c 65 run_dump_test "region1"
a657e7c1 66}
18ab1921
RS
67
68if $embedded_elf {
69 # This could work on other targets too, but would need the appropriate
70 # ld -m switch.
71 run_dump_test "reloc-1-rel"
72}
73if $has_newabi {
74 run_dump_test "reloc-1-n32"
75 if $linux_gnu {
76 # Uses a linux-specific ld -m switch
77 run_dump_test "reloc-1-n64"
78 }
79}
80run_dump_test "reloc-2"
17a6716a 81run_dump_test "reloc-merge-lo16"
353057a5
RS
82if {$has_newabi && $linux_gnu} {
83 run_dump_test "eh-frame1-n32"
84 run_dump_test "eh-frame1-n64"
dcf507a6
RS
85 run_dump_test "eh-frame2-n32"
86 run_dump_test "eh-frame2-n64"
353057a5 87}
8c946ed5
RS
88if {$embedded_elf} {
89 run_dump_test "eh-frame3"
90 run_dump_test "eh-frame4"
91}
0efd4160
ILT
92
93run_dump_test "jaloverflow"
c314987d 94run_dump_test "jaloverflow-2"
1f0f3e9b
RS
95if {$has_newabi} {
96 run_dump_test "jalbal"
97}
d6f16593
MR
98
99run_dump_test "mips16-hilo"
100if {$has_newabi} {
101 run_dump_test "mips16-hilo-n32"
102}
f4e584bd 103
cc27e1dc
EC
104if { $linux_gnu } {
105 run_dump_test "textrel-1"
106}
107
f4e584bd
DJ
108# For tests which may involve multiple files, use run_ld_link_tests.
109
110# List contains test-items with 3 items followed by 2 lists:
111# 0:name 1:ld options 2:assembler options
112# 3:filenames of assembler files 4: action and options. 5: name of output file
113
114# Actions:
115# objdump: Apply objdump options on result. Compare with regex (last arg).
116# nm: Apply nm options on result. Compare with regex (last arg).
117# readelf: Apply readelf options on result. Compare with regex (last arg).
118
119set mips_tls_tests {
120 {"Static executable with TLS" "-static -melf32btsmip -T mips-dyn.ld"
121 "-EB -march=mips1 -32 -KPIC" {tlsbin-o32.s}
122 {{objdump {-dr -m mips:isa32r2} tlsbin-o32.d} {objdump -srj.got tlsbin-o32.got}}
123 "tls-static-o32"}
124 {"Shared library with TLS" "-shared -melf32btsmip -T mips-lib.ld"
125 "-EB -march=mips1 -32 -KPIC" {tlslib-o32.s}
126 {{objdump {-dr -m mips:isa32r2} tlslib-o32.d} {objdump -Rsj.got tlslib-o32.got}}
127 "tlslib-o32.so"}
128 {"Dynamic executable with TLS"
129 "-melf32btsmip -T mips-dyn.ld tmpdir/tlslib-o32.so"
130 "-EB -march=mips1 -32 -KPIC" {tlsdyn-o32.s}
131 {{objdump {-dr -m mips:isa32r2} tlsdyn-o32.d} {objdump -Rsj.got tlsdyn-o32.got}}
132 "tls-dynamic-o32"}
133 {"Shared library with multiple GOTs and TLS"
134 "-shared -melf32btsmip -T mips-lib.ld"
135 "-EB -march=mips1 -32 -KPIC" {tls-multi-got-1-1.s tls-multi-got-1-2.s}
136 {{readelf {-d -r} tls-multi-got-1.r}
137 {objdump {-dr -m mips:isa32r2} tls-multi-got-1.d}
138 {objdump -Rsj.got tls-multi-got-1.got}}
139 "tlslib-multi.so"}
140 {"Shared library with TLS and versioning"
141 "-shared -melf32btsmip -T mips-lib.ld --version-script tlslib.ver"
142 "-EB -march=mips1 -32 -KPIC" {tlslib-o32.s}
143 {{objdump {-dr -m mips:isa32r2} tlslib-o32.d} {objdump -Rsj.got tlslib-o32-ver.got}}
144 "tlslib-o32-ver.so"}
145 {"Dynamic executable with TLS and versioning"
146 "-melf32btsmip -T mips-dyn.ld tmpdir/tlslib-o32-ver.so"
147 "-EB -march=mips1 -32 -KPIC" {tlsdyn-o32.s tlsdyn-o32-2.s}
148 {{objdump {-dr -m mips:isa32r2} tlsdyn-o32-1.d} {objdump -Rsj.got tlsdyn-o32-1.got}}
149 "tls-dynamic-o32-ver"}
150 {"Dynamic executable with TLS and versioning (order 2)"
151 "-melf32btsmip -T mips-dyn.ld tmpdir/tlsdyn-o32.o tmpdir/tlslib-o32-ver.so tmpdir/tlsdyn-o32-2.o"
152 "-EB -march=mips1 -32 -KPIC" {}
153 {{objdump {-dr -m mips:isa32r2} tlsdyn-o32-2.d} {objdump -Rsj.got tlsdyn-o32-2.got}}
154 "tls-dynamic-o32-ver-2"}
155 {"Dynamic executable with TLS and versioning (order 3)"
156 "-melf32btsmip -T mips-dyn.ld tmpdir/tlsdyn-o32-2.o tmpdir/tlslib-o32-ver.so tmpdir/tlsdyn-o32.o"
157 "-EB -march=mips1 -32 -KPIC" {}
158 {{objdump {-dr -m mips:isa32r2} tlsdyn-o32-3.d} {objdump -Rsj.got tlsdyn-o32-3.got}}
159 "tls-dynamic-o32-ver-3"}
160 {"Shared library with TLS and hidden symbols"
161 "-shared -melf32btsmip -T mips-lib.ld --version-script tlslib-hidden.ver"
162 "-EB -march=mips1 -32 -KPIC" {tlslib-o32.s}
163 {{objdump {-dr -m mips:isa32r2} tlslib-o32.d} {objdump -Rsj.got tlslib-o32-hidden.got}}
164 "tlslib-o32-hidden.so"}
4005427f
RS
165 {"Shared library with TLS and hidden symbols (2)"
166 "-shared -melf32btsmip -T mips-lib.ld"
167 "-EB -march=mips1 -32 -KPIC" {tls-hidden2a.s tls-hidden2b.s}
168 {{objdump -drj.text tls-hidden2.d} {objdump -sj.got tls-hidden2-got.d}}
169 "tls-hidden2.so"}
f4e584bd
DJ
170}
171
172if {[istarget mips*-*-linux*]} {
173 run_ld_link_tests $mips_tls_tests
174}
175
This page took 0.261077 seconds and 4 git commands to generate.