SH gas configure and ld tests

All current SH gas targets use BFD.  sh-coff was incorrectly reported
as unsupported.

gas/
	* configure.tgt: Set bfd_gas for all SH targets.
ld/
	* testsuite/ld-sh/sh.exp: Don't run relax tests for non-ELF.
	Fail when ld_assemble fails.  Use elseif to reduce indentation.
This commit is contained in:
Alan Modra 2020-06-20 10:41:40 +09:30
parent 17fc27167f
commit e2201c2a57
4 changed files with 78 additions and 68 deletions

View File

@ -1,3 +1,7 @@
2020-06-20 Alan Modra <amodra@gmail.com>
* configure.tgt: Set bfd_gas for all SH targets.
2020-06-18 Jan Beulich <jbeulich@suse.com>
* testsuite/gas/i386/arch-13.s: Add alternative VMGEXIT case.

View File

@ -386,7 +386,7 @@ case ${generic_target} in
sh-*-uclinux* | sh[12]-*-uclinux*) fmt=elf em=uclinux ;;
sh-*-coff*) fmt=coff ;;
sh-*-nto*) fmt=elf ;;
sh-*-pe*) fmt=coff em=pe bfd_gas=yes endian=little ;;
sh-*-pe*) fmt=coff em=pe endian=little ;;
sh-*-kaos*) fmt=elf ;;
shle*-*-kaos*) fmt=elf ;;
@ -437,7 +437,8 @@ case ${generic_target} in
esac
case ${cpu_type} in
aarch64 | alpha | arm | csky | i386 | ia64 | microblaze | mips | ns32k | or1k | or1knd | pdp11 | ppc | riscv | sparc | z80 | z8k)
aarch64 | alpha | arm | csky | i386 | ia64 | microblaze | mips | ns32k | \
or1k | or1knd | pdp11 | ppc | riscv | sh | sparc | z80 | z8k)
bfd_gas=yes
;;
esac

View File

@ -1,3 +1,8 @@
2020-06-20 Alan Modra <amodra@gmail.com>
* testsuite/ld-sh/sh.exp: Don't run relax tests for non-ELF.
Fail when ld_assemble fails. Use elseif to reduce indentation.
2020-06-19 Alan Modra <amodra@gmail.com>
* testsuite/ld-elf/dynamic-1.rd: Accept st_other notations.

View File

@ -30,21 +30,20 @@ if ![istarget sh*-*-*] {
set testsimple "SH simple relaxing"
if ![ld_assemble $as "-relax $srcdir/$subdir/sh1.s" tmpdir/sh1.o] {
if { ![is_elf_format] } {
unresolved $testsimple
} else { if ![ld_link $ld tmpdir/sh1 "-relax tmpdir/sh1.o"] {
} elseif { ![ld_assemble $as "-relax $srcdir/$subdir/sh1.s" tmpdir/sh1.o] } {
fail $testsimple
} else {
if ![ld_nm $nm "" tmpdir/sh1] {
unresolved $testsimple
} else {
if {![info exists nm_output(bar)] \
} elseif { ![ld_link $ld tmpdir/sh1 "-relax tmpdir/sh1.o"] } {
fail $testsimple
} elseif { ![ld_nm $nm "" tmpdir/sh1] } {
fail $testsimple
} elseif { ![info exists nm_output(bar)]
|| ![info exists nm_output(foo)]} {
send_log "bad output from nm\n"
verbose "bad output from nm"
fail $testsimple
} else {
if {$nm_output(bar) != $nm_output(foo) + 0xc} {
} elseif {$nm_output(bar) != $nm_output(foo) + 0xc} {
send_log "foo == $nm_output(foo)\n"
verbose "foo == $nm_output(foo)"
send_log "bar == $nm_output(bar)\n"
@ -53,12 +52,12 @@ if ![ld_assemble $as "-relax $srcdir/$subdir/sh1.s" tmpdir/sh1.o] {
} else {
pass $testsimple
}
}
}
} }
set testsrec "SH relaxing to S-records"
if { ![remote_file host exists tmpdir/sh1] } {
unresolved $testsrec
} else {
if { [istarget sh*-linux-*] || [istarget sh-*-vxworks] } {
# On these "non-embedded" targets, the default ELF and srec start
# addresses will be SIZEOF_HEADERS bytes apart. Ensure consistency
@ -104,12 +103,14 @@ if ![ld_link $ld tmpdir/sh1.s1 $srec_relax_arg ] {
}
}
}
}
set testadjsw8 "SH switch8 adjustment after relax"
if ![ld_assemble $as "-relax $srcdir/$subdir/adjsw8.s" tmpdir/adjsw8.o] {
if { ![is_elf_format] } {
unresolved $testadjsw8
} else {
if ![ld_link $ld tmpdir/adjsw8 "-relax tmpdir/adjsw8.o"] {
} elseif { ![ld_assemble $as "-relax $srcdir/$subdir/adjsw8.s" tmpdir/adjsw8.o] } {
fail $testadjsw8
} elseif { ![ld_link $ld tmpdir/adjsw8 "-relax tmpdir/adjsw8.o"] } {
fail $testadjsw8
} else {
send_log "exec $objdump -s tmpdir/adjsw8\n"
@ -123,7 +124,6 @@ if ![ld_assemble $as "-relax $srcdir/$subdir/adjsw8.s" tmpdir/adjsw8.o] {
fail $testadjsw8
}
}
}
set testlink "SH relaxing"
set testjsr "SH confirm relaxing"