1 # Expect script
for ld-powerpc tests
2 # Copyright
(C
) 2002-2022 Free Software Foundation
, Inc.
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"
33 "-shared --hash-style=sysv -Tvxworks1.ld" ""
34 "-mregnames" {vxworks1-lib.s}
35 {{readelf
{--relocs
-T
} vxworks1
-lib.rd
} {objdump
-dr vxworks1
-lib.dd
}
36 {readelf
--symbols vxworks1
-lib.nd
} {readelf
-d vxworks1
-lib.td
}}
38 {"VxWorks executable test 1 (dynamic)" \
39 "tmpdir/libvxworks1.so -Tvxworks1.ld -q --force-dynamic --hash-style=sysv" ""
40 "-mregnames" {vxworks1.s}
41 {{readelf
{--relocs
-T
} vxworks1.rd
} {objdump
-dr vxworks1.dd
}}
43 {"VxWorks executable test 2 (dynamic)" \
44 "-Tvxworks1.ld -q --force-dynamic --hash-style=sysv" ""
45 "-mregnames" {vxworks2.s}
46 {{readelf
--segments vxworks2.sd
}}
48 {"VxWorks executable test 2 (static)"
49 "-Tvxworks1.ld --hash-style=sysv" ""
50 "-mregnames" {vxworks2.s}
51 {{readelf
--segments vxworks2
-static.sd
}}
54 "-Tvxworks1.ld --relax -q --hash-style=sysv" ""
55 "-mregnames" {vxworks-relax.s}
56 {{readelf
--relocs vxworks
-relax.rd
}}
58 {"VxWorks relocatable relax test"
59 "-Tvxworks1.ld -r --relax -q --hash-style=sysv" ""
60 "-mregnames" {vxworks-relax-2.s}
61 {{readelf
{--relocs
-T
} vxworks
-relax
-2.rd
}}
64 run_ld_link_tests $ppcvxtests
65 run_dump_test
"vxworks1-static"
69 # powerpc ELF only at the moment. Disable
for nto too
, even though it
70 # is ELF
, because we pass
-melf32ppc to
ld and powerpc
-nto
-ld wants
73 if { [is_xcoff_format
]
74 ||
[istarget
"*-*-pe"] || [istarget "*-*-winnt*"]
75 ||
[istarget
"*-*-cygwin*"]
76 ||
[istarget
"*-*-lynxos*"]
77 ||
[istarget
"*-*-nto*"] } {
81 proc supports_ppc64
{ } {
84 catch
"exec $ld --help | grep emulations" tmp
85 if [ regexp
"elf64l?ppc" $tmp ] then {
92 # List contains test
-items with
3 items followed by
2 lists
:
93 #
0:name 1:ld early options
2:ld late options
3:assembler options
94 #
4:filenames of assembler files
5: action and options.
6: name of output file
97 # objdump
: Apply objdump options
on result. Compare with regex
(last
arg).
98 # nm
: Apply nm options
on result. Compare with regex
(last
arg).
99 # readelf
: Apply readelf options
on result. Compare with regex
(last
arg).
102 {"Reloc section order" "-melf32ppc -shared -z nocombreloc -z notext" "" "-a32" {reloc.s}
103 {{objdump
-hw reloc.d
}} "reloc.so"}
104 {"APUinfo section processing" "-melf32ppc" ""
105 "-a32 -me500" {apuinfo1.s apuinfo-nul.s apuinfo2.s}
106 {{readelf
-x.PPC.EMB.apuinfo apuinfo.rd
}} "apuinfo"}
107 {"APUinfo VLE section processing" "-melf32ppc" ""
108 "-a32 -me500 -mvle" {apuinfo1.s apuinfo-vle.s apuinfo-vle2.s}
109 {{readelf
-x.PPC.EMB.apuinfo apuinfo
-vle.rd
}} "apuinfo-vle"}
110 {"APUinfo NULL section processing" "-melf32ppc" ""
111 "-a32 -me500" {apuinfo-nul1.s apuinfo-nul.s}
112 {{readelf
-x.PPC.EMB.apuinfo apuinfo
-nul.rd
}} "apuinfo"}
113 {"TLS32 static exec (markers)" "-melf32ppc" ""
114 "-a32 --defsym TLSMARK=1" {tls32.s tlslib32.s}
115 {{objdump
-dr tls32.d
} {objdump
-sj.got tls32.g
}
116 {objdump
-sj.tdata tls32.t
}}
118 {"TLS32 static exec" "-melf32ppc" "" "-a32" {tls32.s tlslib32.s}
119 {{objdump
-dr tls32.d
} {objdump
-sj.got tls32.g
}
120 {objdump
-sj.tdata tls32.t
}}
122 {"TLS32 static exec (--no-tls-optimize)" "-melf32ppc --no-tls-optimize" ""
123 "-a32 --defsym TLSMARK=1" {tls32.s tlslib32.s}
124 {{objdump
-dr tls32no.d
} {objdump
-sj.got tls32no.g
}
125 {objdump
-sj.tdata tls32.t
}}
127 {"TLS32 helper shared library" "-shared -melf32ppc tmpdir/tlslib32.o" "" "" {}
129 {"TLS32 dynamic exec" "-melf32ppc --no-plt-align --no-ld-generated-unwind-info --hash-style=sysv tmpdir/tls32.o tmpdir/libtlslib32.so" "" "" {}
130 {{readelf
-WSsrl tlsexe32.r
} {objdump
-dr tlsexe32.d
}
131 {objdump
-sj.got tlsexe32.g
} {objdump
-sj.tdata tlsexe32.t
}}
133 {"TLS32 dynamic exec (--no-tls-optimize)" "-melf32ppc --no-tls-optimize --no-plt-align --no-ld-generated-unwind-info --hash-style=sysv tmpdir/tls32.o tmpdir/libtlslib32.so" "" "" {}
134 {{readelf
-WSsrl tlsexe32no.r
} {objdump
-dr tlsexe32no.d
}
135 {objdump
-sj.got tlsexe32no.g
} {objdump
-sj.tdata tlsexe32.t
}}
137 {"TLS32 shared" "-shared -melf32ppc --no-plt-align --no-ld-generated-unwind-info --hash-style=sysv -z notext tmpdir/tls32.o" "" "" {}
138 {{readelf
-WSsrl tlsso32.r
} {objdump
-dr tlsso32.d
}
139 {objdump
-sj.got tlsso32.g
} {objdump
-sj.tdata tlsso32.t
}}
141 {"TLS32 markers" "-melf32ppc" "" "-a32" {tlsmark32.s tlslib32.s}
142 {{objdump
-dr tlsmark32.d
}}
144 {"TLS32 opt 1" "-melf32ppc" "" "-a32" {tlsopt1_32.s tlslib32.s}
145 {{objdump
-dr tlsopt1_32.d
}}
147 {"TLS32 opt 2" "-melf32ppc" "" "-a32" {tlsopt2_32.s tlslib32.s}
148 {{objdump
-dr tlsopt2_32.d
}}
150 {"TLS32 opt 3" "-melf32ppc" "" "-a32" {tlsopt3_32.s tlslib32.s}
151 {{objdump
-dr tlsopt3_32.d
}}
153 {"TLS32 opt 4" "-melf32ppc" "" "-a32" {tlsopt4_32.s tlslib32.s}
154 {{objdump
-dr tlsopt4_32.d
}}
156 {"TLS32 DLL" "-shared -melf32ppc --version-script tlsdll.ver" ""
159 {"TLS32 opt 5" "-melf32ppc -shared --gc-sections --secure-plt --no-plt-align tmpdir/tlsdll32.so" "" "-a32" {tlsopt5_32.s}
160 {{objdump
-dr tlsopt5_32.d
}}
162 {"Shared library with global symbol" "-shared -melf32ppc" "" "-a32" {sdalib.s}
164 {"Dynamic application with SDA" "-melf32ppc tmpdir/sdalib.so" "" "-a32" {sdadyn.s}
165 {{objdump
-R sdadyn.d
}} "sdadyn"}
166 {"relaxing" "-melf32ppc --relax -Ttext=0 --defsym far=0x80001234 --defsym near=0x00004320" "" "-a32" "relax.s"
167 {{objdump
-dr relax.d
}}
169 {"relocatable relaxing" "-melf32ppc -r --relax" "" "-a32" "relax.s"
170 {{objdump
-dr relaxr.d
}}
172 {"relocatable relaxing large" "-melf32ppc -r --relax" "" "-a32" "relax.s big.s"
173 {{objdump
-dr relaxrl.d
}}
175 {"build empty shared library" "-shared" "" "" "empty.s" {} "empty.so"}
176 {"abs32-static" "-melf32ppc -static --defsym a=1 --defsym 'HIDDEN(b=2)' --defsym c=0x12345678" ""
177 "-a32" {abs32-reloc.s}
178 {{objdump
{-dr
} abs32
-static.d
}
179 {readelf
{-rW
} abs32
-static.r
}} "abs32-static"}
180 {"abs32-pie" "-melf32ppc -pie --hash-style=sysv --defsym a=1 --defsym 'HIDDEN(b=2)' --defsym c=0x12345678" ""
181 "-a32" {abs32-reloc.s}
182 {{objdump
{-dr
} abs32
-pie.d
}
183 {readelf
{-rW
} abs32
-pie.r
}} "abs32-pie"}
184 {"abs32-shared" "-melf32ppc -shared --hash-style=sysv --defsym a=1 --defsym 'HIDDEN(b=2)' --defsym c=0x12345678" ""
185 "-a32" {abs32-reloc.s}
186 {{objdump
{-dr
} abs32
-shared.d
}
187 {readelf
{-rW
} abs32
-shared.r
}} "abs32-shared"}
191 {"TLS static exec (markers)" "-melf64ppc --no-plt-align" ""
192 "-a64 --defsym TLSMARK=1" {tls.s tlslib.s}
193 {{objdump
-dr tls.d
} {objdump
-sj.got tls.g
} {objdump
-sj.tdata tls.t
}}
195 {"TLS static exec" "-melf64ppc --no-plt-align" "" "-a64" {tls.s tlslib.s}
196 {{objdump
-dr tls.d
} {objdump
-sj.got tls.g
} {objdump
-sj.tdata tls.t
}}
198 {"TLS static exec (--no-tls-optimize)" "-melf64ppc --no-tls-optimize --no-plt-align" ""
199 "-a64 --defsym TLSMARK=1" {tls.s tlslib.s}
200 {{objdump
-dr tlsno.d
} {objdump
-sj.got tlsno.g
} {objdump
-sj.tdata tls.t
}}
202 {"TLS helper shared library" "-shared -melf64ppc tmpdir/tlslib.o" "" "" {}
204 {"TLS helper old shared lib" "-shared -melf64ppc" "" "-a64" {oldtlslib.s}
206 {"TLS dynamic exec" "-melf64ppc --no-plt-align --no-ld-generated-unwind-info --hash-style=sysv tmpdir/tls.o tmpdir/libtlslib.so" "" "" {}
207 {{readelf
-WSsrl tlsexe.r
} {objdump
-dr tlsexe.d
}
208 {objdump
-sj.got tlsexe.g
} {objdump
-sj.tdata tlsexe.t
}}
210 {"TLS dynamic old" "-melf64ppc --no-plt-align --no-ld-generated-unwind-info --hash-style=sysv tmpdir/tls.o tmpdir/liboldlib.so" "" "" {}
211 {{readelf
-WSsrl tlsexe.r
} {objdump
-dr tlsexe.d
}
212 {objdump
-sj.got tlsexe.g
} {objdump
-sj.tdata tlsexe.t
}}
214 {"TLS dynamic exec (--no-tls-optimize)" "-melf64ppc --no-tls-optimize --no-plt-align --no-ld-generated-unwind-info --hash-style=sysv tmpdir/tls.o tmpdir/libtlslib.so" "" "" {}
215 {{readelf
-WSsrl tlsexeno.r
} {objdump
-dr tlsexeno.d
}
216 {objdump
-sj.got tlsexeno.g
} {objdump
-sj.tdata tlsexe.t
}}
218 {"TLS shared" "-shared -melf64ppc --no-plt-align --no-ld-generated-unwind-info --hash-style=sysv -z notext tmpdir/tls.o" "" "" {}
219 {{readelf
-WSsrl tlsso.r
} {objdump
-dr tlsso.d
}
220 {objdump
-sj.got tlsso.g
} {objdump
-sj.tdata tlsso.t
}}
222 {"TLSTOC static exec" "-melf64ppc tmpdir/tlslib.o" "" "-a64" {tlstoc.s}
223 {{objdump
-dr tlstoc.d
} {objdump
-sj.got tlstoc.g
}
224 {objdump
-sj.tdata tlstoc.t
}}
226 {"TLSTOC static exec (--no-tls-optimize)" "-melf64ppc --no-tls-optimize tmpdir/tlslib.o tmpdir/tlstoc.o" "" "" {}
227 {{objdump
-dr tlstocno.d
} {objdump
-sj.got tlstocno.g
}
228 {objdump
-sj.tdata tlstoc.t
}}
230 {"TLSTOC dynamic exec" "-melf64ppc --no-plt-align --no-ld-generated-unwind-info --hash-style=sysv tmpdir/tlstoc.o tmpdir/libtlslib.so" ""
232 {{readelf
-WSsrl tlsexetoc.r
} {objdump
-dr tlsexetoc.d
}
233 {objdump
-sj.got tlsexetoc.g
} {objdump
-sj.tdata tlsexetoc.t
}}
235 {"TLSTOC dynamic old" "-melf64ppc --no-plt-align --no-ld-generated-unwind-info --hash-style=sysv tmpdir/tlstoc.o tmpdir/liboldlib.so" ""
237 {{readelf
-WSsrl tlsexetoc.r
} {objdump
-dr tlsexetoc.d
}
238 {objdump
-sj.got tlsexetoc.g
} {objdump
-sj.tdata tlsexetoc.t
}}
240 {"TLSTOC dynamic exec (--no-tls-optimize)" "-melf64ppc --no-tls-optimize --no-plt-align --no-ld-generated-unwind-info --hash-style=sysv tmpdir/tlstoc.o tmpdir/libtlslib.so" ""
242 {{readelf
-WSsrl tlsexetoc.r
} {objdump
-dr tlsexetocno.d
}
243 {objdump
-sj.got tlsexetocno.g
} {objdump
-sj.tdata tlsexetoc.t
}}
245 {"TLSTOC shared" "-shared -melf64ppc --no-plt-align --no-ld-generated-unwind-info --hash-style=sysv -z notext tmpdir/tlstoc.o" "" "" {}
246 {{readelf
-WSsrl tlstocso.r
} {objdump
-dr tlstocso.d
}
247 {objdump
-sj.got tlstocso.g
} {objdump
-sj.tdata tlstocso.t
}}
249 {"TLS dynamic exec (--tls-get-addr-regsave)" "-melf64ppc --no-plt-align --no-ld-generated-unwind-info --hash-style=sysv --tls-get-addr-regsave tmpdir/tls.o tmpdir/libtlslib.so" "" "" {}
250 {{readelf
-WSsrl tlsexers.r
} {objdump
-dr tlsexers.d
}
251 {objdump
-sj.got tlsexe.g
} {objdump
-sj.tdata tlsexe.t
}}
253 {"TLS dynamic exec (--no-tls-optimize --tls-get-addr-regsave)" "-melf64ppc --no-tls-optimize --tls-get-addr-regsave --no-plt-align --no-ld-generated-unwind-info --hash-style=sysv tmpdir/tls.o tmpdir/libtlslib.so" "" "" {}
254 {{readelf
-WSsrl tlsexenors.r
} {objdump
-dr tlsexenors.d
}
255 {objdump
-sj.got tlsexeno.g
} {objdump
-sj.tdata tlsexe.t
}}
257 {"TLSTOC dynamic exec (--tls-get-addr-regsave)" "-melf64ppc --tls-get-addr-regsave --no-plt-align --no-ld-generated-unwind-info --hash-style=sysv tmpdir/tlstoc.o tmpdir/libtlslib.so" ""
259 {{readelf
-WSsrl tlsexetocrs.r
} {objdump
-dr tlsexetocrs.d
}
260 {objdump
-sj.got tlsexetoc.g
} {objdump
-sj.tdata tlsexetoc.t
}}
262 {"TLSTOC dynamic exec (--no-tls-optimize --tls-get-addr-regsave)" "-melf64ppc --no-tls-optimize --tls-get-addr-regsave --no-plt-align --no-ld-generated-unwind-info --hash-style=sysv tmpdir/tlstoc.o tmpdir/libtlslib.so" ""
264 {{readelf
-WSsrl tlsexetocrs.r
} {objdump
-dr tlsexetocnors.d
}
265 {objdump
-sj.got tlsexetocno.g
} {objdump
-sj.tdata tlsexetoc.t
}}
267 {"TLS markers" "-melf64ppc" "" "-a64" {tlsmark.s tlslib.s}
268 {{objdump
-dr tlsmark.d
}}
270 {"TLS opt 1" "-melf64ppc" "" "-a64" {tlsopt1.s tlslib.s}
271 {{objdump
-dr tlsopt1.d
}}
273 {"TLS opt 2" "-melf64ppc" "" "-a64" {tlsopt2.s tlslib.s}
274 {{objdump
-dr tlsopt2.d
}}
276 {"TLS opt 3" "-melf64ppc" "" "-a64" {tlsopt3.s tlslib.s}
277 {{objdump
-dr tlsopt3.d
}}
279 {"TLS opt 4" "-melf64ppc" "" "-a64" {tlsopt4.s tlslib.s}
280 {{objdump
-dr tlsopt4.d
}}
282 {"TLS DLL" "-shared -melf64ppc --version-script tlsdll.ver" "" "-a64" {tlsdll.s}
284 {"TLS opt 5" "-melf64ppc -shared --hash-style=both --gc-sections --no-plt-localentry tmpdir/tlsdll.so" "" "-a64" {tlsopt5.s}
285 {{objdump
-dr tlsopt5.d
} {readelf
-wf tlsopt5.wf
}}
287 {"TLS opt 6" "-melf64ppc -shared --hash-style=both --gc-sections --no-plt-localentry --tls-get-addr-regsave tmpdir/tlsdll.so" "" "-a64" {tlsopt5.s}
288 {{objdump
-dr tlsopt6.d
} {readelf
-wf tlsopt6.wf
}}
290 {"TLSdesc" "-melf64ppc -shared --hash-style=both --no-plt-localentry tmpdir/libtlslib.so" "" "-a64" {tlsdesc.s}
291 {{objdump
-dr tlsdesc.d
} {readelf
-wf tlsdesc.wf
}}
293 {"TLSdesc2" "-melf64ppc -shared --hash-style=both --no-plt-localentry tmpdir/tlsdll.so" "" "-a64" {tlsdesc.s}
294 {{objdump
-dr tlsdesc2.d
} {readelf
-wf tlsdesc2.wf
}}
296 {"TLSdesc3" "-melf64ppc --no-tls-optimize tmpdir/tlsdll.o" "" "-a64" {tlsdesc.s}
297 {{objdump
-dr tlsdesc3.d
} {readelf
-wf tlsdesc3.wf
}}
299 {"TLSdesc4" "-melf64ppc --no-tls-optimize tmpdir/tlsdll.o" "" "-a64" {tlsdesc4.s}
300 {{objdump
-dr tlsdesc4.d
} {readelf
-wf tlsdesc4.wf
}}
302 {"tlsget" "-shared --hash-style=both -melf64ppc --plt-align=0" "tmpdir/tlsdll.so" "-a64 -mpower10" {tlsget.s}
303 {{objdump
-dr tlsget.d
} {readelf
-wf tlsget.wf
}}
305 {"tlsget2" "-shared --hash-style=both -melf64ppc --plt-align=0 --power10-stubs=yes" "tmpdir/tlsdll.so" "-a64 -mpower10" {tlsget.s}
306 {{objdump
-dr tlsget2.d
} {readelf
-wf tlsget2.wf
}}
308 {"sym@tocbase" "-shared -melf64ppc" "" "-a64" {symtocbase-1.s symtocbase-2.s}
309 {{objdump
-dj.data symtocbase.d
}} "symtocbase.so"}
310 {"TOC opt" "-melf64ppc" "" "-a64" {tocopt.s}
311 {{ld tocopt.out
} {objdump
-s tocopt.d
}} "tocopt"}
312 {"TOC opt2" "-melf64ppc --defsym x=2" "" "-a64" {tocopt2.s}
313 {{ld tocopt2.out
} {objdump
-s tocopt2.d
}} "tocopt2"}
314 {"TOC opt3" "-melf64ppc -no-keep-memory --defsym x=2" "" "-a64" {tocopt3.s}
315 {{objdump
-s tocopt3.d
}} "tocopt3"}
316 {"TOC opt4" "-melf64ppc -no-keep-memory --defsym x=2" "" "-a64"
317 {tocopt4a.s tocopt4b.s
} {{objdump
-s tocopt4.d
}} "tocopt4"}
318 {"TOC opt5" "-melf64ppc" "" "-a64" {tocopt5.s}
319 {{objdump
-s tocopt5.d
}} "tocopt5"}
320 {"TOC opt6" "-melf64ppc" "" "-a64" {tocopt6a.s tocopt6b.s tocopt6c.s}
321 {{objdump
-d tocopt6.d
}} "tocopt6"}
322 {"TOC opt7" "-melf64ppc" "" "-a64 -mpower9" {tocopt7.s}
323 {{ld tocopt7.out
} {objdump
-s tocopt7.d
}} "tocopt7"}
324 {"TOC opt8" "-melf64ppc" "" "-a64 -mpower9" {tocopt8.s}
325 {{objdump
-s tocopt8.d
}} "tocopt8"}
326 {"tocsave lib" "-shared -melf64ppc" "" "-a64" {tocsavelib.s}
328 {"tocsave1 shared" "-melf64ppc" "tmpdir/tocsavelib.so" "-a64" {tocsave1.s}
329 {{objdump
-dr tocsave1s.d
}} "tocsave1s"}
330 {"tocsave1 static" "-melf64ppc" "tmpdir/tocsavelib.o" "-a64" {tocsave1.s}
331 {{objdump
-dr tocsave1a.d
}} "tocsave1a"}
332 {"tocsave2 shared" "-melf64ppc" "tmpdir/tocsavelib.so" "-a64" {tocsave2.s}
333 {{objdump
-dr tocsave2s.d
}} "tocsave2s"}
334 {"tocsave2 static" "-melf64ppc" "tmpdir/tocsavelib.o" "-a64" {tocsave2.s}
335 {{objdump
-dr tocsave2a.d
}} "tocsave2a"}
336 {"ambig shared v1" "-shared -melf64ppc" "" "-a64" {funv1.s} {} "funv1.so"}
337 {"ambig shared v2" "-shared -melf64ppc" "" "-a64" {funv2.s} {} "funv2.so"}
338 {"notoc ext" "" "" "-a64" {ext.s} {} ""}
339 {"notoc" "-melf64ppc --no-plt-localentry --no-power10-stubs -T ext.lnk"
341 {{objdump
-d notoc.d
} {readelf
{-wf
-W
} notoc.wf
}} "notoc"}
342 {"notoc2" "-melf64ppc -shared" "" "-a64 -mpower10" {notoc2.s}
343 {{objdump
{-d
-Mpower10
} notoc2.d
}} "notoc2"}
344 {"notoc3" "-melf64ppc --no-plt-localentry -T ext.lnk" ""
345 "-a64 -mpower10" {notoc3.s}
346 {{objdump
-d notoc3.d
} {readelf
{-wf
-W
} notoc3.wf
}} "notoc3"}
347 {"pcrelopt" "-melf64ppc --hash-style=gnu" "tmpdir/symtocbase.so"
348 "-a64 -mpower10" {pcrelopt.s}
349 {{objdump
{-d
-Mpower10
} pcrelopt.d
}
350 {readelf
{-S
--wide
} pcrelopt.sec
}} "pcrelopt" }
351 {"group1" "-melf64ppc -e foo" "" "-a64" {group1.s group2.s group3.s}
352 {{objdump
{-d
} group1.d
}
353 {readelf
{-s
} group1.sym
}} "group1"}
354 {"group2" "-melf64ppc -e foo" "" "-a64" {group2.s group1.s group3.s}
355 {{objdump
{-d
} group2.d
}
356 {readelf
{-s
} group2.sym
}} "group2"}
357 {"group3" "-melf64ppc -e foo" "" "-a64" {group3.s group2.s group1.s}
358 {{objdump
{-d
} group2.d
}
359 {readelf
{-s
} group3.sym
}} "group3"}
360 {"weak1" "-melf64ppc --hash-style=both" ""
361 "-a64 -mpower10" {weak1.s}
362 {{objdump
-d weak1.d
} {readelf
{-srW
} weak1.r
}} "weak1"}
363 {"weak1.so" "-shared -melf64ppc --hash-style=both" ""
364 "-a64 -mpower10" {weak1.s}
365 {{objdump
-d weak1so.d
} {readelf
{-srW
} weak1so.r
}} "weak1.so"}
366 {"startstop" "-shared -melf64ppc --hash-style=sysv --gc-sections -z start-stop-gc" ""
367 "-a64 -mpower10" {startstop.s}
368 {{objdump
-d startstop.d
} {readelf
{-rW
} startstop.r
}} "startstop.so"}
369 {"abs-static" "-melf64ppc -static --defsym a=1 --defsym 'HIDDEN(b=2)' --defsym c=0x123456789abcdef0" ""
371 {{objdump
{-sdr
} abs-static.d
}
372 {readelf
{-rW
} abs-static.r
}} "abs-static"}
373 {"abs-pie" "-melf64ppc -pie --hash-style=sysv --defsym a=1 --defsym 'HIDDEN(b=2)' --defsym c=0x123456789abcdef0" ""
375 {{objdump
{-sdr
} abs-pie.d
}
376 {readelf
{-rW
} abs-pie.r
}} "abs-pie"}
377 {"abs-shared" "-melf64ppc -shared --hash-style=sysv --defsym a=1 --defsym 'HIDDEN(b=2)' --defsym c=0x123456789abcdef0" ""
379 {{objdump
{-sdr
} abs-shared.d
}
380 {readelf
{-rW
} abs-shared.r
}} "abs-shared"}
381 {"abs-pie-relr" "-melf64ppc -pie --hash-style=sysv -z pack-relative-relocs --defsym a=1 --defsym 'HIDDEN(b=2)' --defsym c=0x123456789abcdef0" ""
383 {{objdump
{-sdr
} abs-pie
-relr.d
}
384 {readelf
{-rW
} abs-pie
-relr.r
}} "abs-pie-relr"}
385 {"abs-shared-relr" "-melf64ppc -shared --hash-style=sysv -z pack-relative-relocs --defsym a=1 --defsym 'HIDDEN(b=2)' --defsym c=0x123456789abcdef0" ""
387 {{objdump
{-sdr
} abs-shared
-relr.d
}
388 {readelf
{-rW
} abs-shared
-relr.r
}} "abs-shared-relr"}
392 {"VLE multiple segments 1" "-melf32ppc -T vle-multiseg-1.ld" ""
393 "-a32 -mbig -mregnames -mvle" {vle-multiseg.s}
394 {{readelf
"-l" vle-multiseg-1.d}} "vle-multiseg-1"}
395 {"VLE multiple segments 2" "-melf32ppc -T vle-multiseg-2.ld" ""
396 "-a32 -mbig -mregnames -mvle" {vle-multiseg.s}
397 {{readelf
"-l" vle-multiseg-2.d}} "vle-multiseg-2"}
398 {"VLE multiple segments 3" "-melf32ppc -T vle-multiseg-3.ld" ""
399 "-a32 -mbig -mregnames -mvle" {vle-multiseg.s}
400 {{readelf
"-l" vle-multiseg-3.d}} "vle-multiseg-3"}
401 {"VLE multiple segments 4" "-melf32ppc -T vle-multiseg-4.ld" ""
402 "-a32 -mbig -mregnames -mvle" {vle-multiseg.s}
403 {{readelf
"-l" vle-multiseg-4.d}} "vle-multiseg-4"}
404 {"VLE multiple segments 5" "-melf32ppc -T vle-multiseg-5.ld" ""
405 "-a32 -mbig -mregnames -mvle" {vle-multiseg.s}
406 {{readelf
"-l" vle-multiseg-5.d}} "vle-multiseg-5"}
407 {"VLE relocations 1" "-melf32ppc -T vle.ld" ""
408 "-a32 -mbig -mvle" {vle-reloc-1.s vle-reloc-def-1.s}
409 {{objdump
"-Mvle -d" vle-reloc-1.d}} "vle-reloc-1"}
410 {"VLE relocations 2" "-melf32ppc -T vle.ld" ""
411 "-a32 -mbig -mvle" {vle-reloc-2.s vle-reloc-def-2.s}
412 {{objdump
"-Mvle -d" vle-reloc-2.d}} "vle-reloc-2"}
413 {"VLE relocations 3" "-melf32ppc -T vle.ld" ""
414 "-a32 -mbig -mvle" {vle-reloc-3.s vle-reloc-def-3.s}
415 {{objdump
"-Mvle -d" vle-reloc-3.d}} "vle-reloc-3"}
418 if [istarget
"powerpc*le*-*-*"] then {
419 set options_regsub
(ld) {{-melf
([3264]*)ppc
} {-melf\
1lppc
}}
421 for {set i
0} {$i
< [llength $ppcelftests
]} {incr i
} {
422 set line
[lindex $ppcelftests $i
]
423 set ld_options
[lindex $line
1]
424 regsub
-all elf32ppc $ld_options elf32lppc ld_options
425 set line
[lreplace $line
1 1 $ld_options
]
426 set ppcelftests
[lreplace $ppcelftests $i $i $line
]
429 if [ supports_ppc64
] then {
430 for {set i
0} {$i
< [llength $ppc64elftests
]} {incr i
} {
431 set line
[lindex $ppc64elftests $i
]
432 set ld_options
[lindex $line
1]
433 regsub
-all elf64ppc $ld_options elf64lppc ld_options
434 set line
[lreplace $line
1 1 $ld_options
]
435 set ppc64elftests
[lreplace $ppc64elftests $i $i $line
]
440 run_ld_link_tests $ppcelftests
442 if [ supports_ppc64
] then {
443 run_ld_link_tests $ppc64elftests
444 run_dump_test
"relbrlt"
445 run_dump_test
"elfv2so"
446 run_dump_test
"elfv2exe"
447 run_dump_test
"elfv2-2so"
448 run_dump_test
"elfv2-2exe"
449 run_dump_test
"ambiguousv1"
450 run_dump_test
"ambiguousv1b"
451 run_dump_test
"ambiguousv2"
452 run_dump_test
"ambiguousv2b"
453 run_dump_test
"defsym"
454 run_dump_test
"tocvar"
455 run_dump_test
"tocnovar"
456 run_dump_test
"tlsldopt"
457 run_dump_test
"relocsort"
458 run_dump_test
"addpcis"
459 run_dump_test
"dotsym1"
460 run_dump_test
"dotsym2"
461 run_dump_test
"dotsym3"
462 run_dump_test
"dotsym4"
463 run_dump_test
"pr23937"
464 run_dump_test
"callstub-1"
465 run_dump_test
"callstub-2"
466 run_dump_test
"callstub-3"
467 run_dump_test
"callstub-4"
468 run_dump_test
"inline-1"
469 run_dump_test
"inline-2"
470 run_dump_test
"inline-3"
471 run_dump_test
"inline-4"
472 run_dump_test
"inlinepcrel-1"
473 run_dump_test
"inlinepcrel-2"
474 run_dump_test
"inlinepcrel-3"
475 run_dump_test
"tlsgd"
476 run_dump_test
"tlsld"
477 run_dump_test
"tlsie"
478 run_dump_test
"non-contiguous-powerpc64"
479 run_dump_test
"tprel"
480 run_dump_test
"pr28827-1"
481 run_dump_test
"pr28827-2"
484 run_dump_test
"localgot"
485 run_dump_test
"tlsldopt32"
487 run_ld_link_tests $ppceabitests
490 run_dump_test
"sdabase"
491 run_dump_test
"sdabase2"
493 run_dump_test
"attr-gnu-4-00"
494 run_dump_test
"attr-gnu-4-01"
495 run_dump_test
"attr-gnu-4-02"
496 run_dump_test
"attr-gnu-4-03"
497 run_dump_test
"attr-gnu-4-10"
498 run_dump_test
"attr-gnu-4-11"
499 run_dump_test
"attr-gnu-4-12"
500 run_dump_test
"attr-gnu-4-13"
501 run_dump_test
"attr-gnu-4-20"
502 run_dump_test
"attr-gnu-4-21"
503 run_dump_test
"attr-gnu-4-22"
504 run_dump_test
"attr-gnu-4-23"
505 run_dump_test
"attr-gnu-4-31"
506 run_dump_test
"attr-gnu-4-32"
507 run_dump_test
"attr-gnu-4-33"
509 run_dump_test
"attr-gnu-8-11"
510 run_dump_test
"attr-gnu-8-23"
511 run_dump_test
"attr-gnu-8-31"
513 run_dump_test
"attr-gnu-12-11"
514 run_dump_test
"attr-gnu-12-21"
516 run_dump_test
"vle-multiseg-6"
518 run_dump_test
"ppc476-shared"
519 run_dump_test
"ppc476-shared2"
521 run_dump_test
"non-contiguous-powerpc"
523 run_dump_test
"tprel32"
524 run_dump_test
"tprelbad"
526 run_dump_test
"undefweak"