# By Ian Lance Taylor, Cygnus Support
#
# Copyright 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
-# 2007 Free Software Foundation, Inc.
+# 2005, 2007, 2008 Free Software Foundation, Inc.
#
# This file is part of the GNU Binutils.
#
set testfn "undefined function"
set testline "undefined line"
-if { [which $CC] == 0 } {
+if { ![is_remote host] && [which $CC] == 0 } {
verbose "Could not find C compiler!" 1
untested $testund
untested $testfn
return
}
-catch "exec rm -f tmpdir/undefined" exec_output
+remote_file host delete "tmpdir/undefined"
set flags [big_or_little_endian]
# Using -e start prevents the SunOS linker from trying to build a
# shared library.
send_log "$ld -e start $flags -o tmpdir/undefined tmpdir/undefined.o\n"
-verbose "$ld -e start $flags -o tmpdir/undefined tmpdir/undefined.o"
+set exec_output [run_host_cmd "$ld" "-e start $flags -o tmpdir/undefined tmpdir/undefined.o"]
-catch "exec $ld -e start $flags -o tmpdir/undefined tmpdir/undefined.o" exec_output
send_log "$exec_output\n"
verbose "$exec_output"
#setup_xfail "arm*-*-pe*"
#setup_xfail "thumb*-*-pe*"
+# For Xtensa on GNU Linux systems (or any other system where PIC code is
+# always used), the address of the undefined function is in a literal pool
+# outside the function, so that both the "undefined function" and "undefined
+# line" tests fail.
+setup_xfail xtensa*-*-linux*
+
set mf "tmpdir/undefined.o* In function `function':"
checkund $mf $testfn
# doesn't need a literal pool entry.
setup_xfail s390-*-*
+# See comments above for Xtensa.
+setup_xfail xtensa*-*-linux*
+
checkund $ml $testline