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*.
This commit is contained in:
parent
7c519c12a3
commit
24d1feef42
7 changed files with 89 additions and 17 deletions
|
@ -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/.
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
|
||||
.*: file format .*-sh64
|
||||
.*: file format .*-sh64.*
|
||||
|
||||
Contents of section \.text:
|
||||
1000 cc000190 c8015590 6bf56630 6ff0fff0 .*
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue