aboutsummaryrefslogtreecommitdiff
path: root/ld/testsuite
diff options
context:
space:
mode:
authorStephen Clarke <stephen.clarke@earthling.net>2002-10-14 18:45:03 +0000
committerStephen Clarke <stephen.clarke@earthling.net>2002-10-14 18:45:03 +0000
commit24d1feef42cdf9fe812be0f903a312e81593cea6 (patch)
treeac2220017671855868741f5b0a6bda14b771adf0 /ld/testsuite
parent7c519c12a36a82acb25b7fa17a25f8804c8e2b90 (diff)
downloadgdb-24d1feef42cdf9fe812be0f903a312e81593cea6.zip
gdb-24d1feef42cdf9fe812be0f903a312e81593cea6.tar.gz
gdb-24d1feef42cdf9fe812be0f903a312e81593cea6.tar.bz2
ld-sh/ld-r-1.d: Disable for sh64*-*-linux*.
* ld-sh/sh64/sh64.exp: Likewise. * ld-sh/sh.exp: Disable relaxing tests for sh64*-*-linux*. * ld-sh/sh64/abi32.sd: Adjust expected output to include sh64*-*-linux* formats too. * ld-sh/sh64/relax.exp: Add emul32 variable to hold target emulation, and set it appropriately for sh*-*-linux*. * ld-sh/sh64/relfail.exp: Add variables to hold target emulation, output format, start symbol, and whether target supports 64-bit ABI. Set appropriately for sh*-*-linux*.
Diffstat (limited to 'ld/testsuite')
-rw-r--r--ld/testsuite/ChangeLog12
-rw-r--r--ld/testsuite/ld-sh/ld-r-1.d1
-rw-r--r--ld/testsuite/ld-sh/sh.exp3
-rw-r--r--ld/testsuite/ld-sh/sh64/abi32.sd2
-rw-r--r--ld/testsuite/ld-sh/sh64/relax.exp21
-rw-r--r--ld/testsuite/ld-sh/sh64/relfail.exp63
-rw-r--r--ld/testsuite/ld-sh/sh64/sh64.exp4
7 files changed, 89 insertions, 17 deletions
diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog
index 02f1d73..734244f 100644
--- a/ld/testsuite/ChangeLog
+++ b/ld/testsuite/ChangeLog
@@ -1,3 +1,15 @@
+2002-10-14 Stephen Clarke <stephen.clarke@superh.com>
+ * ld-sh/ld-r-1.d: Disable for sh64*-*-linux*.
+ * ld-sh/sh64/sh64.exp: Likewise.
+ * ld-sh/sh.exp: Disable relaxing tests for sh64*-*-linux*.
+ * ld-sh/sh64/abi32.sd: Adjust expected output to include
+ sh64*-*-linux* formats too.
+ * ld-sh/sh64/relax.exp: Add emul32 variable to hold target
+ emulation, and set it appropriately for sh*-*-linux*.
+ * ld-sh/sh64/relfail.exp: Add variables to hold target
+ emulation, output format, start symbol, and whether target
+ supports 64-bit ABI. Set appropriately for sh*-*-linux*.
+
2002-10-12 H.J. Lu (hjl@gnu.org)
* ld-discard/extern.d: Remove $srcdir/$subdir/.
diff --git a/ld/testsuite/ld-sh/ld-r-1.d b/ld/testsuite/ld-sh/ld-r-1.d
index 78600c2..7bcd479 100644
--- a/ld/testsuite/ld-sh/ld-r-1.d
+++ b/ld/testsuite/ld-sh/ld-r-1.d
@@ -4,6 +4,7 @@
#ld: -r -EL
#readelf: -r -x1 -x2
#target: sh*-*-elf sh*-*-linux*
+#notarget: sh64*-*-linux*
# Make sure relocations against global and local symbols with relative and
# absolute 32-bit relocs don't come out wrong after ld -r. Remember that
diff --git a/ld/testsuite/ld-sh/sh.exp b/ld/testsuite/ld-sh/sh.exp
index 38b6e73..d3bf8c8 100644
--- a/ld/testsuite/ld-sh/sh.exp
+++ b/ld/testsuite/ld-sh/sh.exp
@@ -25,7 +25,8 @@ if ![istarget sh*-*-*] {
return
}
-if [istarget sh64-*-elf] {
+if { ([istarget sh64-*-elf]
+ || [istarget sh64*-*-linux*])} {
# relaxing not supported on sh64 yet.
return
}
diff --git a/ld/testsuite/ld-sh/sh64/abi32.sd b/ld/testsuite/ld-sh/sh64/abi32.sd
index 7baeda6..27c2b89 100644
--- a/ld/testsuite/ld-sh/sh64/abi32.sd
+++ b/ld/testsuite/ld-sh/sh64/abi32.sd
@@ -1,5 +1,5 @@
-.*: file format .*-sh64
+.*: file format .*-sh64.*
Contents of section \.text:
1000 cc000190 c8015590 6bf56630 6ff0fff0 .*
diff --git a/ld/testsuite/ld-sh/sh64/relax.exp b/ld/testsuite/ld-sh/sh64/relax.exp
index 18cafea..772a423 100644
--- a/ld/testsuite/ld-sh/sh64/relax.exp
+++ b/ld/testsuite/ld-sh/sh64/relax.exp
@@ -33,19 +33,25 @@ if ![istarget sh64-*-*] {
# 1/0 whether relaxing should have been done or not, or -1 if we expect
# the linker to not produce an output file.
+if [istarget sh64*-*-linux*] {
+ set emul32 "shlelf32_linux"
+} else {
+ set emul32 "shelf32"
+}
+
set sh64relaxtests {
{"SH64 not relaxing, shcompact"
- {"-relax -isa shcompact" "n/a" "n/a" "n/a"} "-mshelf32" 0}
+ {"-relax -isa shcompact" "n/a" "n/a" "n/a"} "-m$emul32" 0}
{"SH64 relaxing, shcompact"
- {"-relax -isa shcompact" "n/a" "n/a" "n/a"} "-relax -mshelf32" 1}
+ {"-relax -isa shcompact" "n/a" "n/a" "n/a"} "-relax -m$emul32" 1}
{"SH64 relaxing, shcompacts"
- {"-relax -isa shcompact" "-isa shcompact" "n/a" "n/a"} "-relax -mshelf32" 1}
+ {"-relax -isa shcompact" "-isa shcompact" "n/a" "n/a"} "-relax -m$emul32" 1}
{"SH64 relaxing disabled, shmedia"
- {"-relax -isa shcompact" "-isa shmedia -no-mix" "n/a" "n/a"} "-relax -mshelf32" 0}
+ {"-relax -isa shcompact" "-isa shmedia -no-mix" "n/a" "n/a"} "-relax -m$emul32" 0}
{"SH64 relaxing disabled, mixed"
- {"-relax -isa shcompact" "n/a" "-isa shcompact" "n/a"} "-relax -mshelf32" 0}
+ {"-relax -isa shcompact" "n/a" "-isa shcompact" "n/a"} "-relax -m$emul32" 0}
{"SH64 relaxing disabled, cranges"
- {"-relax -isa shcompact" "n/a" "n/a" ""} "-relax -mshelf32" 0}
+ {"-relax -isa shcompact" "n/a" "n/a" ""} "-relax -m$emul32" 0}
}
proc run_sh64relaxtest {sh64relaxtests} {
@@ -56,6 +62,7 @@ proc run_sh64relaxtest {sh64relaxtests} {
global readelf
global srcdir
global subdir
+ global emul32
set testindex 0
@@ -66,7 +73,7 @@ proc run_sh64relaxtest {sh64relaxtests} {
foreach testentry $sh64relaxtests {
set testname [lindex $testentry 0]
set as_options [lindex $testentry 1]
- set ld_options [lindex $testentry 2]
+ set ld_options [subst [lindex $testentry 2]]
set expect_relaxed [lindex $testentry 3]
set is_unresolved 0
diff --git a/ld/testsuite/ld-sh/sh64/relfail.exp b/ld/testsuite/ld-sh/sh64/relfail.exp
index 6b3ef0b..713d9e9 100644
--- a/ld/testsuite/ld-sh/sh64/relfail.exp
+++ b/ld/testsuite/ld-sh/sh64/relfail.exp
@@ -22,12 +22,26 @@ if ![istarget sh64-*-*] {
return
}
+if [istarget sh64-*-linux*] {
+ set emul32 "shlelf32_linux"
+ set oformat32 "elf32-sh64-linux"
+ set startsym "_start"
+ set doabi64 0
+} else {
+ set emul32 "shelf32"
+ set oformat32 "elf32-sh64"
+ set startsym "start"
+ set doabi64 1
+ set emul64 "shelf64"
+ set oformat64 "elf64-sh64"
+}
+
# opcode, asflags, ldflags, expected or "" for fail
# opcode blank means rebuild relfail.o and set default as/ld options
-set sh64relfailtests {
+set sh64abi32relfailtests {
- { "" "-isa=shcompact -abi=32" "-m shelf32 --oformat elf32-sh" "" }
+ { "" "-isa=shcompact -abi=32" "-m $emul32 -Ttext 0x1000 --oformat $oformat32" "" }
{ "mov.l lab,r0;.align 3;lab:nop" "" "" "mov.l 1008" }
{ "mov.l to0,r0" "" "" "mov.l 1010" }
{ "mov.l to1,r0" "" "" "" }
@@ -35,7 +49,32 @@ set sh64relfailtests {
{ "mov.l to3,r0" "" "" "" }
{ "mov.l to4,r0" "" "" "mov.l 1014" }
- { "" "-isa=shmedia -abi=64 -no-expand" "-m shelf64 --oformat elf64-sh64" "" }
+ { "" "-isa=shmedia -abi=32 -no-expand" "-m $emul32 -Ttext 0x1000 --oformat $oformat32" "" }
+ { "pta lab,tr0;.align 3;lab:nop" "" "" "pta.*1008" }
+
+ { "ld.q r0,datalabel to0 - 0x1000,r0" "" "" "ld.q.*,16," }
+ { "ld.q r0,datalabel to1 - 0x1000,r0" "" "" "" }
+ { "ld.q r0,datalabel to2 - 0x1000,r0" "" "" "" }
+ { "ld.q r0,datalabel to3 - 0x1000,r0" "" "" "" }
+ { "ld.q r0,datalabel to4 - 0x1000,r0" "" "" "" }
+
+ { "ld.l r0,datalabel to0 - 0x1000,r0" "" "" "ld.l.*,16," }
+ { "ld.l r0,datalabel to1 - 0x1000,r0" "" "" "" }
+ { "ld.l r0,datalabel to2 - 0x1000,r0" "" "" "" }
+ { "ld.l r0,datalabel to3 - 0x1000,r0" "" "" "" }
+ { "ld.l r0,datalabel to4 - 0x1000,r0" "" "" "ld.l.*,20," }
+
+ { "ld.w r0,datalabel to0 - 0x1000,r0" "" "" "ld.w.*,16," }
+ { "ld.w r0,datalabel to1 - 0x1000,r0" "" "" "" }
+ { "ld.w r0,datalabel to2 - 0x1000,r0" "" "" "ld.w.*,18," }
+ { "ld.w r0,datalabel to3 - 0x1000,r0" "" "" "" }
+ { "ld.w r0,datalabel to4 - 0x1000,r0" "" "" "ld.w.*,20," }
+
+}
+
+set sh64abi64relfailtests {
+
+ { "" "-isa=shmedia -abi=64 -no-expand" "-m $emul64 -Ttext 0x1000 --oformat $oformat64" "" }
{ "pta lab,tr0;.align 3;lab:nop" "" "" "pta.*1008" }
{ "pta datalabel to0,tr0" "" "" "pta.*1010" }
{ "pta datalabel to1,tr0" "" "" "pta.*1011" }
@@ -71,14 +110,19 @@ proc run_sh64relfailtests {sh64relfailtests} {
global readelf
global srcdir
global subdir
+ global emul32
+ global emul64
+ global oformat32
+ global oformat64
+ global startsym
set testindex 0
set is_unresolved 0
-
+
foreach testentry $sh64relfailtests {
set opcode [lindex $testentry 0]
set as_options [lindex $testentry 1]
- set ld_options [lindex $testentry 2]
+ set ld_options [subst [lindex $testentry 2]]
set expect_fail [lindex $testentry 3]
set testname "SH64 relfail $opcode $as_options $ld_options"
@@ -112,8 +156,8 @@ proc run_sh64relfailtests {sh64relfailtests} {
set asm [open "tmpdir/relfail-$testindex.s" "w"]
puts $asm " .text"
- puts $asm " .global start"
- puts $asm "start:"
+ puts $asm " .global $startsym"
+ puts $asm "$startsym:"
puts $asm " $opcode";
close $asm
@@ -159,4 +203,7 @@ proc run_sh64relfailtests {sh64relfailtests} {
}
}
-run_sh64relfailtests $sh64relfailtests
+run_sh64relfailtests $sh64abi32relfailtests
+if {$doabi64} {
+ run_sh64relfailtests $sh64abi64relfailtests
+}
diff --git a/ld/testsuite/ld-sh/sh64/sh64.exp b/ld/testsuite/ld-sh/sh64/sh64.exp
index 557542d..9bdead4 100644
--- a/ld/testsuite/ld-sh/sh64/sh64.exp
+++ b/ld/testsuite/ld-sh/sh64/sh64.exp
@@ -23,6 +23,10 @@ if ![istarget sh64-*-*] {
return
}
+if [istarget sh64*-*-linux*] {
+ return
+}
+
# List contains test-items with 3 items followed by 2 lists:
# 0:name 1:ld options 2:assembler options
# 3:filenames of assembler files 4: action and options. 5: name of output file