For sh-*-linux-gnu target add a start address for the text section.
authorNick Clifton <nickc@redhat.com>
Mon, 28 May 2001 10:55:23 +0000 (10:55 +0000)
committerNick Clifton <nickc@redhat.com>
Mon, 28 May 2001 10:55:23 +0000 (10:55 +0000)
ld/testsuite/ChangeLog
ld/testsuite/ld-sh/sh.exp

index e590148d493ca700d5ad901899453a614f4e7d56..7dd9075c06d09572d7413d544f124535afe7504f 100644 (file)
@@ -1,3 +1,8 @@
+2001-05-28  kaz Kojima  <kkojima@rr.iij4u.or.jp>
+
+       * ld-sh/sh.exp: For sh-*-linux-gnu target add a start address for
+       the text section.
+
 2001-05-25  Alan Modra  <amodra@one.net.au>
 
        * ld-elfvers/vers.exp: Replace linuxoldld with linux*oldld and
index 41ca8095edff4d24368a28ba382792d8989fcfa3..437f7ce588b14ce93d6f9fc6fc8cf8e53bd1ba78 100644 (file)
@@ -56,7 +56,14 @@ if ![ld_assemble $as "-relax $srcdir/$subdir/sh1.s" tmpdir/sh1.o] {
 
 set testsrec "SH relaxing to S-records"
 
-if ![ld_simple_link $ld tmpdir/sh1.s1 "-relax --oformat srec tmpdir/sh1.o"] {
+if [istarget sh*-linux-gnu] {
+    # This target needs the explicit entry address.
+    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 {
+    set srec_relax_arg "-relax --oformat srec tmpdir/sh1.o"
+}
+if ![ld_simple_link $ld tmpdir/sh1.s1 $srec_relax_arg ] {
     fail $testsrec
 } else {
     # The file name is embedded in the S-records, so create both