summaryrefslogtreecommitdiff
path: root/ld/testsuite/ld-sh/sh.exp
diff options
context:
space:
mode:
Diffstat (limited to 'ld/testsuite/ld-sh/sh.exp')
-rw-r--r--ld/testsuite/ld-sh/sh.exp6
1 files changed, 4 insertions, 2 deletions
diff --git a/ld/testsuite/ld-sh/sh.exp b/ld/testsuite/ld-sh/sh.exp
index 5d3d5d4de77b..5fb6762d05d6 100644
--- a/ld/testsuite/ld-sh/sh.exp
+++ b/ld/testsuite/ld-sh/sh.exp
@@ -62,8 +62,10 @@ if ![ld_assemble $as "-relax $srcdir/$subdir/sh1.s" tmpdir/sh1.o] {
set testsrec "SH relaxing to S-records"
-if [istarget sh*-linux-*] {
- # This target needs the explicit entry address.
+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
+ # by feeding the ELF start address to the srec link line.
catch "exec $objdump -x tmpdir/sh1 | grep start\\ address | sed s/start\\ address//" entry_addr
set srec_relax_arg "-Ttext $entry_addr -relax --oformat srec tmpdir/sh1.o"
} else {