| 1 |
# Expect script for ld-powerpc tests |
| 2 |
# Copyright 2002, 2003 Free Software Foundation |
| 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 |
| 16 |
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
| 17 |
# |
| 18 |
|
| 19 |
if { ![istarget "powerpc*-*-*"] } { |
| 20 |
return |
| 21 |
} |
| 22 |
|
| 23 |
# powerpc ELF only at the moment. |
| 24 |
|
| 25 |
if { [istarget "*-*-macos*"] || [istarget "*-*-netware*"] |
| 26 |
|| [istarget "*-*-pe"] || [istarget "*-*-winnt*"] |
| 27 |
|| [istarget "*-*-cygwin*"] || [istarget "*-*-aix*"] |
| 28 |
|| [istarget "*-*-beos*"] } { |
| 29 |
return |
| 30 |
} |
| 31 |
|
| 32 |
proc 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 |
|
| 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 |
|
| 52 |
set ppcelftests { |
| 53 |
{"Reloc section order" "-melf32ppc -shared -z nocombreloc" "-a32" {reloc.s} |
| 54 |
{{objdump -hw reloc.d}} "reloc.so"} |
| 55 |
{"APUinfo section processing" "-melf32ppc" |
| 56 |
"-a32 -me500" {apuinfo1.s apuinfo2.s} |
| 57 |
{{readelf -x5 apuinfo.rd}} "apuinfo"} |
| 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"} |
| 72 |
} |
| 73 |
|
| 74 |
set ppc64elftests { |
| 75 |
{"TLS static exec" "-melf64ppc" "-a64" {tls.s tlslib.s} |
| 76 |
{{objdump -dr tls.d} {objdump -sj.got tls.g} {objdump -sj.tdata tls.t}} |
| 77 |
"tls"} |
| 78 |
{"TLS helper shared library" "-shared -melf64ppc tmpdir/tlslib.o" "" {} |
| 79 |
{} "libtlslib.so"} |
| 80 |
{"TLS dynamic exec" "-melf64ppc tmpdir/tls.o tmpdir/libtlslib.so" "" {} |
| 81 |
{{readelf -WSsrl tlsexe.r} {objdump -dr tlsexe.d} |
| 82 |
{objdump -sj.got tlsexe.g} {objdump -sj.tdata tlsexe.t}} |
| 83 |
"tlsexe"} |
| 84 |
{"TLS shared" "-shared -melf64ppc tmpdir/tls.o" "" {} |
| 85 |
{{readelf -WSsrl tlsso.r} {objdump -dr tlsso.d} |
| 86 |
{objdump -sj.got tlsso.g} {objdump -sj.tdata tlsso.t}} |
| 87 |
"tls.so"} |
| 88 |
{"TLSTOC static exec" "-melf64ppc tmpdir/tlslib.o " "-a64" {tlstoc.s} |
| 89 |
{{objdump -dr tlstoc.d} {objdump -sj.got tlstoc.g} |
| 90 |
{objdump -sj.tdata tlstoc.t}} |
| 91 |
"tlstoc"} |
| 92 |
{"TLSTOC dynamic exec" "-melf64ppc tmpdir/tlstoc.o tmpdir/libtlslib.so" |
| 93 |
"" {} |
| 94 |
{{readelf -WSsrl tlsexetoc.r} {objdump -dr tlsexetoc.d} |
| 95 |
{objdump -sj.got tlsexetoc.g} {objdump -sj.tdata tlsexetoc.t}} |
| 96 |
"tlsexetoc"} |
| 97 |
{"TLSTOC shared" "-shared -melf64ppc tmpdir/tlstoc.o" "" {} |
| 98 |
{{readelf -WSsrl tlstocso.r} {objdump -dr tlstocso.d} |
| 99 |
{objdump -sj.got tlstocso.g} {objdump -sj.tdata tlstocso.t}} |
| 100 |
"tlstoc.so"} |
| 101 |
} |
| 102 |
|
| 103 |
|
| 104 |
run_ld_link_tests $ppcelftests |
| 105 |
|
| 106 |
if [ supports_ppc64 ] then { |
| 107 |
run_ld_link_tests $ppc64elftests |
| 108 |
} |