MIPS/LD/testsuite: Rename `unaligned-syms' to `unaligned-data'
[deliverable/binutils-gdb.git] / ld / testsuite / ld-srec / srec.exp
index 5e741e09cc4ded451fa5153238c78f3faff9baa0..21d165b724061985984b84b362cd1004b2c63034 100644 (file)
@@ -1,7 +1,6 @@
 # Test linking directly to S-records.
 # By Ian Lance Taylor, Cygnus Support.
-#   Copyright 1999, 2000, 2001, 2002, 2003, 2005, 2006, 2007, 2009, 2011
-#   Free Software Foundation, Inc.
+#   Copyright (C) 1999-2016 Free Software Foundation, Inc.
 #
 # This file is part of the GNU Binutils.
 #
@@ -242,20 +241,55 @@ proc run_srec_test { test objs } {
        set flags "$flags -Ttext 0x1000"
     }
 
+    # ARM targets cannot convert format in the linker
+    # using the --oformat command line switch
+    if {[istarget aarch64*-*-*] || \
+        [istarget arm*-*-*]} {
+       setup_xfail "aarch64-*-*"
+       setup_xfail "aarch64_be-*-*"
+       setup_xfail "arm*-*-*"
+    }
+
+    # The AVR target does not correctly process
+    # relocs when output format is not ELF.
+    if [istarget avr-*-*] {
+       setup_xfail "avr-*-*"
+    }
+
+    # Epiphany needs some help too
+    if [istarget epiphany*-*-*] {
+       set flags "$flags --defsym _start=00000060"
+       setup_xfail "epiphany*-*-*"
+    }
+
+    if [istarget m681*-*-*] {
+       set flags "$flags --defsym _start=0xc000"
+       setup_xfail "m681*-*-*"
+    }
+
+    if [istarget m68hc1*-*-*] {
+       set flags "$flags --defsym _start=0xc000"
+       setup_xfail "m68hc1*-*-*"
+    }
+
+    if [istarget m9s12x*-*-*] {
+       set flags "$flags --defsym _start=0xc000"
+       setup_xfail "m9s12x*-*-*"
+    }
+
+    # MSP430 targets always relax.
+    if [istarget msp430*-*-*] {
+       setup_xfail "msp430*-*-*"
+    }
+
+    # SH64 targets cannot convert format in the linker 
+    # using the -oformat command line switch.
     if [istarget sh64*-*-elf] {
         # This is what gcc passes to ld by default.
         set flags "$flags -mshelf32"
-        # SH64 targets cannot convert format in the linker 
-        # using the -oformat command line switch.
        setup_xfail "sh64*-*-*"
     }
 
-    if {[istarget arm*-*-*]} {
-        # ARM targets cannot convert format in the linker 
-        # using the --oformat command line switch
-       setup_xfail "arm*-*-*"
-    }
-
     # V850 targets need libgcc.a
     if [istarget v850*-*-elf] {
        set objs "$objs -L ../gcc -lgcc"
@@ -266,16 +300,6 @@ proc run_srec_test { test objs } {
        set flags "$flags -no-relax"
     }
 
-    if [istarget powerpc64*-*-*] {
-       set flags "$flags --no-toc-optimize"
-    }
-
-    # Epiphany needs some help too
-    if [istarget epiphany*-*-*] {
-       set flags "$flags --defsym _start=00000060"
-       setup_xfail "epiphany*-*-*"
-    }
-
     if { ![ld_simple_link $ld tmpdir/sr1 "$flags $objs"] \
         || ![ld_simple_link $ld tmpdir/sr2.sr "$flags --oformat srec $objs"] } {
        fail $test
@@ -321,10 +345,20 @@ if { ![is_remote host] && [which $CC] == 0 } {
     return
 }
 
+# Pass -fplt to CC and CXX since -fno-plt doesn't work with S-records
+# tests.
+global PLT_CFLAGS
+set old_CC "$CC"
+set CC "$CC $PLT_CFLAGS"
+set old_CXX "$CXX"
+set CXX "$CXX $PLT_CFLAGS"
+
 if { ![ld_compile $CC $srcdir/$subdir/sr1.c tmpdir/sr1.o] \
      || ![ld_compile $CC $srcdir/$subdir/sr2.c tmpdir/sr2.o] } {
     unresolved $test1
     unresolved $test2
+    set CC "$old_CC"
+    set CXX "$old_CXX"
     return
 }
 
@@ -341,6 +375,9 @@ setup_xfail "mips*-*-irix5*" "mips*-*-irix6*" "mips*-*-linux*"
 # linkers do.
 setup_xfail "*-*-aix*" "*-*-xcoff*"
 
+# The S-record linker is not supported for ARC.
+setup_xfail "arc-*-*"
+
 # The S-record linker doesn't build ARM/Thumb stubs.
 setup_xfail "arm-*-coff"
 setup_xfail "arm-*-pe*"
@@ -385,11 +422,15 @@ run_srec_test $test1 "tmpdir/sr1.o tmpdir/sr2.o"
 
 if { ![is_remote host] && [which $CXX] == 0 } {
     untested $test2
+    set CC "$old_CC"
+    set CXX "$old_CXX"
     return
 }
 
 if ![ld_compile "$CXX $CXXFLAGS -fno-exceptions" $srcdir/$subdir/sr3.cc tmpdir/sr3.o] {
     unresolved $test2
+    set CC "$old_CC"
+    set CXX "$old_CXX"
     return
 }
 
@@ -397,6 +438,7 @@ if ![ld_compile "$CXX $CXXFLAGS -fno-exceptions" $srcdir/$subdir/sr3.cc tmpdir/s
 setup_xfail "i*86-*-aout*"
 setup_xfail "mips*-*-irix5*" "mips*-*-irix6*" "mips*-*-linux*"
 setup_xfail "*-*-aix*" "*-*-xcoff*"
+setup_xfail "arc-*-*"
 setup_xfail "arm*-*-*"
 setup_xfail "v850*-*-elf"
 setup_xfail "alpha*-*-elf*" "alpha*-*-linux-*" "alpha*-*-gnu*"
@@ -409,3 +451,6 @@ setup_xfail "bfin-*-linux-uclibc"
 setup_xfail "tile*-*-*"
 
 run_srec_test $test2 "tmpdir/sr3.o"
+
+set CC "$old_CC"
+set CXX "$old_CXX"
This page took 0.02456 seconds and 4 git commands to generate.