Replace linux-gnu with linux-* to allow for versions of Linux which do not use
[binutils-gdb.git] / ld / testsuite / ld-srec / srec.exp
index a965c22bbd41616496fa403dad93859eb9a056a6..3b45a29c19b105b7e41694cc3c5cfd0d77245b8c 100644 (file)
@@ -1,6 +1,6 @@
 # Test linking directly to S-records.
 # By Ian Lance Taylor, Cygnus Support.
-#   Copyright 2001, 2002, 2003
+#   Copyright 1999, 2000, 2001, 2002, 2003
 #   Free Software Foundation, Inc.
 #
 # This file is free software; you can redistribute it and/or modify
@@ -15,7 +15,7 @@
 # 
 # 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.
 
 # Get the offset from an S-record line to the start of the data.
 
@@ -281,20 +281,28 @@ proc run_srec_test { test objs } {
     if {[istarget m6811-*-*] || [istarget m6812-*-*]} {
        set flags "$flags --defsym _.frame=0 --defsym _.d1=0 --defsym _.d2=0"
        set flags "$flags --defsym _.d3=0 --defsym _.d4=0"
-       set flags "$flags --defsym _.tmp=0 --defsym _.xy=0"
+       set flags "$flags --defsym _.tmp=0 --defsym _.xy=0 --defsym _.z=0"
     }
 
     # V850 targets need libgcc.a
     if [istarget v850*-*-elf] {
        set objs "$objs -L ../gcc -lgcc"
     }
-    
+
+    # Xtensa ELF targets relax by default; S-Record linker does not
+    if [istarget xtensa*-*-*] {
+       set flags "$flags -no-relax"
+    }
+
+    # Some OpenBSD targets have ProPolice and reference __guard and
+    # __stack_smash_handler.
+    if [istarget *-*-openbsd*] {
+       set flags "$flags --defsym __guard=0"
+       set flags "$flags --defsym __stack_smash_handler=0"
+    }
+
     if { ![ld_simple_link $ld tmpdir/sr1 "$flags $objs"] \
         || ![ld_simple_link $ld tmpdir/sr2.sr "$flags --oformat srec $objs"] } {
-       # PowerPc64 srec linker can't handle .toc relocations.
-       setup_xfail "powerpc64*-*-*"
-       setup_xfail "powerpc*-*-*64*"
-       setup_xfail "hppa*-*-*elf*"
        fail $test
        return
     }
@@ -377,12 +385,15 @@ setup_xfail "arm*-*-linux*"
 setup_xfail "v850*-*-elf"
 
 # The S-record linker doesn't handle Alpha Elf relaxation.
-setup_xfail "alpha*-*-elf*" "alpha*-*-linux-gnu*" "alpha*-*-gnu*"
+setup_xfail "alpha*-*-elf*" "alpha*-*-linux-*" "alpha*-*-gnu*"
 setup_xfail "alpha*-*-netbsd*"
 
 # The S-record linker hasn't any hope of coping with HPPA relocs.
 setup_xfail "hppa*-*-*"
 
+# The S-record linker doesn't handle IA64 Elf relaxation.
+setup_xfail "ia64-*-*"
+
 # The S-record linker doesn't support the special PE headers - the PE
 # emulation tries to write pe-specific information to the PE headers
 # in the output bfd, but it's not a PE bfd (it's an srec bfd)
@@ -399,7 +410,7 @@ if { [which $CXX] == 0 } {
     return
 }
 
-if ![ld_compile "$CXX $CXXFLAGS -fgnu-linker -fno-exceptions" $srcdir/$subdir/sr3.cc tmpdir/sr3.o] {
+if ![ld_compile "$CXX $CXXFLAGS -fno-exceptions" $srcdir/$subdir/sr3.cc tmpdir/sr3.o] {
     unresolved $test2
     return
 }
@@ -413,9 +424,10 @@ setup_xfail "strongarm*-*-*"
 setup_xfail "thumb-*-*"
 setup_xfail "powerpc*-*-eabi*"
 setup_xfail "v850*-*-elf"
-setup_xfail "alpha*-*-elf*" "alpha*-*-linux-gnu*" "alpha*-*-gnu*"
+setup_xfail "alpha*-*-elf*" "alpha*-*-linux-*" "alpha*-*-gnu*"
 setup_xfail "alpha*-*-netbsd*"
 setup_xfail "hppa*-*-*"
+setup_xfail "ia64-*-*"
 setup_xfail "*-*-cygwin*" "*-*-mingw*" "*-*-pe*" "*-*-winnt*"
 
 run_srec_test $test2 "tmpdir/sr3.o"