]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blame - ld/testsuite/ld-sparc/sparc.exp
* lib/ld-lib.exp: Comment cleanups.
[thirdparty/binutils-gdb.git] / ld / testsuite / ld-sparc / sparc.exp
CommitLineData
b9734f35 1# Expect script for ld-sparc tests
aef6203b 2# Copyright (C) 2002, 2003, 2005 Free Software Foundation
b9734f35
JJ
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.
b9734f35
JJ
17#
18
28f4cc59 19# Test SPARC linking; all types of relocs. This tests the assembler and
b9734f35
JJ
20# tools like objdump as well as the linker.
21
28f4cc59
EB
22if { !([istarget "sparc*-*-elf*"]
23 || [istarget "sparc*-sun-solaris*"]
b9734f35
JJ
24 || ([istarget "sparc*-*-linux*"]
25 && ![istarget "*-*-*aout*"]
26 && ![istarget "*-*-*oldld*"])) } {
27 return
28}
29
30# List contains test-items with 3 items followed by 2 lists:
31# 0:name 1:ld options 2:assembler options
32# 3:filenames of assembler files 4: action and options. 5: name of output file
33
34# Actions:
35# objdump: Apply objdump options on result. Compare with regex (last arg).
36# nm: Apply nm options on result. Compare with regex (last arg).
37# readelf: Apply readelf options on result. Compare with regex (last arg).
38
39set sparctests {
40937810 40 {"32-bit: TLS -fpic -shared transitions" "-shared -melf32_sparc"
b9734f35
JJ
41 "--32 -K PIC" {tlssunpic32.s tlspic.s}
42 {{readelf -WSsrl tlssunpic32.rd} {objdump -drj.text tlssunpic32.dd}
43 {objdump -sj.got tlssunpic32.sd} {objdump -sj.tdata tlssunpic32.td}}
44 "libtlssunpic32.so"}
40937810 45 {"32-bit: Helper shared library" "-shared -melf32_sparc"
b9734f35 46 "--32 -K PIC" {tlslib.s} {} "libtlslib32.so"}
40937810 47 {"32-bit: Another helper shared library" "-shared -melf32_sparc"
b9734f35 48 "--32 -K PIC" {tlssunbinpic32.s} {} "libtlssunbinpic32.so"}
40937810 49 {"32-bit: TLS -fpic and -fno-pic exec transitions"
b9734f35
JJ
50 "-melf32_sparc tmpdir/libtlslib32.so tmpdir/tlssunbinpic32.o"
51 "--32" {tlssunbin32.s}
52 {{readelf -WSsrl tlssunbin32.rd} {objdump -drj.text tlssunbin32.dd}
53 {objdump -sj.got tlssunbin32.sd} {objdump -sj.tdata tlssunbin32.td}}
54 "tlssunbin32"}
40937810 55 {"32-bit: TLS -fno-pic -shared" "-shared -melf32_sparc"
b9734f35
JJ
56 "--32" {tlssunnopic32.s tlsnopic.s}
57 {{readelf -WSsrl tlssunnopic32.rd} {objdump -drj.text tlssunnopic32.dd}
58 {objdump -sj.got tlssunnopic32.sd}} "libtlssunnopic32.so"}
40937810 59 {"32-bit: TLS in debug sections" "-melf32_sparc"
b9734f35
JJ
60 "--32" {tlsg32.s}
61 {{objdump -sj.debug_foobar tlsg32.sd}} "tlsg32"}
62}
63set sparc64tests {
40937810 64 {"64-bit: TLS -fpic -shared transitions" "-shared -melf64_sparc"
b9734f35
JJ
65 "--64 -Av9 -K PIC" {tlssunpic64.s tlspic.s}
66 {{readelf -WSsrl tlssunpic64.rd} {objdump -drj.text tlssunpic64.dd}
67 {objdump -sj.got tlssunpic64.sd} {objdump -sj.tdata tlssunpic64.td}}
68 "libtlssunpic64.so"}
40937810 69 {"64-bit: Helper shared library" "-shared -melf64_sparc"
b9734f35 70 "--64 -Av9 -K PIC" {tlslib.s} {} "libtlslib64.so"}
40937810 71 {"64-bit: Another helper shared library" "-shared -melf64_sparc"
b9734f35 72 "--64 -Av9 -K PIC" {tlssunbinpic64.s} {} "libtlssunbinpic64.so"}
40937810 73 {"64-bit: TLS -fpic and -fno-pic exec transitions"
b9734f35
JJ
74 "-melf64_sparc tmpdir/libtlslib64.so tmpdir/tlssunbinpic64.o"
75 "--64 -Av9" {tlssunbin64.s}
76 {{readelf -WSsrl tlssunbin64.rd} {objdump -drj.text tlssunbin64.dd}
77 {objdump -sj.got tlssunbin64.sd} {objdump -sj.tdata tlssunbin64.td}}
78 "tlssunbin64"}
40937810 79 {"64-bit: TLS -fno-pic -shared" "-shared -melf64_sparc"
b9734f35
JJ
80 "--64 -Av9" {tlssunnopic64.s tlsnopic.s}
81 {{readelf -WSsrl tlssunnopic64.rd} {objdump -drj.text tlssunnopic64.dd}
82 {objdump -sj.got tlssunnopic64.sd}} "libtlssunnopic64.so"}
40937810 83 {"64-bit: TLS in debug sections" "-melf64_sparc"
b9734f35
JJ
84 "--64 -Av9" {tlsg64.s}
85 {{objdump -sj.debug_foobar tlsg64.sd}} "tlsg64"}
86}
87
28f4cc59
EB
88if { ![istarget "sparc64-*-elf*"] } {
89 run_ld_link_tests $sparctests
90}
ca6d06e5
EB
91if { !([istarget "sparc-*-elf*"]
92 || [istarget "sparc-sun-solaris2.5*"]
93 || [istarget "sparc-sun-solaris2.6"]) } {
40937810
JJ
94 run_ld_link_tests $sparc64tests
95}