* config/sh/tm-sh.h (BELIEVE_PCC_PROMOTION): Define, so that
[deliverable/binutils-gdb.git] / ld / testsuite / ld-srec / srec.exp
index c7db54cd9bf2656ff5ba68c7e4560fd5641109eb..19f58de56f79260a1af38df0aa0a85eb44b10d08 100644 (file)
@@ -210,19 +210,64 @@ proc run_srec_test { test objs } {
     global sizeof_headers
     global host_triplet
 
+    set flags ""
+
     # 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
     # the same place.  We don't always use -Ttext because it interacts
     # poorly with a.out.
 
     if { $sizeof_headers } {
-       set targ "-Ttext 0x1000"
-    } else {
-       set targ ""
+       set flags "$flags -Ttext 0x1000"
+    }
+
+    # The a29k compiled code calls V_SPILL and V_FILL.  Since we don't
+    # need to run this code, but we don't have definitions for those
+    # functions, we just define them out.
+    if [istarget a29k*-*-*] {
+       set flags "$flags --defsym V_SPILL=0 --defsym V_FILL=0"
+    }
+
+    # ARM targets call __gccmain
+    if [istarget arm-*-coff] {
+       set flags "$flags --defsym ___gccmain=0"
+    }
+    if [istarget arm-*-pe] {
+       set flags "$flags --defsym ___gccmain=0"
+    }
+    if [istarget arm-*-elf] {
+       set flags "$flags --defsym ___gccmain=0"
+    }
+    
+    # Thumb targets call __gccmain
+    if [istarget thumb-*-coff] {
+       set flags "$flags --defsym ___gccmain=0"
+    }
+    if [istarget thumb-*-pe] {
+       set flags "$flags --defsym ___gccmain=0"
+    }
+    if [istarget thumb-*-*] {
+       set flags "$flags --defsym ___gccmain=0"
     }
 
-    if { ![ld_simple_link $ld tmpdir/sr1 "$targ $objs"] \
-        || ![ld_simple_link $ld tmpdir/sr2.sr "$targ -oformat srec $objs"] } {
+    # PowerPC EABI code calls __eabi.
+    if [istarget powerpc*-*-eabi*] {
+       set flags "$flags --defsym __eabi=0"
+    }
+
+    # mn10200 code calls __truncsipsi2_d0_d2.
+    if {[istarget mn10200*-*-*]} then {
+       set flags "$flags --defsym __truncsipsi2_d0_d2=0"
+    }
+
+    # V850 targets need libgcc.a
+    if [istarget v850*-*-elf] {
+       set objs "$objs -L ../gcc -lgcc"
+    }
+    
+    if { ![ld_simple_link $ld tmpdir/sr1 "$flags $objs"] \
+        || ![ld_simple_link $ld tmpdir/sr2.sr "$flags -oformat srec $objs"] } {
+       setup_xfail "hppa*-*-*elf*"
        fail $test
        return
     }
@@ -230,7 +275,7 @@ proc run_srec_test { test objs } {
     send_log "$objcopy -O srec tmpdir/sr1 tmpdir/sr1.sr\n"
     verbose "$objcopy -O srec tmpdir/sr1 tmpdir/sr1.sr"
     catch "exec $objcopy -O srec tmpdir/sr1 tmpdir/sr1.sr" exec_output
-    set exec_output [prune_system_crud $host_triplet $exec_output]
+    set exec_output [prune_warnings $exec_output]
     if ![string match "" $exec_output] {
        send_log "$exec_output\n"
        verbose "$exec_output"
@@ -276,7 +321,37 @@ if { ![ld_compile $CC $srcdir/$subdir/sr1.c tmpdir/sr1.o] \
 
 # The i386-aout target is confused: the linker does not put the
 # sections where objdump finds them.  I don't know which is wrong.
-setup_xfail "i\[345\]86-*-aout*"
+setup_xfail "i*86-*-aout*"
+
+# These tests fail on the native MIPS ELF targets because the GP value
+# in the .reginfo section is not updated when the S-record version is
+# written out.  The mips-elf target itself does not use a .reginfo section.
+setup_xfail "mips*-*-irix5*" "mips*-*-irix6*"
+
+# The S-record linker doesn't do the magic TOC handling that XCOFF
+# linkers do.
+setup_xfail "*-*-aix*" "*-*-xcoff*"
+
+# The S-record linker doesn't build ARM/Thumb stubs.
+setup_xfail "arm-*-coff*"
+setup_xfail "arm-*-pe*"
+setup_xfail "arm-*elf*"
+setup_xfail "thumb-*-coff*"
+setup_xfail "thumb-*-pe*"
+setup_xfail "thumb-*-elf*"
+
+# The S-record linker doesn't build special EABI sections.
+setup_xfail "powerpc*-*-eabi*"
+
+# The S-record linker doesn't include the .got section.
+setup_xfail "powerpc*-*-linux*"
+
+# The S-record linker doesn't include the .{zda} sections.
+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*-*-netbsd*"
 
 run_srec_test $test1 "tmpdir/sr1.o tmpdir/sr2.o"
 
@@ -295,13 +370,19 @@ if ![ld_compile "$CXX $CXXFLAGS -fgnu-linker" $srcdir/$subdir/sr3.cc tmpdir/sr3.
 }
 
 # See above.
-setup_xfail "i\[345\]86-*-aout*"
-
-# The i960 COFF targets fail this test because the i960 defaults to
-# little endian, while the srec target is big endian.  When the number
-# of entries in the constructor table is written out, the linker uses
-# the output BFD.  This seems correct, but it generates the wrong
-# result.  I don't know how to fix this.
-setup_xfail "i960*-*-coff*" "i960*-*-vxworks5.\[123456789\]*"
+setup_xfail "i*86-*-aout*"
+setup_xfail "mips*-*-irix5*" "mips*-*-irix6*"
+setup_xfail "*-*-aix*" "*-*-xcoff*"
+setup_xfail "arm-*-coff*"
+setup_xfail "arm-*-pe*"
+setup_xfail "arm-*-elf*"
+setup_xfail "thumb-*-coff*"
+setup_xfail "thumb-*-pe*"
+setup_xfail "thumb-*-elf*"
+setup_xfail "powerpc*-*-eabi*"
+setup_xfail "powerpc*-*-linux*"
+setup_xfail "v850*-*-elf"
+setup_xfail "alpha*-*-elf*" "alpha*-*-linux-gnu*" "alpha*-*-gnu*"
+setup_xfail "alpha*-*-netbsd*"
 
 run_srec_test $test2 "tmpdir/sr3.o"
This page took 0.026925 seconds and 4 git commands to generate.