]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blobdiff - ld/testsuite/ld-scripts/crossref.exp
Update year range in copyright notice of binutils files
[thirdparty/binutils-gdb.git] / ld / testsuite / ld-scripts / crossref.exp
index 75544ba36225eb67524d5a363f8baba0a7fa3451..f6895397d6ac5b7889c3a9c4f65728b564e3ccef 100644 (file)
@@ -1,6 +1,6 @@
 # Test NOCROSSREFS in a linker script.
 # By Ian Lance Taylor, Cygnus Support.
-#   Copyright (C) 2000-2020 Free Software Foundation, Inc.
+#   Copyright (C) 2000-2021 Free Software Foundation, Inc.
 #
 # This file is part of the GNU Binutils.
 #
@@ -38,12 +38,10 @@ if { ![check_compiler_available] } {
     return
 }
 
-global CFLAGS
 set old_CFLAGS "$CFLAGS"
 
 # Pass -fplt to CC since -fno-plt doesn't work with NOCROSSREFS tests.
 # Also add $NOPIE_CFLAGS since PIE doesn't work NOCROSSREFS tests.
-global PLT_CFLAGS NOPIE_CFLAGS
 set old_CC "$CC"
 set CC "$CC $PLT_CFLAGS $NOPIE_CFLAGS"
 
@@ -65,8 +63,8 @@ if [istarget tic6x*-*-*] {
     set CFLAGS "-mno-dsbt -msdata=none"
 }
 
-if { ![ld_compile $CC "$srcdir/$subdir/cross1.c" tmpdir/cross1.o] \
-     || ![ld_compile $CC "$srcdir/$subdir/cross2.c" tmpdir/cross2.o] } {
+if { ![ld_compile "$CC $NOSANITIZE_CFLAGS $NOLTO_CFLAGS" "$srcdir/$subdir/cross1.c" tmpdir/cross1.o] \
+     || ![ld_compile "$CC $NOSANITIZE_CFLAGS $NOLTO_CFLAGS" "$srcdir/$subdir/cross2.c" tmpdir/cross2.o] } {
     unresolved $test1
     unresolved $test2
     set CFLAGS "$old_CFLAGS"
@@ -103,7 +101,7 @@ if [string match "" $exec_output] then {
 
 # Check cross references within a single object.
 
-if { ![ld_compile $CC "$srcdir/$subdir/cross3.c" tmpdir/cross3.o] } {
+if { ![ld_compile "$CC $NOSANITIZE_CFLAGS $NOLTO_CFLAGS" "$srcdir/$subdir/cross3.c" tmpdir/cross3.o] } {
     unresolved $test2
     set CFLAGS "$old_CFLAGS"
     set CC "$old_CC"
@@ -128,7 +126,7 @@ if [string match "" $exec_output] then {
 
 # Check cross references for ld -r
 
-if { ![ld_compile $CC "$srcdir/$subdir/cross4.c" tmpdir/cross4.o] } {
+if { ![ld_compile "$CC $NOSANITIZE_CFLAGS $NOLTO_CFLAGS" "$srcdir/$subdir/cross4.c" tmpdir/cross4.o] } {
     unresolved $test3
     set CFLAGS "$old_CFLAGS"
     set CC "$old_CC"