]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blame - ld/testsuite/ld-powerpc/powerpc.exp
Import from the GCC tree:
[thirdparty/binutils-gdb.git] / ld / testsuite / ld-powerpc / powerpc.exp
CommitLineData
17c2bdee 1# Expect script for ld-powerpc tests
b38b1562 2# Copyright 2002, 2003, 2005 Free Software Foundation
17c2bdee
AM
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.
17c2bdee
AM
17#
18
19if { ![istarget "powerpc*-*-*"] } {
20 return
21}
22
266fb683 23# powerpc ELF only at the moment.
17c2bdee
AM
24
25if { [istarget "*-*-macos*"] || [istarget "*-*-netware*"]
26 || [istarget "*-*-pe"] || [istarget "*-*-winnt*"]
27 || [istarget "*-*-cygwin*"] || [istarget "*-*-aix*"]
266fb683 28 || [istarget "*-*-beos*"] } {
17c2bdee
AM
29 return
30}
31
266fb683
AM
32proc supports_ppc64 { } {
33 global ld
34
35 catch "exec $ld --help | grep emulations" tmp
36 if [ string match "*elf64ppc*" $tmp ] then {
37 return 1
38 } else {
39 return 0
40 }
41}
42
17c2bdee
AM
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
46
47# Actions:
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).
51
52set ppcelftests {
266fb683 53 {"Reloc section order" "-melf32ppc -shared -z nocombreloc" "-a32" {reloc.s}
17c2bdee 54 {{objdump -hw reloc.d}} "reloc.so"}
266fb683
AM
55 {"APUinfo section processing" "-melf32ppc"
56 "-a32 -me500" {apuinfo1.s apuinfo2.s}
57316bff 57 {{readelf -x2 apuinfo.rd}} "apuinfo"}
2a050fb5
AM
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}}
61 "tls32"}
62 {"TLS32 helper shared library" "-shared -melf32ppc tmpdir/tlslib32.o" "" {}
63 {} "libtlslib32.so"}
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}}
67 "tlsexe32"}
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}}
71 "tls32.so"}
b38b1562 72 {"Shared library with global symbol" "-shared -melf32ppc" "-a32" {sdalib.s}
4dc4a9a5 73 {} "sdalib.so"}
b38b1562 74 {"Dynamic application with SDA" "-melf32ppc tmpdir/sdalib.so" "-a32" {sdadyn.s}
4dc4a9a5 75 {{objdump -R sdadyn.d}} "sdadyn"}
17c2bdee
AM
76}
77
266fb683
AM
78set ppc64elftests {
79 {"TLS static exec" "-melf64ppc" "-a64" {tls.s tlslib.s}
80 {{objdump -dr tls.d} {objdump -sj.got tls.g} {objdump -sj.tdata tls.t}}
81 "tls"}
82 {"TLS helper shared library" "-shared -melf64ppc tmpdir/tlslib.o" "" {}
83 {} "libtlslib.so"}
84 {"TLS dynamic exec" "-melf64ppc tmpdir/tls.o tmpdir/libtlslib.so" "" {}
85 {{readelf -WSsrl tlsexe.r} {objdump -dr tlsexe.d}
86 {objdump -sj.got tlsexe.g} {objdump -sj.tdata tlsexe.t}}
87 "tlsexe"}
88 {"TLS shared" "-shared -melf64ppc tmpdir/tls.o" "" {}
89 {{readelf -WSsrl tlsso.r} {objdump -dr tlsso.d}
90 {objdump -sj.got tlsso.g} {objdump -sj.tdata tlsso.t}}
91 "tls.so"}
92 {"TLSTOC static exec" "-melf64ppc tmpdir/tlslib.o " "-a64" {tlstoc.s}
1c0bd72e 93 {{objdump -dr tlstoc.d} {objdump -sj.got tlstoc.g}
266fb683
AM
94 {objdump -sj.tdata tlstoc.t}}
95 "tlstoc"}
96 {"TLSTOC dynamic exec" "-melf64ppc tmpdir/tlstoc.o tmpdir/libtlslib.so"
97 "" {}
98 {{readelf -WSsrl tlsexetoc.r} {objdump -dr tlsexetoc.d}
1c0bd72e 99 {objdump -sj.got tlsexetoc.g} {objdump -sj.tdata tlsexetoc.t}}
266fb683
AM
100 "tlsexetoc"}
101 {"TLSTOC shared" "-shared -melf64ppc tmpdir/tlstoc.o" "" {}
102 {{readelf -WSsrl tlstocso.r} {objdump -dr tlstocso.d}
1c0bd72e 103 {objdump -sj.got tlstocso.g} {objdump -sj.tdata tlstocso.t}}
266fb683 104 "tlstoc.so"}
08f46626
AO
105 {"sym@tocbase" "-shared -melf64ppc" "-a64" {symtocbase-1.s symtocbase-2.s}
106 {{objdump -dj.data symtocbase.d}} "symtocbase.so"}
266fb683
AM
107}
108
109
17c2bdee 110run_ld_link_tests $ppcelftests
266fb683
AM
111
112if [ supports_ppc64 ] then {
113 run_ld_link_tests $ppc64elftests
114}