X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=ld%2Ftestsuite%2Fld-selective%2Fselective.exp;h=7b115adb7811ac3f3977577658c3429a10a071b1;hb=5b1f6c95704da7128ca2a7c682a2e0ef533180ce;hp=d4d30ecc9ead259f473b7c9a6f801583dd4f1d80;hpb=c9eaa05f39a20ebdd807dcf8141a22e08bb613f1;p=binutils-gdb.git diff --git a/ld/testsuite/ld-selective/selective.exp b/ld/testsuite/ld-selective/selective.exp index d4d30ecc9ea..7b115adb781 100644 --- a/ld/testsuite/ld-selective/selective.exp +++ b/ld/testsuite/ld-selective/selective.exp @@ -1,6 +1,5 @@ # Expect script for LD selective linking tests -# Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009, -# 2010, 2011 Free Software Foundation, Inc. +# Copyright (C) 1998-2021 Free Software Foundation, Inc. # # This file is part of the GNU Binutils. # @@ -23,19 +22,7 @@ # 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 "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 "-fno-exceptions -fno-rtti" +set cflags "-w -O -ffunction-sections -fdata-sections $NOSANITIZE_CFLAGS $NOLTO_CFLAGS" +set cxxflags "-fno-exceptions -fno-rtti $NOSANITIZE_CFLAGS $NOLTO_CFLAGS" set ldflags "--gc-sections -Bstatic" if [istarget mips*-*] { @@ -70,11 +57,10 @@ if [istarget mips*-*] { set ldflags "-e _start $ldflags" } -if [istarget sh64*-*-elf] { - # This is what gcc passes to ld by default, plus switch to the - # "usual" ELF _start (shelf32 normally uses just `start' for COFF - # compatibility) - set ldflags "-e _start -mshelf32 $ldflags" +if [istarget avr-*-*] { + # Make .text start at a non-zero address, as some tests expect + # valid symbols to have non-zero values. + set ldflags "--section-start=.text=0x2 $ldflags" } # If we don't have g++ for the target, mark all tests as untested. @@ -101,8 +87,6 @@ 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++" } { @@ -111,7 +95,8 @@ foreach testitem $seltests { # 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] { + if { [regexp "^(\[1-9\]\[0-9\]+|\[4-9\]|3.(\[1-9\]\[0-9\]+))\\." $version] \ + || [regexp "^(\[1-9\]\[0-9\]+|\[4-9\])" $version] } { set testflags "$cflags $cxxflags" setup_xfail {*-*-*} } else { @@ -126,7 +111,7 @@ foreach testitem $seltests { # tests. It might have been a buglet originally; now I think better # leave as is. if { ![ld_compile "$compiler $testflags" $srcdir/$subdir/$testfile $objfile] } { - unresolved $testname + unsupported $testname continue } @@ -155,18 +140,18 @@ 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" } - if ![ld_simple_link $ld $ldfile "$ldflags [join $ldargs] $objfile"] { + if ![ld_link $ld $ldfile "$ldflags [join $ldargs] $objfile"] { fail $testname continue } if ![ld_nm $nm --demangle $ldfile] { - unresolved $testname + fail $testname continue }