# Test linking directly to S-records.
# By Ian Lance Taylor, Cygnus Support.
-# Copyright (C) 1999-2019 Free Software Foundation, Inc.
+# Copyright (C) 1999-2021 Free Software Foundation, Inc.
#
# This file is part of the GNU Binutils.
#
# Pass -fplt to CC and CXX since -fno-plt doesn't work with S-records
# tests. Also add $NOPIE_CFLAGS and $NOPIE_LDFLAGS if PIE doesn't work
-# with S-records.
-global PLT_CFLAGS NOPIE_CFLAGS NOPIE_LDFLAGS
+# with S-records. Also add $NOCF_PROTECTION_CFLAGS for S-records.
+# Also add $NOSANITIZE_CFLAGS for S-records.
set old_CC "$CC"
-set CC "$CC $PLT_CFLAGS $NOPIE_CFLAGS $NOPIE_LDFLAGS"
+set CC "$CC $PLT_CFLAGS $NOPIE_CFLAGS $NOPIE_LDFLAGS $NOCF_PROTECTION_CFLAGS $NOSANITIZE_CFLAGS $NOLTO_CFLAGS"
set old_CXX "$CXX"
-set CXX "$CXX $PLT_CFLAGS $NOPIE_CFLAGS $NOPIE_LDFLAGS"
+set old_CXXFLAGS "$CXXFLAGS"
+set CXXFLAGS "$CXXFLAGS $PLT_CFLAGS $NOPIE_CFLAGS $NOPIE_LDFLAGS $NOCF_PROTECTION_CFLAGS $NOSANITIZE_CFLAGS $NOLTO_CFLAGS"
# S-records can't handle .note.gnu.property sections.
if { [is_elf_format] \
unresolved $test2
set CC "$old_CC"
set CXX "$old_CXX"
+ set CXXFLAGS "$old_CXXFLAGS"
return
}
# The S-record linker doesn't do the magic TOC handling that XCOFF
# linkers do.
-setup_xfail "*-*-aix*" "*-*-xcoff*"
+if [is_xcoff_format] {
+ setup_xfail *-*-*
+}
# The S-record linker is not supported for ARC.
setup_xfail "arc*-*-*"
# The S-record linker is not supported for C-SKY.
setup_xfail "csky*-*-*"
+# The S-record linker is not supported for eBPF.
+setup_xfail "bpf-*-*"
+
run_srec_test $test1 "tmpdir/sr1.o tmpdir/sr2.o"
# Now try linking a C++ program with global constructors and
untested $test2
set CC "$old_CC"
set CXX "$old_CXX"
+ set CXXFLAGS "$old_CXXFLAGS"
return
}
unresolved $test2
set CC "$old_CC"
set CXX "$old_CXX"
+ set CXXFLAGS "$old_CXXFLAGS"
return
}
# See above.
setup_xfail "i*86-*-aout*"
setup_xfail "mips*-*-irix5*" "mips*-*-irix6*" "mips*-*-linux*"
-setup_xfail "*-*-aix*" "*-*-xcoff*"
+if [is_xcoff_format] {
+ setup_xfail *-*-*
+}
setup_xfail "arc*-*-*"
setup_xfail "arm*-*-*"
setup_xfail "v850*-*-elf"
setup_xfail "bfin-*-linux-uclibc"
setup_xfail "tile*-*-*"
setup_xfail "csky*-*-*"
+setup_xfail "bpf-*-*"
run_srec_test $test2 "tmpdir/sr3.o"
set CC "$old_CC"
set CXX "$old_CXX"
+set CXXFLAGS "$old_CXXFLAGS"