1 # Expect script for ld-powerpc tests
2 # Copyright 2002, 2003 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 if { ![istarget "powerpc*-*-*"] } {
23 # powerpc ELF only at the moment.
25 if { [istarget "*-*-macos*"] || [istarget "*-*-netware*"]
26 || [istarget "*-*-pe"] || [istarget "*-*-winnt*"]
27 || [istarget "*-*-cygwin*"] || [istarget "*-*-aix*"]
28 || [istarget "*-*-beos*"] } {
32 proc supports_ppc64 { } {
35 catch "exec $ld --help | grep emulations" tmp
36 if [ string match "*elf64ppc*" $tmp ] then {
43 # List contains test-items with 3 items followed by 2 lists:
44 # 0:name 1:ld options 2:assembler options
45 # 3:filenames of assembler files 4: action and options. 5: name of output file
48 # objdump: Apply objdump options on result. Compare with regex (last arg).
49 # nm: Apply nm options on result. Compare with regex (last arg).
50 # readelf: Apply readelf options on result. Compare with regex (last arg).
53 {"Reloc section order" "-melf32ppc -shared -z nocombreloc" "-a32" {reloc.s}
54 {{objdump -hw reloc.d}} "reloc.so"}
55 {"APUinfo section processing" "-melf32ppc"
56 "-a32 -me500" {apuinfo1.s apuinfo2.s}
57 {{readelf -x5 apuinfo.rd}} "apuinfo"}
58 {"TLS32 static exec" "-melf32ppc" "-a32" {tls32.s tlslib32.s}
59 {{objdump -dr tls32.d} {objdump -sj.got tls32.g}
60 {objdump -sj.tdata tls32.t}}
62 {"TLS32 helper shared library" "-shared -melf32ppc tmpdir/tlslib32.o" "" {}
64 {"TLS32 dynamic exec" "-melf32ppc tmpdir/tls32.o tmpdir/libtlslib32.so" "" {}
65 {{readelf -WSsrl tlsexe32.r} {objdump -dr tlsexe32.d}
66 {objdump -sj.got tlsexe32.g} {objdump -sj.tdata tlsexe32.t}}
68 {"TLS32 shared" "-shared -melf32ppc tmpdir/tls32.o" "" {}
69 {{readelf -WSsrl tlsso32.r} {objdump -dr tlsso32.d}
70 {objdump -sj.got tlsso32.g} {objdump -sj.tdata tlsso32.t}}
75 {"TLS static exec" "-melf64ppc" "-a64" {tls.s tlslib.s}
76 {{objdump -dr tls.d} {objdump -sj.got tls.g} {objdump -sj.tdata tls.t}}
78 {"TLS helper shared library" "-shared -melf64ppc tmpdir/tlslib.o" "" {}
80 {"TLS dynamic exec" "-melf64ppc tmpdir/tls.o tmpdir/libtlslib.so" "" {}
81 {{readelf -WSsrl tlsexe.r} {objdump -dr tlsexe.d}
82 {objdump -sj.got tlsexe.g} {objdump -sj.tdata tlsexe.t}}
84 {"TLS shared" "-shared -melf64ppc tmpdir/tls.o" "" {}
85 {{readelf -WSsrl tlsso.r} {objdump -dr tlsso.d}
86 {objdump -sj.got tlsso.g} {objdump -sj.tdata tlsso.t}}
88 {"TLSTOC static exec" "-melf64ppc tmpdir/tlslib.o " "-a64" {tlstoc.s}
89 {{objdump -dr tlstoc.d} {objdump -sj.toc tlstoc.g}
90 {objdump -sj.tdata tlstoc.t}}
92 {"TLSTOC dynamic exec" "-melf64ppc tmpdir/tlstoc.o tmpdir/libtlslib.so"
94 {{readelf -WSsrl tlsexetoc.r} {objdump -dr tlsexetoc.d}
95 {objdump -sj.toc tlsexetoc.g} {objdump -sj.tdata tlsexetoc.t}}
97 {"TLSTOC shared" "-shared -melf64ppc tmpdir/tlstoc.o" "" {}
98 {{readelf -WSsrl tlstocso.r} {objdump -dr tlstocso.d}
99 {objdump -sj.toc tlstocso.g} {objdump -sj.tdata tlstocso.t}}
104 run_ld_link_tests $ppcelftests
106 if [ supports_ppc64 ] then {
107 run_ld_link_tests $ppc64elftests