X-Git-Url: https://oss.titaniummirror.com/gitweb?p=msp430-binutils.git;a=blobdiff_plain;f=ld%2Ftestsuite%2Fld-srec%2Fsrec.exp;fp=ld%2Ftestsuite%2Fld-srec%2Fsrec.exp;h=0a3dc4440810dffe5c70c7e2611833a01c5fae91;hp=c40161a574fea776110a56bca9cb17d8c4679c0f;hb=88750007d7869f178f0ba528f41efd3b74c424cf;hpb=6df9443a374e2b81278c61b8afc0a1eef7db280b diff --git a/ld/testsuite/ld-srec/srec.exp b/ld/testsuite/ld-srec/srec.exp index c40161a..0a3dc44 100644 --- a/ld/testsuite/ld-srec/srec.exp +++ b/ld/testsuite/ld-srec/srec.exp @@ -1,6 +1,6 @@ # Test linking directly to S-records. # By Ian Lance Taylor, Cygnus Support. -# Copyright 1999, 2000, 2001, 2002, 2003, 2006, 2007 +# Copyright 1999, 2000, 2001, 2002, 2003, 2005, 2006, 2007, 2009 # Free Software Foundation, Inc. # # This file is part of the GNU Binutils. @@ -229,8 +229,9 @@ proc run_srec_test { test objs } { global host_triplet # Tell the ELF linker to not do anything clever with .eh_frame, - # and not to put anything in small data. - set flags "--traditional-format -G 0" + # not to put anything in small data, and define various symbols. + set flags "--traditional-format -G 0 " + append flags [ld_simple_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 @@ -243,7 +244,7 @@ proc run_srec_test { test objs } { if [istarget sh64*-*-elf] { # This is what gcc passes to ld by default. - set flags "-mshelf32" + set flags "$flags -mshelf32" # SH64 targets cannot convert format in the linker # using the -oformat command line switch. setup_xfail "sh64*-*-*" @@ -253,10 +254,6 @@ proc run_srec_test { test objs } { [istarget strongarm*-*-*] || \ [istarget xscale*-*-*] || \ [istarget thumb-*-*] } { - - # ARM targets call __gccmain - set flags "$flags --defsym __gccmain=0" - # ARM targets cannot convert format in the linker # using the --oformat command line switch setup_xfail "*arm*-*-*" @@ -264,23 +261,6 @@ proc run_srec_test { test objs } { setup_xfail "thumb-*-*" } - # 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" - } - - # m6811/m6812 code has references to soft registers. - 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 --defsym _.z=0" - } - # V850 targets need libgcc.a if [istarget v850*-*-elf] { set objs "$objs -L ../gcc -lgcc" @@ -291,13 +271,6 @@ proc run_srec_test { test objs } { 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"] } { fail $test @@ -305,8 +278,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 [run_host_cmd "$objcopy" "-O srec tmpdir/sr1 tmpdir/sr1.sr"] set exec_output [prune_warnings $exec_output] if ![string match "" $exec_output] { send_log "$exec_output\n" @@ -330,7 +302,7 @@ set test1 "S-records" set test2 "S-records with constructors" # See whether the default linker script uses SIZEOF_HEADERS. -catch "exec $ld --verbose" exec_output +set exec_output [run_host_cmd "$ld" "--verbose"] set sizeof_headers [string match "*SIZEOF_HEADERS*" $exec_output] # First test linking a C program. We don't require any libraries. We @@ -338,7 +310,7 @@ set sizeof_headers [string match "*SIZEOF_HEADERS*" $exec_output] # directly to the S-record format, and require that the two files # contain the same data. -if { [which $CC] == 0 } { +if { ![is_remote host] && [which $CC] == 0 } { untested $test1 untested $test2 return @@ -383,7 +355,8 @@ 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*-*-*" +# Or MeP complex relocs. +setup_xfail "hppa*-*-*" "mep-*-*" # The S-record linker doesn't handle IA64 Elf relaxation. setup_xfail "ia64-*-*" @@ -394,13 +367,16 @@ setup_xfail "ia64-*-*" setup_xfail "*-*-cygwin*" "*-*-mingw*" "*-*-pe*" "*-*-winnt*" setup_xfail "score-*-*" +# The S-record linker doesn't support Blackfin ELF FDPIC ABI. +setup_xfail "bfin-*-linux-uclibc" + run_srec_test $test1 "tmpdir/sr1.o tmpdir/sr2.o" # Now try linking a C++ program with global constructors and # destructors. Note that since we are not linking against any # libraries, this program won't actually work or anything. -if { [which $CXX] == 0 } { +if { ![is_remote host] && [which $CXX] == 0 } { untested $test2 return } @@ -420,9 +396,10 @@ setup_xfail "thumb-*-*" setup_xfail "v850*-*-elf" setup_xfail "alpha*-*-elf*" "alpha*-*-linux-*" "alpha*-*-gnu*" setup_xfail "alpha*-*-netbsd*" -setup_xfail "hppa*-*-*" +setup_xfail "hppa*-*-*" "mep-*-*" setup_xfail "ia64-*-*" setup_xfail "*-*-cygwin*" "*-*-mingw*" "*-*-pe*" "*-*-winnt*" setup_xfail "score-*-*" +setup_xfail "bfin-*-linux-uclibc" run_srec_test $test2 "tmpdir/sr3.o"