[AArch64] Cortex-A53 erratum 835769 linker workaround
[deliverable/binutils-gdb.git] / ld / testsuite / ld-selective / selective.exp
index bae43722e8a9b0854be9b14dfc88d0c8a62fa928..99ea0122f3b968d23df2feda56485218f31db42c 100644 (file)
@@ -1,6 +1,5 @@
 # Expect script for LD selective linking tests
-#   Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2007
-#   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
-}
-
-# Alpha and IA64 do not support selective linking
-if {[istarget "alpha*-*-*"] || [istarget "ia64-*-*"]} {
+if { ![is_elf_format] || ![check_gc_sections_available] } {
     return
 }
 
@@ -53,7 +47,7 @@ set seltests {
 }
 
 set cflags "-w -O -ffunction-sections -fdata-sections"
-set cxxflags "-fvtable-gc -fno-exceptions -fno-rtti"
+set cxxflags "-fno-exceptions -fno-rtti"
 set ldflags "--gc-sections -Bstatic"
 
 if [istarget mips*-*] {
@@ -94,44 +88,44 @@ 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"
-       if [string match "*gcc*" [lindex $CC 0]] {
-           # 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 "$CC -dumpversion"]
-           set version [lindex $version 1]
-           if [regexp "^(\[1-9\]\[0-9\]+|\[4-9\]|3.(\[1-9\]\[0-9\]+|\[4-9\]))\\." $version] {
-               setup_xfail {*-*-*}
-           }
+       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"
+       set compiler "$CC"
     }
 
     # Note that we do not actually *use* CXX; we just add cxxflags for C++
     # tests.  It might have been a buglet originally; now I think better
     # leave as is.
-    if { ![ld_compile "$CC $testflags" $srcdir/$subdir/$testfile $objfile] } {
+    if { ![ld_compile "$compiler $testflags" $srcdir/$subdir/$testfile $objfile] } {
        unresolved $testname
        continue
     }
 
     # V850 targets need libgcc.a
     if [istarget v850*-*-elf] {
-       set libgcc [remote_exec host "$CC -print-libgcc-file-name"]
+       set libgcc [remote_exec host "$compiler -print-libgcc-file-name"]
        set libgcc [lindex $libgcc 1]
        regsub -all "\[\r\n\]" $libgcc "" libgcc
        set objfile "$objfile $libgcc"
     }
 
     # ARM targets need libgcc.a in THUMB mode so that __call_via_r3 is provided
-    if {[istarget arm-*-*] || [istarget xscale-*-*]} {
-       set libgcc [remote_exec host "$CC -print-libgcc-file-name"]
+    if {[istarget arm-*-*]} {
+       set libgcc [remote_exec host "$compiler -print-libgcc-file-name"]
        set libgcc [lindex $libgcc 1]
        regsub -all "\[\r\n\]" $libgcc "" libgcc
        set objfile "$objfile $libgcc"
@@ -139,14 +133,14 @@ foreach testitem $seltests {
 
     # HPPA linux targets need libgcc.a for millicode routines ($$dyncall).
     if [istarget hppa*-*-linux*] {
-       set libgcc [remote_exec host "$CC -print-libgcc-file-name"]
+       set libgcc [remote_exec host "$compiler -print-libgcc-file-name"]
        set libgcc [lindex $libgcc 1]
        regsub -all "\[\r\n\]" $libgcc "" libgcc
        set objfile "$objfile $libgcc"
     }
 
     # 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"
     }
This page took 0.025467 seconds and 4 git commands to generate.