mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-16 23:06:48 +08:00

This adjusts the testsuite to get rid of a number of XPASSes that have appeared. Someone might like to look into a better patch for the s390 change. aarch64-pe XPASS: weak symbols arm-nacl XPASS: rgn-over8 mcore-pe XPASS: ld-scripts/provide-8 mips64-linux-gnuabi64 XPASS: vers4 mips64-linux-gnuabi64 XPASS: vers4b mips-linux-gnu XPASS: vers4 mips-linux-gnu XPASS: vers4b s390-linux-gnu XPASS: undefined line sh4-linux-gnu XPASS: --gc-sections with __start_SECTIONNAME sh-coff XPASS: objcopy object (simple copy) sh-coff XPASS: objcopy executable (pr25662) binutils/ * testsuite/binutils-all/objcopy.exp: Don't xfail "simple copy" and "pr25662" on sh-*-coff. Remove all non-ELF xfails on "ELF unknown section type" test. ld/ * testsuite/ld-elfvers/vers.exp (vers4, vers4b): Don't xfail all mips, just xfail mips irix. * testsuite/ld-gc/pr19161.d: Don't xfail sh. * testsuite/ld-scripts/rgn-over8-ok.d: Don't xfail nacl. * testsuite/ld-scripts/weak.exp: Don't xfail aarch64-pe. * testsuite/ld-undefined/undefined.exp: Conditionally xfail "undefined line" depending on gcc version for s390.
76 lines
2.5 KiB
Plaintext
76 lines
2.5 KiB
Plaintext
# Test weak symbols.
|
|
# By Ian Lance Taylor, Cygnus Solutions.
|
|
# Copyright (C) 1999-2023 Free Software Foundation, Inc.
|
|
#
|
|
# This file is part of the GNU Binutils.
|
|
#
|
|
# This program is free software; you can redistribute it and/or modify
|
|
# it under the terms of the GNU General Public License as published by
|
|
# the Free Software Foundation; either version 3 of the License, or
|
|
# (at your option) any later version.
|
|
#
|
|
# This program is distributed in the hope that it will be useful,
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
# GNU General Public License for more details.
|
|
#
|
|
# You should have received a copy of the GNU General Public License
|
|
# along with this program; if not, write to the Free Software
|
|
# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
|
|
# MA 02110-1301, USA.
|
|
|
|
set testname "weak symbols"
|
|
|
|
# This test only works for ELF targets and some PE targets.
|
|
# It ought to work for some a.out targets, but it doesn't.
|
|
if { [is_elf_format] } {
|
|
# hppa64 is incredibly broken
|
|
setup_xfail hppa64-*-*
|
|
} elseif { [is_pecoff_format] } {
|
|
# Weak symbols are broken for most PE targets.
|
|
if { ![istarget aarch64-*-*]
|
|
&& ![istarget i?86-*-*]
|
|
&& ![istarget sh-*-*]
|
|
&& ![istarget x86_64-*-*] } {
|
|
setup_xfail *-*-*
|
|
}
|
|
} else {
|
|
unsupported $testname
|
|
return
|
|
}
|
|
|
|
if {! [ld_assemble $as $srcdir/$subdir/weak1.s tmpdir/weak1.o]
|
|
|| ! [ld_assemble $as $srcdir/$subdir/weak2.s tmpdir/weak2.o]} then {
|
|
# It's OK if .weak doesn't work on this target.
|
|
unsupported $testname
|
|
return
|
|
}
|
|
|
|
set saved_LDFLAGS "$LDFLAGS"
|
|
if { [is_pecoff_format] } then {
|
|
set LDFLAGS "$LDFLAGS --image-base 0"
|
|
}
|
|
|
|
set weak_regexp_big \
|
|
".*Contents of section .text:.*1000 00001008 0000200c 12121212 34343434.*Contents of section .data:.*2000 00001008 0000200c 56565656 78787878.*"
|
|
|
|
set weak_regexp_little \
|
|
".*Contents of section .text:.*1000 08100000 0c200000 12121212 34343434.*Contents of section .data:.*2000 08100000 0c200000 56565656 78787878.*"
|
|
|
|
if {! [ld_link $ld tmpdir/weak "$flags -T $srcdir/$subdir/weak.t tmpdir/weak1.o tmpdir/weak2.o"] } then {
|
|
fail $testname
|
|
} else {
|
|
set exec_output [run_host_cmd "$objdump" "-s tmpdir/weak"]
|
|
set exec_output [prune_warnings $exec_output]
|
|
verbose -log $exec_output
|
|
|
|
if {[regexp $weak_regexp_big $exec_output] \
|
|
|| [regexp $weak_regexp_little $exec_output] } then {
|
|
pass $testname
|
|
} else {
|
|
fail $testname
|
|
}
|
|
}
|
|
|
|
set LDFLAGS "$saved_LDFLAGS"
|