Update contributors list for update of alpha-vms bfd.
[binutils.git] / ld / testsuite / ld-powerpc / powerpc.exp
blob1630cd71d74f93caf41fc8e4be7eba5b3d815d01
1 # Expect script for ld-powerpc tests
2 # Copyright 2002, 2003, 2005, 2006, 2007, 2008 Free Software Foundation
4 # This file is part of the GNU Binutils.
6 # This program is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 3 of the License, or
9 # (at your option) any later version.
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.
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
18 # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
19 # MA 02110-1301, USA.
22 if { ![istarget "powerpc*-*-*"] } {
23 return
26 if {[istarget "*-*-vxworks"]} {
27 set ppcvxtests {
28 {"VxWorks shared library test 1 (default script)" "-shared"
29 "-mregnames" {vxworks1-lib.s}
30 {{readelf --segments vxworks1-lib.sd}}
31 "libvxworks1.so"}
32 {"VxWorks shared library test 1" "-shared -Tvxworks1.ld"
33 "-mregnames" {vxworks1-lib.s}
34 {{readelf --relocs vxworks1-lib.rd} {objdump -dr vxworks1-lib.dd}
35 {readelf --symbols vxworks1-lib.nd} {readelf -d vxworks1-lib.td}}
36 "libvxworks1.so"}
37 {"VxWorks executable test 1 (dynamic)" \
38 "tmpdir/libvxworks1.so -Tvxworks1.ld -q --force-dynamic"
39 "-mregnames" {vxworks1.s}
40 {{readelf --relocs vxworks1.rd} {objdump -dr vxworks1.dd}}
41 "vxworks1"}
42 {"VxWorks executable test 2 (dynamic)" \
43 "-Tvxworks1.ld -q --force-dynamic"
44 "-mregnames" {vxworks2.s}
45 {{readelf --segments vxworks2.sd}}
46 "vxworks2"}
47 {"VxWorks executable test 2 (static)"
48 "-Tvxworks1.ld"
49 "-mregnames" {vxworks2.s}
50 {{readelf --segments vxworks2-static.sd}}
51 "vxworks2"}
52 {"VxWorks relax test"
53 "-Tvxworks1.ld --relax -q"
54 "-mregnames" {vxworks-relax.s}
55 {{readelf --relocs vxworks-relax.rd}}
56 "vxworks-relax"}
58 run_ld_link_tests $ppcvxtests
59 run_dump_test "vxworks1-static"
60 return
63 # powerpc ELF only at the moment. Disable for nto too, even though it
64 # is ELF, because we pass -melf32ppc to ld and powerpc-nto-ld wants
65 # -melf32ppcnto.
67 if { [istarget "*-*-macos*"] || [istarget "*-*-netware*"]
68 || [istarget "*-*-pe"] || [istarget "*-*-winnt*"]
69 || [istarget "*-*-cygwin*"] || [istarget "*-*-aix*"]
70 || [istarget "*-*-beos*"] || [istarget "*-*-lynxos*"]
71 || [istarget "*-*-nto*"] } {
72 return
75 proc supports_ppc64 { } {
76 global ld
78 catch "exec $ld --help | grep emulations" tmp
79 if [ string match "*elf64ppc*" $tmp ] then {
80 return 1
81 } else {
82 return 0
86 # List contains test-items with 3 items followed by 2 lists:
87 # 0:name 1:ld options 2:assembler options
88 # 3:filenames of assembler files 4: action and options. 5: name of output file
90 # Actions:
91 # objdump: Apply objdump options on result. Compare with regex (last arg).
92 # nm: Apply nm options on result. Compare with regex (last arg).
93 # readelf: Apply readelf options on result. Compare with regex (last arg).
95 set ppcelftests {
96 {"Reloc section order" "-melf32ppc -shared -z nocombreloc" "-a32" {reloc.s}
97 {{objdump -hw reloc.d}} "reloc.so"}
98 {"APUinfo section processing" "-melf32ppc"
99 "-a32 -me500" {apuinfo1.s apuinfo2.s}
100 {{readelf -x2 apuinfo.rd}} "apuinfo"}
101 {"TLS32 static exec" "-melf32ppc" "-a32" {tls32.s tlslib32.s}
102 {{objdump -dr tls32.d} {objdump -sj.got tls32.g}
103 {objdump -sj.tdata tls32.t}}
104 "tls32"}
105 {"TLS32 helper shared library" "-shared -melf32ppc tmpdir/tlslib32.o" "" {}
106 {} "libtlslib32.so"}
107 {"TLS32 dynamic exec" "-melf32ppc tmpdir/tls32.o tmpdir/libtlslib32.so" "" {}
108 {{readelf -WSsrl tlsexe32.r} {objdump -dr tlsexe32.d}
109 {objdump -sj.got tlsexe32.g} {objdump -sj.tdata tlsexe32.t}}
110 "tlsexe32"}
111 {"TLS32 shared" "-shared -melf32ppc tmpdir/tls32.o" "" {}
112 {{readelf -WSsrl tlsso32.r} {objdump -dr tlsso32.d}
113 {objdump -sj.got tlsso32.g} {objdump -sj.tdata tlsso32.t}}
114 "tls32.so"}
115 {"Shared library with global symbol" "-shared -melf32ppc" "-a32" {sdalib.s}
116 {} "sdalib.so"}
117 {"Dynamic application with SDA" "-melf32ppc tmpdir/sdalib.so" "-a32" {sdadyn.s}
118 {{objdump -R sdadyn.d}} "sdadyn"}
121 set ppc64elftests {
122 {"TLS static exec" "-melf64ppc" "-a64" {tls.s tlslib.s}
123 {{objdump -dr tls.d} {objdump -sj.got tls.g} {objdump -sj.tdata tls.t}}
124 "tls"}
125 {"TLS helper shared library" "-shared -melf64ppc tmpdir/tlslib.o" "" {}
126 {} "libtlslib.so"}
127 {"TLS dynamic exec" "-melf64ppc tmpdir/tls.o tmpdir/libtlslib.so" "" {}
128 {{readelf -WSsrl tlsexe.r} {objdump -dr tlsexe.d}
129 {objdump -sj.got tlsexe.g} {objdump -sj.tdata tlsexe.t}}
130 "tlsexe"}
131 {"TLS shared" "-shared -melf64ppc tmpdir/tls.o" "" {}
132 {{readelf -WSsrl tlsso.r} {objdump -dr tlsso.d}
133 {objdump -sj.got tlsso.g} {objdump -sj.tdata tlsso.t}}
134 "tls.so"}
135 {"TLSTOC static exec" "-melf64ppc tmpdir/tlslib.o " "-a64" {tlstoc.s}
136 {{objdump -dr tlstoc.d} {objdump -sj.got tlstoc.g}
137 {objdump -sj.tdata tlstoc.t}}
138 "tlstoc"}
139 {"TLSTOC dynamic exec" "-melf64ppc tmpdir/tlstoc.o tmpdir/libtlslib.so"
140 "" {}
141 {{readelf -WSsrl tlsexetoc.r} {objdump -dr tlsexetoc.d}
142 {objdump -sj.got tlsexetoc.g} {objdump -sj.tdata tlsexetoc.t}}
143 "tlsexetoc"}
144 {"TLSTOC shared" "-shared -melf64ppc tmpdir/tlstoc.o" "" {}
145 {{readelf -WSsrl tlstocso.r} {objdump -dr tlstocso.d}
146 {objdump -sj.got tlstocso.g} {objdump -sj.tdata tlstocso.t}}
147 "tlstoc.so"}
148 {"sym@tocbase" "-shared -melf64ppc" "-a64" {symtocbase-1.s symtocbase-2.s}
149 {{objdump -dj.data symtocbase.d}} "symtocbase.so"}
153 run_ld_link_tests $ppcelftests
155 if [ supports_ppc64 ] then {
156 run_ld_link_tests $ppc64elftests
157 run_dump_test "relbrlt"
160 run_dump_test "plt1"
162 run_dump_test "attr-gnu-4-00"
163 run_dump_test "attr-gnu-4-01"
164 run_dump_test "attr-gnu-4-02"
165 run_dump_test "attr-gnu-4-03"
166 run_dump_test "attr-gnu-4-10"
167 run_dump_test "attr-gnu-4-11"
168 run_dump_test "attr-gnu-4-12"
169 run_dump_test "attr-gnu-4-13"
170 run_dump_test "attr-gnu-4-14"
171 run_dump_test "attr-gnu-4-20"
172 run_dump_test "attr-gnu-4-21"
173 run_dump_test "attr-gnu-4-22"
174 run_dump_test "attr-gnu-4-23"
175 run_dump_test "attr-gnu-4-24"
176 run_dump_test "attr-gnu-4-31"
177 run_dump_test "attr-gnu-4-32"
178 run_dump_test "attr-gnu-4-33"
179 run_dump_test "attr-gnu-4-34"
180 run_dump_test "attr-gnu-4-41"
182 run_dump_test "attr-gnu-8-11"
183 run_dump_test "attr-gnu-8-23"
184 run_dump_test "attr-gnu-8-31"
186 run_dump_test "attr-gnu-12-11"
187 run_dump_test "attr-gnu-12-21"