1 # Expect script
for ld-powerpc tests
2 # Copyright
2002, 2003, 2005 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.
, 51 Franklin Street
- Fifth Floor
, Boston
, MA
02110-1301, USA.
19 if { ![istarget
"powerpc*-*-*"] } {
23 if {[istarget
"*-*-vxworks"]} {
25 {"VxWorks shared library test 1 (default script)" "-shared"
26 "-mregnames" {vxworks1-lib.s}
27 {{readelf
--segments vxworks1
-lib.sd
}}
29 {"VxWorks shared library test 1" "-shared -Tvxworks1.ld"
30 "-mregnames" {vxworks1-lib.s}
31 {{readelf
--relocs vxworks1
-lib.rd
} {objdump
-dr vxworks1
-lib.dd
}
32 {readelf
--symbols vxworks1
-lib.nd
}}
34 {"VxWorks executable test 1 (dynamic)" \
35 "tmpdir/libvxworks1.so -Tvxworks1.ld -q --force-dynamic"
36 "-mregnames" {vxworks1.s}
37 {{readelf
--relocs vxworks1.rd
} {objdump
-dr vxworks1.dd
}}
39 {"VxWorks executable test 2 (dynamic)" \
40 "-Tvxworks1.ld -q --force-dynamic"
41 "-mregnames" {vxworks2.s}
42 {{readelf
--segments vxworks2.sd
}}
44 {"VxWorks executable test 2 (static)"
46 "-mregnames" {vxworks2.s}
47 {{readelf
--segments vxworks2
-static.sd
}}
50 run_ld_link_tests $ppcvxtests
51 run_dump_test
"vxworks1-static"
55 # powerpc ELF only at the moment.
57 if { [istarget
"*-*-macos*"] || [istarget "*-*-netware*"]
58 ||
[istarget
"*-*-pe"] || [istarget "*-*-winnt*"]
59 ||
[istarget
"*-*-cygwin*"] || [istarget "*-*-aix*"]
60 ||
[istarget
"*-*-beos*"] } {
64 proc supports_ppc64
{ } {
67 catch
"exec $ld --help | grep emulations" tmp
68 if [ string match
"*elf64ppc*" $tmp ] then {
75 # List contains test
-items with
3 items followed by
2 lists
:
76 #
0:name 1:ld options
2:assembler options
77 #
3:filenames of assembler files
4: action and options.
5: name of output file
80 # objdump
: Apply objdump options
on result. Compare with regex
(last
arg).
81 # nm
: Apply nm options
on result. Compare with regex
(last
arg).
82 # readelf
: Apply readelf options
on result. Compare with regex
(last
arg).
85 {"Reloc section order" "-melf32ppc -shared -z nocombreloc" "-a32" {reloc.s}
86 {{objdump
-hw reloc.d
}} "reloc.so"}
87 {"APUinfo section processing" "-melf32ppc"
88 "-a32 -me500" {apuinfo1.s apuinfo2.s}
89 {{readelf
-x2 apuinfo.rd
}} "apuinfo"}
90 {"TLS32 static exec" "-melf32ppc" "-a32" {tls32.s tlslib32.s}
91 {{objdump
-dr tls32.d
} {objdump
-sj.got tls32.g
}
92 {objdump
-sj.tdata tls32.t
}}
94 {"TLS32 helper shared library" "-shared -melf32ppc tmpdir/tlslib32.o" "" {}
96 {"TLS32 dynamic exec" "-melf32ppc tmpdir/tls32.o tmpdir/libtlslib32.so" "" {}
97 {{readelf
-WSsrl tlsexe32.r
} {objdump
-dr tlsexe32.d
}
98 {objdump
-sj.got tlsexe32.g
} {objdump
-sj.tdata tlsexe32.t
}}
100 {"TLS32 shared" "-shared -melf32ppc tmpdir/tls32.o" "" {}
101 {{readelf
-WSsrl tlsso32.r
} {objdump
-dr tlsso32.d
}
102 {objdump
-sj.got tlsso32.g
} {objdump
-sj.tdata tlsso32.t
}}
104 {"Shared library with global symbol" "-shared -melf32ppc" "-a32" {sdalib.s}
106 {"Dynamic application with SDA" "-melf32ppc tmpdir/sdalib.so" "-a32" {sdadyn.s}
107 {{objdump
-R sdadyn.d
}} "sdadyn"}
111 {"TLS static exec" "-melf64ppc" "-a64" {tls.s tlslib.s}
112 {{objdump
-dr tls.d
} {objdump
-sj.got tls.g
} {objdump
-sj.tdata tls.t
}}
114 {"TLS helper shared library" "-shared -melf64ppc tmpdir/tlslib.o" "" {}
116 {"TLS dynamic exec" "-melf64ppc tmpdir/tls.o tmpdir/libtlslib.so" "" {}
117 {{readelf
-WSsrl tlsexe.r
} {objdump
-dr tlsexe.d
}
118 {objdump
-sj.got tlsexe.g
} {objdump
-sj.tdata tlsexe.t
}}
120 {"TLS shared" "-shared -melf64ppc tmpdir/tls.o" "" {}
121 {{readelf
-WSsrl tlsso.r
} {objdump
-dr tlsso.d
}
122 {objdump
-sj.got tlsso.g
} {objdump
-sj.tdata tlsso.t
}}
124 {"TLSTOC static exec" "-melf64ppc tmpdir/tlslib.o " "-a64" {tlstoc.s}
125 {{objdump
-dr tlstoc.d
} {objdump
-sj.got tlstoc.g
}
126 {objdump
-sj.tdata tlstoc.t
}}
128 {"TLSTOC dynamic exec" "-melf64ppc tmpdir/tlstoc.o tmpdir/libtlslib.so"
130 {{readelf
-WSsrl tlsexetoc.r
} {objdump
-dr tlsexetoc.d
}
131 {objdump
-sj.got tlsexetoc.g
} {objdump
-sj.tdata tlsexetoc.t
}}
133 {"TLSTOC shared" "-shared -melf64ppc tmpdir/tlstoc.o" "" {}
134 {{readelf
-WSsrl tlstocso.r
} {objdump
-dr tlstocso.d
}
135 {objdump
-sj.got tlstocso.g
} {objdump
-sj.tdata tlstocso.t
}}
137 {"sym@tocbase" "-shared -melf64ppc" "-a64" {symtocbase-1.s symtocbase-2.s}
138 {{objdump
-dj.data symtocbase.d
}} "symtocbase.so"}
142 run_ld_link_tests $ppcelftests
144 if [ supports_ppc64
] then {
145 run_ld_link_tests $ppc64elftests