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
,
22 if { ![istarget
"powerpc*-*-*"] } {
26 if {[istarget
"*-*-vxworks"]} {
28 {"VxWorks shared library test 1 (default script)" "-shared"
29 "-mregnames" {vxworks1-lib.s}
30 {{readelf
--segments vxworks1
-lib.sd
}}
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
}}
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
}}
42 {"VxWorks executable test 2 (dynamic)" \
43 "-Tvxworks1.ld -q --force-dynamic"
44 "-mregnames" {vxworks2.s}
45 {{readelf
--segments vxworks2.sd
}}
47 {"VxWorks executable test 2 (static)"
49 "-mregnames" {vxworks2.s}
50 {{readelf
--segments vxworks2
-static.sd
}}
53 "-Tvxworks1.ld --relax -q"
54 "-mregnames" {vxworks-relax.s}
55 {{readelf
--relocs vxworks
-relax.rd
}}
58 run_ld_link_tests $ppcvxtests
59 run_dump_test
"vxworks1-static"
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
67 if { [istarget
"*-*-macos*"] || [istarget "*-*-netware*"]
68 ||
[istarget
"*-*-pe"] || [istarget "*-*-winnt*"]
69 ||
[istarget
"*-*-cygwin*"] || [istarget "*-*-aix*"]
70 ||
[istarget
"*-*-beos*"] || [istarget "*-*-lynxos*"]
71 ||
[istarget
"*-*-nto*"] } {
75 proc supports_ppc64
{ } {
78 catch
"exec $ld --help | grep emulations" tmp
79 if [ string match
"*elf64ppc*" $tmp ] then {
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
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).
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
}}
105 {"TLS32 helper shared library" "-shared -melf32ppc tmpdir/tlslib32.o" "" {}
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
}}
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
}}
115 {"Shared library with global symbol" "-shared -melf32ppc" "-a32" {sdalib.s}
117 {"Dynamic application with SDA" "-melf32ppc tmpdir/sdalib.so" "-a32" {sdadyn.s}
118 {{objdump
-R sdadyn.d
}} "sdadyn"}
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
}}
125 {"TLS helper shared library" "-shared -melf64ppc tmpdir/tlslib.o" "" {}
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
}}
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
}}
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
}}
139 {"TLSTOC dynamic exec" "-melf64ppc tmpdir/tlstoc.o tmpdir/libtlslib.so"
141 {{readelf
-WSsrl tlsexetoc.r
} {objdump
-dr tlsexetoc.d
}
142 {objdump
-sj.got tlsexetoc.g
} {objdump
-sj.tdata tlsexetoc.t
}}
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
}}
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"
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"