unit at a time
[platform/upstream/binutils.git] / ld / testsuite / ld-selective / selective.exp
index b563d35..274394e 100644 (file)
@@ -1,6 +1,5 @@
 # Expect script for LD selective linking tests
-#   Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009
-#   Free Software Foundation, Inc.
+#   Copyright (C) 1998-2014 Free Software Foundation, Inc.
 #
 # This file is part of the GNU Binutils.
 #
 # Make sure that constructors are handled correctly.
 
 # Only ELF based ports support selective linking
-if ![is_elf_format] {
-    return
-}
-
-# These targets do not support selective linking
-if {[istarget "alpha*-*-*"] || [istarget "am33*-*-*"] ||
-    [istarget "arc-*-*"] || [istarget "d30v-*-*"] ||
-    [istarget "dlx-*-*"] || [istarget "hppa*64*-*-*"] ||
-    [istarget "i370-*-*"] || [istarget "i860-*-*"] ||
-    [istarget "i960-*-*"] || [istarget "ia64-*-*"] ||
-    [istarget "m88*-*-*"] || [istarget "mn10200-*-*"] ||
-    [istarget "mep-*-*"] || [istarget "or32-*-*"] ||
-    [istarget "pj*-*-*"]} {
+if { ![is_elf_format] || ![check_gc_sections_available] } {
     return
 }
 
@@ -59,8 +46,8 @@ set seltests {
     {A::foo() B::foo() dropme1() dropme2()} {*-*-*}}
 }
 
-set cflags "-w -O -ffunction-sections -fdata-sections"
-set cxxflags "-fvtable-gc -fno-exceptions -fno-rtti"
+set cflags "-w -O -ffunction-sections -fdata-sections -fno-unit-at-a-time"
+set cxxflags "-fno-exceptions -fno-rtti -fno-unit-at-a-time"
 set ldflags "--gc-sections -Bstatic"
 
 if [istarget mips*-*] {
@@ -101,19 +88,19 @@ foreach testitem $seltests {
     foreach xfail_target $xfails {
        setup_xfail $xfail_target
     }
-    setup_xfail "arc*-*" "d30v*-*" "dlx*-*" "i370*-*" "i860*-*"
-    setup_xfail "i960*-*" "mn10200-*" "or32-*" "pj-*"
 
     # It's either C or C++ at the moment.
     if { $testtype == "C++" } {
-       set testflags "$cflags $cxxflags"
        set compiler "$CXX"
        # Starting with 3.4.0, -fvtable-gc is no longer supported and thus
        # the functionality we try to test for cannot be expected to work.
        set version [remote_exec host "$CXX -dumpversion"]
        set version [lindex $version 1]
        if [regexp "^(\[1-9\]\[0-9\]+|\[4-9\]|3.(\[1-9\]\[0-9\]+|\[4-9\]))\\." $version] {
+           set testflags "$cflags $cxxflags"
            setup_xfail {*-*-*}
+       } else {
+           set testflags "$cflags $cxxflags -fvtable-gc"
        }
     } else {
        set testflags "$cflags"
@@ -137,7 +124,7 @@ foreach testitem $seltests {
     }
 
     # ARM targets need libgcc.a in THUMB mode so that __call_via_r3 is provided
-    if {[istarget arm-*-*] || [istarget xscale-*-*]} {
+    if {[istarget arm-*-*]} {
        set libgcc [remote_exec host "$compiler -print-libgcc-file-name"]
        set libgcc [lindex $libgcc 1]
        regsub -all "\[\r\n\]" $libgcc "" libgcc
@@ -153,7 +140,7 @@ foreach testitem $seltests {
     }
 
     # m6811/m6812 code has references to soft registers.
-    if {[istarget m6811-*-*] || [istarget m6812-*-*]} {
+    if {[istarget m6811-*-*] || [istarget m6812-*-*] || [istarget m68hc1*-*-*]} {
        set objfile "$objfile --defsym _.frame=0 --defsym _.d1=0"
        set objfile "$objfile --defsym _.d2=0"
     }