Add support for the C_SKY series of processors.
[deliverable/binutils-gdb.git] / ld / testsuite / ld-srec / srec.exp
index 10b0a5134796a9143d091f76af69009044ebed39..d155c18f2c77a700801a410cef509f3ddf73499d 100644 (file)
@@ -1,6 +1,6 @@
 # Test linking directly to S-records.
 # By Ian Lance Taylor, Cygnus Support.
-#   Copyright (C) 1999-2016 Free Software Foundation, Inc.
+#   Copyright (C) 1999-2018 Free Software Foundation, Inc.
 #
 # This file is part of the GNU Binutils.
 #
@@ -229,8 +229,8 @@ proc run_srec_test { test objs } {
 
     # Tell the ELF linker to not do anything clever with .eh_frame,
     # not to put anything in small data, and define various symbols.
-    set flags "--traditional-format -G 0 "
-    append flags [ld_simple_link_defsyms]
+    set flags "--traditional-format -G 0 -e 0 "
+    append flags [ld_link_defsyms]
 
     # If the linker script uses SIZEOF_HEADERS, use a -Ttext argument
     # to force both the normal link and the S-record link to be put in
@@ -282,12 +282,10 @@ proc run_srec_test { test objs } {
        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"
-       setup_xfail "sh64*-*-*"
+    # The RISC-V target does not correctly process
+    # relocs when output format is not ELF.
+    if [istarget riscv*-*-*] {
+       setup_xfail "riscv*-*-*"
     }
 
     # V850 targets need libgcc.a
@@ -305,8 +303,8 @@ proc run_srec_test { test objs } {
        set flags "$flags -no-relax"
     }
 
-    if { ![ld_simple_link $ld tmpdir/sr1 "$flags $objs"] \
-        || ![ld_simple_link $ld tmpdir/sr2.sr "$flags --oformat srec $objs"] } {
+    if { ![ld_link $ld tmpdir/sr1 "$flags $objs"] \
+        || ![ld_link $ld tmpdir/sr2.sr "$flags --oformat srec $objs"] } {
        fail $test
        return
     }
@@ -351,12 +349,13 @@ if { ![is_remote host] && [which $CC] == 0 } {
 }
 
 # Pass -fplt to CC and CXX since -fno-plt doesn't work with S-records
-# tests.
-global PLT_CFLAGS
+# tests. Also add $NOPIE_CFLAGS and $NOPIE_LDFLAGS if PIE doesn't work
+# with S-records.
+global PLT_CFLAGS NOPIE_CFLAGS NOPIE_LDFLAGS
 set old_CC "$CC"
-set CC "$CC $PLT_CFLAGS"
+set CC "$CC $PLT_CFLAGS $NOPIE_CFLAGS $NOPIE_LDFLAGS"
 set old_CXX "$CXX"
-set CXX "$CXX $PLT_CFLAGS"
+set CXX "$CXX $PLT_CFLAGS $NOPIE_CFLAGS $NOPIE_LDFLAGS"
 
 if { ![ld_compile $CC $srcdir/$subdir/sr1.c tmpdir/sr1.o] \
      || ![ld_compile $CC $srcdir/$subdir/sr2.c tmpdir/sr2.o] } {
@@ -419,6 +418,9 @@ setup_xfail "bfin-*-linux-uclibc"
 # generate the format if need be).
 setup_xfail "tile*-*-*"
 
+# The S-record linker is not supported for C-SKY.
+setup_xfail "csky*-*-*"
+
 run_srec_test $test1 "tmpdir/sr1.o tmpdir/sr2.o"
 
 # Now try linking a C++ program with global constructors and
@@ -454,6 +456,7 @@ setup_xfail "*-*-cygwin*" "*-*-mingw*" "*-*-pe*" "*-*-winnt*"
 setup_xfail "score-*-*"
 setup_xfail "bfin-*-linux-uclibc"
 setup_xfail "tile*-*-*"
+setup_xfail "csky*-*-*"
 
 run_srec_test $test2 "tmpdir/sr3.o"
 
This page took 0.027042 seconds and 4 git commands to generate.