+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/.
# 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} {
global readelf
global srcdir
global subdir
+ global emul32
set testindex 0
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
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" "" "" "" }
{ "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" }
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"
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
}
}
-run_sh64relfailtests $sh64relfailtests
+run_sh64relfailtests $sh64abi32relfailtests
+if {$doabi64} {
+ run_sh64relfailtests $sh64abi64relfailtests
+}