daily update
[external/binutils.git] / ld / testsuite / ld-sh / sh.exp
index a107421..66bdc39 100644 (file)
@@ -1,19 +1,23 @@
 # Expect script for ld-sh tests
-#   Copyright 1995, 1996, 1997, 2001 Free Software Foundation, Inc.
+#   Copyright 1995, 1996, 1997, 2001, 2002, 2003, 2007
+#   Free Software Foundation, Inc.
 #
-# This file is free software; you can redistribute it and/or modify
+# This file is part of the GNU Binutils.
+#
+# This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
+# the Free Software Foundation; either version 3 of the License, or
 # (at your option) any later version.
-# 
+#
 # This program is distributed in the hope that it will be useful,
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
-# 
+#
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
+# MA 02110-1301, USA.
 #
 # Written by Ian Lance Taylor (ian@cygnus.com)
 #
@@ -61,8 +65,10 @@ if ![ld_assemble $as "-relax $srcdir/$subdir/sh1.s" tmpdir/sh1.o] {
 
 set testsrec "SH relaxing to S-records"
 
-if [istarget sh*-linux-gnu] {
-    # 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 {
@@ -116,7 +122,7 @@ if { [which $CC] == 0 } {
     return
 }
 
-if [istarget sh*-linux-gnu] {
+if [istarget sh*-linux-*] {
     exec sed -e s/_main/main/ -e s/_trap/trap/ -e s/_stack/stack/ \
            < $srcdir/$subdir/start.s >tmpdir/start.s
 } else {