aboutsummaryrefslogtreecommitdiff
path: root/ld/testsuite
diff options
context:
space:
mode:
Diffstat (limited to 'ld/testsuite')
-rw-r--r--ld/testsuite/ChangeLog11
-rw-r--r--ld/testsuite/ld-elf/sec64k.exp6
-rw-r--r--ld/testsuite/ld-scripts/empty-orphan.exp6
-rw-r--r--ld/testsuite/ld-scripts/phdrs.exp10
-rw-r--r--ld/testsuite/ld-scripts/phdrs2.exp8
-rw-r--r--ld/testsuite/ld-spu/ovl.d117
-rw-r--r--ld/testsuite/ld-spu/ovl.lnk13
-rw-r--r--ld/testsuite/ld-spu/ovl.s82
-rw-r--r--ld/testsuite/ld-spu/spu.exp27
9 files changed, 275 insertions, 5 deletions
diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog
index 909f6ee..8ed5b46 100644
--- a/ld/testsuite/ChangeLog
+++ b/ld/testsuite/ChangeLog
@@ -1,3 +1,14 @@
+2006-10-25 Alan Modra <amodra@bigpond.net.au>
+
+ * ld-spu/ovl.d: New file.
+ * ld-spu/ovl.lnk: New file.
+ * ld-spu/ovl.s: New file.
+ * ld-spu/spu.exp: New file.
+ * ld-elf/sec64k.exp: Tweak ld options for SPU.
+ * ld-scripts/empty-orphan.exp: Likewise.
+ * ld-scripts/phdrs.exp: Likewise.
+ * ld-scripts/phdrs2.exp: Likewise.
+
2006-10-24 Alan Modra <amodra@bigpond.net.au>
* ld-powerpc/plt1.s: New.
diff --git a/ld/testsuite/ld-elf/sec64k.exp b/ld/testsuite/ld-elf/sec64k.exp
index 784ed71..50abcc1 100644
--- a/ld/testsuite/ld-elf/sec64k.exp
+++ b/ld/testsuite/ld-elf/sec64k.exp
@@ -127,7 +127,11 @@ if [catch { set ofd [open "tmpdir/$test2.d" w] } x] {
return
}
foreach sfile $sfiles { puts $ofd "#source: $sfile" }
-puts $ofd "#ld:"
+if { [istarget spu*-*-*] } {
+ puts $ofd "#ld: --local-store 0:0"
+} else {
+ puts $ofd "#ld:"
+}
puts $ofd "#readelf: -W -Ss"
puts $ofd "There are 660.. section headers.*:"
puts $ofd "#..."
diff --git a/ld/testsuite/ld-scripts/empty-orphan.exp b/ld/testsuite/ld-scripts/empty-orphan.exp
index fa845e0..847e8f4 100644
--- a/ld/testsuite/ld-scripts/empty-orphan.exp
+++ b/ld/testsuite/ld-scripts/empty-orphan.exp
@@ -1,6 +1,6 @@
# Make sure orphan sections do not lead to huge output files.
# By David Heine, Tensilica, Inc.
-# Copyright 2005
+# Copyright 2005, 2006
# Free Software Foundation, Inc.
#
# This file is free software; you can redistribute it and/or modify
@@ -22,6 +22,10 @@ if ![is_elf_format] {
return
}
+if { [istarget spu*-*-*] } {
+ set LDFLAGS "--local-store 0:0"
+}
+
set testname "empty-orphan"
run_dump_test empty-orphan
diff --git a/ld/testsuite/ld-scripts/phdrs.exp b/ld/testsuite/ld-scripts/phdrs.exp
index 67af6ad..7dca555 100644
--- a/ld/testsuite/ld-scripts/phdrs.exp
+++ b/ld/testsuite/ld-scripts/phdrs.exp
@@ -1,6 +1,6 @@
# Test PHDRS in a linker script.
# By Ian Lance Taylor, Cygnus Support.
-# Copyright 1999, 2000, 2001, 2002, 2003
+# Copyright 1999, 2000, 2001, 2002, 2003, 2006
# Free Software Foundation, Inc.
#
# This file is free software; you can redistribute it and/or modify
@@ -26,6 +26,11 @@ if ![is_elf_format] {
set testname "PHDRS"
+set ldopt ""
+if { [istarget spu*-*-*] } {
+ set ldopt "--local-store 0:0"
+}
+
if ![ld_assemble $as $srcdir/$subdir/phdrs.s tmpdir/phdrs.o] {
unresolved $testname
return
@@ -40,7 +45,8 @@ if [is_elf64 tmpdir/phdrs.o] {
".*Program Header:.*PHDR *off *0x00*40 *vaddr *0x00*800040 *paddr *0x00*800040.*filesz *0x0\[0-9a-f\]* *memsz *0x0\[0-9a-f\]* flags r--.*LOAD *off *0x00* *vaddr *0x00*800000 *paddr *0x00*800000.*filesz *0x00*\[0-9a-f\]* *memsz *0x0\[0-9a-f\]* *flags r-x.*LOAD *off *0x0\[0-9a-f\]* *vaddr *0x00*80*\[0-9a-f\]* *paddr *0x00*80*\[0-9a-f\]*.*filesz *0x0\[0-9a-f\]* *memsz *0x0\[0-9a-f\]* *flags *rw-.*"
}
-if ![ld_simple_link $ld tmpdir/phdrs "-T $srcdir/$subdir/phdrs.t tmpdir/phdrs.o"] {
+set ldopt "$ldopt -T $srcdir/$subdir/phdrs.t tmpdir/phdrs.o"
+if ![ld_simple_link $ld tmpdir/phdrs $ldopt] {
fail $testname
} else {
if {[which $objdump] == 0} {
diff --git a/ld/testsuite/ld-scripts/phdrs2.exp b/ld/testsuite/ld-scripts/phdrs2.exp
index 5fbc2fa..8c41ffe 100644
--- a/ld/testsuite/ld-scripts/phdrs2.exp
+++ b/ld/testsuite/ld-scripts/phdrs2.exp
@@ -36,6 +36,11 @@ if { [istarget *-*-linux*aout*] \
set testname "PHDRS2"
+set ldopt ""
+if { [istarget spu*-*-*] } {
+ set ldopt "--local-store 0:0"
+}
+
if ![ld_assemble $as $srcdir/$subdir/phdrs2.s tmpdir/phdrs2.o] {
unresolved $testname
return
@@ -44,7 +49,8 @@ if ![ld_assemble $as $srcdir/$subdir/phdrs2.s tmpdir/phdrs2.o] {
set phdrs_regexp \
".*Program Header:.*LOAD *off *0x00\[0-9a-f\]* *vaddr *0x00*800000 *paddr *0x00*800000.*filesz *0x0\[0-9a-f\]* *memsz *0x0\[0-9a-f\]*.*LOAD *off *0x00\[0-9a-f\]* *vaddr *0x00*800004 *paddr *0x00*800004.*filesz *0x00*\[0-9a-f\]* *memsz *0x0\[0-9a-f\]* *flags rw.*"
-if ![ld_simple_link $ld tmpdir/phdrs2 "-T $srcdir/$subdir/phdrs2.t tmpdir/phdrs2.o"] {
+set ldopt "$ldopt -T $srcdir/$subdir/phdrs2.t tmpdir/phdrs2.o"
+if ![ld_simple_link $ld tmpdir/phdrs2 $ldopt] {
fail $testname
} else {
if {[which $objdump] == 0} {
diff --git a/ld/testsuite/ld-spu/ovl.d b/ld/testsuite/ld-spu/ovl.d
new file mode 100644
index 0000000..2edf985
--- /dev/null
+++ b/ld/testsuite/ld-spu/ovl.d
@@ -0,0 +1,117 @@
+#source: ovl.s
+#ld: -N -T ovl.lnk
+#objdump: -D
+
+.*elf32-spu
+
+Disassembly of section \.text:
+
+00000100 <_start>:
+ 100: 1c f8 00 81 ai \$1,\$1,-32
+ 104: 48 20 00 00 xor \$0,\$0,\$0
+ 108: 24 00 00 80 stqd \$0,0\(\$1\)
+ 10c: 24 00 40 80 stqd \$0,16\(\$1\)
+ 110: 33 00 04 00 brsl \$0,130 <f0\+0x4> # 130
+ 114: 33 00 04 80 brsl \$0,138 <f0\+0xc> # 138
+ 118: 33 00 07 00 brsl \$0,150 <f0\+0x24> # 150
+ 11c: 42 00 ac 09 ila \$9,344 # 158
+ 120: 35 20 04 80 bisl \$0,\$9
+ 124: 1c 08 00 81 ai \$1,\$1,32 # 20
+ 128: 32 7f fb 00 br 100 <_start> # 100
+
+0000012c <f0>:
+ 12c: 35 00 00 00 bi \$0
+ 130: 42 02 00 4f ila \$79,1024 # 400
+ 134: 32 00 02 80 br 148 <f0\+0x1c> # 148
+ 138: 42 02 02 4f ila \$79,1028 # 404
+ 13c: 32 00 01 80 br 148 <f0\+0x1c> # 148
+ 140: 42 02 08 4f ila \$79,1040 # 410
+ 144: 40 20 00 00 nop \$0
+ 148: 42 00 00 ce ila \$78,1
+ 14c: 32 00 0a 80 br 1a0 <__ovly_load> # 1a0
+ 150: 42 02 00 4f ila \$79,1024 # 400
+ 154: 32 00 02 80 br 168 <f0\+0x3c> # 168
+ 158: 42 02 12 4f ila \$79,1060 # 424
+ 15c: 32 00 01 80 br 168 <f0\+0x3c> # 168
+ 160: 42 02 1a 4f ila \$79,1076 # 434
+ 164: 40 20 00 00 nop \$0
+ 168: 42 00 01 4e ila \$78,2
+ 16c: 32 00 06 80 br 1a0 <__ovly_load> # 1a0
+#...
+[0-9a-f]+ <__ovly_return>:
+[0-9a-f ]+: 3f e1 00 4e shlqbyi \$78,\$0,4
+[0-9a-f ]+: 3f e2 00 4f shlqbyi \$79,\$0,8
+[0-9a-f ]+: 25 00 27 ce biz \$78,\$79
+
+[0-9a-f]+ <__ovly_load>:
+#...
+[0-9a-f]+ <_ovly_debug_event>:
+#...
+Disassembly of section \.ov_a1:
+
+00000400 <f1_a1>:
+ 400: 32 00 01 80 br 40c <f3_a1> # 40c
+
+00000404 <f2_a1>:
+ 404: 42 00 a0 03 ila \$3,320 # 140
+ 408: 35 00 00 00 bi \$0
+
+0000040c <f3_a1>:
+ 40c: 35 00 00 00 bi \$0
+
+00000410 <f4_a1>:
+ 410: 35 00 00 00 bi \$0
+ \.\.\.
+Disassembly of section \.ov_a2:
+
+00000400 <f1_a2>:
+ 400: 24 00 40 80 stqd \$0,16\(\$1\)
+ 404: 24 ff 80 81 stqd \$1,-32\(\$1\)
+ 408: 1c f8 00 81 ai \$1,\$1,-32
+ 40c: 33 7f a4 00 brsl \$0,12c <f0> # 12c
+ 410: 33 7f a4 00 brsl \$0,130 <f0\+0x4> # 130
+ 414: 33 00 03 80 brsl \$0,430 <f3_a2> # 430
+ 418: 34 00 c0 80 lqd \$0,48\(\$1\) # 30
+ 41c: 1c 08 00 81 ai \$1,\$1,32 # 20
+ 420: 35 00 00 00 bi \$0
+
+00000424 <f2_a2>:
+ 424: 41 00 00 03 ilhu \$3,0
+ 428: 60 80 b0 03 iohl \$3,352 # 160
+ 42c: 35 00 00 00 bi \$0
+
+00000430 <f3_a2>:
+ 430: 35 00 00 00 bi \$0
+
+00000434 <f4_a2>:
+ 434: 35 00 00 00 bi \$0
+ \.\.\.
+Disassembly of section .data:
+
+00000440 <_ovly_table>:
+ 440: 00 00 04 00 .*
+ 444: 00 00 00 20 .*
+ 448: 00 00 02 e0 .*
+ 44c: 00 00 00 01 .*
+ 450: 00 00 04 00 .*
+ 454: 00 00 00 40 .*
+ 458: 00 00 03 00 .*
+ 45c: 00 00 00 01 .*
+
+00000460 <_ovly_buf_table>:
+ 460: 00 00 00 00 .*
+Disassembly of section \.toe:
+
+00000470 <_EAR_>:
+ \.\.\.
+Disassembly of section \.note\.spu_name:
+
+.* <\.note\.spu_name>:
+.*: 00 00 00 08 .*
+.*: 00 00 00 0c .*
+.*: 00 00 00 01 .*
+.*: 53 50 55 4e .*
+.*: 41 4d 45 00 .*
+.*: 74 6d 70 64 .*
+.*: 69 72 2f 64 .*
+.*: 75 6d 70 00 .*
diff --git a/ld/testsuite/ld-spu/ovl.lnk b/ld/testsuite/ld-spu/ovl.lnk
new file mode 100644
index 0000000..84701d4
--- /dev/null
+++ b/ld/testsuite/ld-spu/ovl.lnk
@@ -0,0 +1,13 @@
+SECTIONS
+{
+ . = SIZEOF_HEADERS;
+ .text : { *(.text) *(.stub) }
+
+ . = 0x400;
+ .ov_a1 : { *(.ov_a1) }
+ .ov_a2 ADDR (.ov_a1) : { *(.ov_a2) }
+ . = ADDR (.ov_a1) + MAX (SIZEOF (.ov_a1), SIZEOF (.ov_a2));
+
+ .data : { *(.data) *(.ovtab) }
+ .bss : { *(.bss) }
+}
diff --git a/ld/testsuite/ld-spu/ovl.s b/ld/testsuite/ld-spu/ovl.s
new file mode 100644
index 0000000..c4bc68c
--- /dev/null
+++ b/ld/testsuite/ld-spu/ovl.s
@@ -0,0 +1,82 @@
+ .text
+ .p2align 2
+ .globl _start
+_start:
+ ai sp,sp,-32
+ xor lr,lr,lr
+ stqd lr,0(sp)
+ stqd lr,16(sp)
+ brsl lr,f1_a1
+ brsl lr,f2_a1
+ brsl lr,f1_a2
+ ila 9,f2_a2
+ bisl lr,9
+ ai sp,sp,32
+ br _start
+
+ .type f0,@function
+f0:
+ bi lr
+ .size f0,.-f0
+
+ .section .ov_a1,"ax",@progbits
+ .p2align 2
+ .global f1_a1
+ .type f1_a1,@function
+f1_a1:
+ br f3_a1
+ .size f1_a1,.-f1_a1
+
+ .global f2_a1
+ .type f2_a1,@function
+f2_a1:
+ ila 3,f4_a1
+ bi lr
+ .size f2_a1,.-f2_a1
+
+ .global f3_a1
+ .type f3_a1,@function
+f3_a1:
+ bi lr
+ .size f3_a1,.-f3_a1
+
+ .global f4_a1
+ .type f4_a1,@function
+f4_a1:
+ bi lr
+ .size f4_a1,.-f4_a1
+
+
+ .section .ov_a2,"ax",@progbits
+ .p2align 2
+ .global f1_a2
+ .type f1_a2,@function
+f1_a2:
+ stqd lr,16(sp)
+ stqd sp,-32(sp)
+ ai sp,sp,-32
+ brsl lr,f0
+ brsl lr,f1_a1
+ brsl lr,f3_a2
+ lqd lr,48(sp)
+ ai sp,sp,32
+ bi lr
+ .size f1_a2,.-f1_a2
+
+ .global f2_a2
+ .type f2_a2,@function
+f2_a2:
+ ilhu 3,f4_a2@h
+ iohl 3,f4_a2@l
+ bi lr
+ .size f2_a2,.-f2_a2
+
+ .type f3_a2,@function
+f3_a2:
+ bi lr
+ .size f3_a2,.-f3_a2
+
+ .type f4_a2,@function
+f4_a2:
+ bi lr
+ .size f4_a2,.-f4_a2
diff --git a/ld/testsuite/ld-spu/spu.exp b/ld/testsuite/ld-spu/spu.exp
new file mode 100644
index 0000000..e538f59
--- /dev/null
+++ b/ld/testsuite/ld-spu/spu.exp
@@ -0,0 +1,27 @@
+# Expect script for ld-spu tests
+# Copyright (C) 2006 Free Software Foundation
+#
+# This file is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# 51 Franklin Street - Fifth Floor, Boston, MA 02111-1307, USA.
+#
+
+if { ![istarget "spu-*-*"] } {
+ return
+}
+
+set rd_test_list [lsort [glob -nocomplain $srcdir/$subdir/*.d]]
+foreach sputest $rd_test_list {
+ verbose [file rootname $sputest]
+ run_dump_test [file rootname $sputest]
+}