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 dynamic executable test 1" \
35 "tmpdir/libvxworks1.so -Tvxworks1.ld -q" "-mregnames" {vxworks1.s}
36 {{readelf
--relocs vxworks1.rd
} {objdump
-dr vxworks1.dd
}}
39 run_ld_link_tests $ppcvxtests
43 # powerpc ELF only at the moment.
45 if { [istarget
"*-*-macos*"] || [istarget "*-*-netware*"]
46 ||
[istarget
"*-*-pe"] || [istarget "*-*-winnt*"]
47 ||
[istarget
"*-*-cygwin*"] || [istarget "*-*-aix*"]
48 ||
[istarget
"*-*-beos*"] } {
52 proc supports_ppc64
{ } {
55 catch
"exec $ld --help | grep emulations" tmp
56 if [ string match
"*elf64ppc*" $tmp ] then {
63 # List contains test
-items with
3 items followed by
2 lists
:
64 #
0:name 1:ld options
2:assembler options
65 #
3:filenames of assembler files
4: action and options.
5: name of output file
68 # objdump
: Apply objdump options
on result. Compare with regex
(last
arg).
69 # nm
: Apply nm options
on result. Compare with regex
(last
arg).
70 # readelf
: Apply readelf options
on result. Compare with regex
(last
arg).
73 {"Reloc section order" "-melf32ppc -shared -z nocombreloc" "-a32" {reloc.s}
74 {{objdump
-hw reloc.d
}} "reloc.so"}
75 {"APUinfo section processing" "-melf32ppc"
76 "-a32 -me500" {apuinfo1.s apuinfo2.s}
77 {{readelf
-x2 apuinfo.rd
}} "apuinfo"}
78 {"TLS32 static exec" "-melf32ppc" "-a32" {tls32.s tlslib32.s}
79 {{objdump
-dr tls32.d
} {objdump
-sj.got tls32.g
}
80 {objdump
-sj.tdata tls32.t
}}
82 {"TLS32 helper shared library" "-shared -melf32ppc tmpdir/tlslib32.o" "" {}
84 {"TLS32 dynamic exec" "-melf32ppc tmpdir/tls32.o tmpdir/libtlslib32.so" "" {}
85 {{readelf
-WSsrl tlsexe32.r
} {objdump
-dr tlsexe32.d
}
86 {objdump
-sj.got tlsexe32.g
} {objdump
-sj.tdata tlsexe32.t
}}
88 {"TLS32 shared" "-shared -melf32ppc tmpdir/tls32.o" "" {}
89 {{readelf
-WSsrl tlsso32.r
} {objdump
-dr tlsso32.d
}
90 {objdump
-sj.got tlsso32.g
} {objdump
-sj.tdata tlsso32.t
}}
92 {"Shared library with global symbol" "-shared -melf32ppc" "-a32" {sdalib.s}
94 {"Dynamic application with SDA" "-melf32ppc tmpdir/sdalib.so" "-a32" {sdadyn.s}
95 {{objdump
-R sdadyn.d
}} "sdadyn"}
99 {"TLS static exec" "-melf64ppc" "-a64" {tls.s tlslib.s}
100 {{objdump
-dr tls.d
} {objdump
-sj.got tls.g
} {objdump
-sj.tdata tls.t
}}
102 {"TLS helper shared library" "-shared -melf64ppc tmpdir/tlslib.o" "" {}
104 {"TLS dynamic exec" "-melf64ppc tmpdir/tls.o tmpdir/libtlslib.so" "" {}
105 {{readelf
-WSsrl tlsexe.r
} {objdump
-dr tlsexe.d
}
106 {objdump
-sj.got tlsexe.g
} {objdump
-sj.tdata tlsexe.t
}}
108 {"TLS shared" "-shared -melf64ppc tmpdir/tls.o" "" {}
109 {{readelf
-WSsrl tlsso.r
} {objdump
-dr tlsso.d
}
110 {objdump
-sj.got tlsso.g
} {objdump
-sj.tdata tlsso.t
}}
112 {"TLSTOC static exec" "-melf64ppc tmpdir/tlslib.o " "-a64" {tlstoc.s}
113 {{objdump
-dr tlstoc.d
} {objdump
-sj.got tlstoc.g
}
114 {objdump
-sj.tdata tlstoc.t
}}
116 {"TLSTOC dynamic exec" "-melf64ppc tmpdir/tlstoc.o tmpdir/libtlslib.so"
118 {{readelf
-WSsrl tlsexetoc.r
} {objdump
-dr tlsexetoc.d
}
119 {objdump
-sj.got tlsexetoc.g
} {objdump
-sj.tdata tlsexetoc.t
}}
121 {"TLSTOC shared" "-shared -melf64ppc tmpdir/tlstoc.o" "" {}
122 {{readelf
-WSsrl tlstocso.r
} {objdump
-dr tlstocso.d
}
123 {objdump
-sj.got tlstocso.g
} {objdump
-sj.tdata tlstocso.t
}}
125 {"sym@tocbase" "-shared -melf64ppc" "-a64" {symtocbase-1.s symtocbase-2.s}
126 {{objdump
-dj.data symtocbase.d
}} "symtocbase.so"}
130 run_ld_link_tests $ppcelftests
132 if [ supports_ppc64
] then {
133 run_ld_link_tests $ppc64elftests