# Test NOCROSSREFS in a linker script.
# By Ian Lance Taylor, Cygnus Support.
-# Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2007
-# Free Software Foundation, Inc.
+# Copyright (C) 2000-2016 Free Software Foundation, Inc.
#
# This file is part of the GNU Binutils.
#
return
}
+global CFLAGS
+set old_CFLAGS "$CFLAGS"
+
+# Pass -fplt to CC since -fno-plt doesn't work with NOCROSSREFS tests.
+global PLT_CFLAGS
+set old_CC "$CC"
+set CC "$CC $PLT_CFLAGS"
+
# Xtensa targets currently default to putting literal values in a separate
# section and that requires linker script support, so put literals in text.
-global CFLAGS
if [istarget xtensa*-*-*] {
set CFLAGS "$CFLAGS -mtext-section-literals"
}
# If we have a compiler that doesn't use/reference dot-symbols, then
# calls to functions reference the .opd section function descriptor.
# This makes NOCROSSREFS rather useless on powerpc64.
-if [istarget powerpc64*-*-*] {
+if [istarget powerpc64-*-*] {
set CFLAGS "$CFLAGS -mcall-aixdesc"
}
|| ![ld_compile $CC "$srcdir/$subdir/cross2.c" tmpdir/cross2.o] } {
unresolved $test1
unresolved $test2
+ set CFLAGS "$old_CFLAGS"
+ set CC "$old_CC"
return
}
set flags "-mshelf32"
}
+# arc-elf32 requires the symbol __SDATA_BEGIN__ to always be present.
+if [istarget arc*-*-elf32] {
+ set flags "$flags --defsym=__SDATA_BEGIN__=0"
+}
+
# IA64 has both ordered and unordered sections in an input file.
setup_xfail ia64-*-*
if { ![ld_compile $CC "$srcdir/$subdir/cross3.c" tmpdir/cross3.o] } {
unresolved $test2
+ set CFLAGS "$old_CFLAGS"
+ set CC "$old_CC"
return
}
if { ![ld_compile $CC "$srcdir/$subdir/cross4.c" tmpdir/cross4.o] } {
unresolved $test3
+ set CFLAGS "$old_CFLAGS"
+ set CC "$old_CC"
return
}
if ![ld_relocate $ld tmpdir/cross3-partial.o "tmpdir/cross1.o tmpdir/cross4.o"] {
unresolved $test3
+ set CFLAGS "$old_CFLAGS"
+ set CC "$old_CC"
return
}
verbose -log "$exec_output"
fail $test3
}
+
+set CFLAGS "$old_CFLAGS"
+set CC "$old_CC"