# Test that the linker reports undefined symbol errors correctly.
# By Ian Lance Taylor, Cygnus Support
#
-# Copyright (C) 1995, 1996, 1997 Free Software Foundation
+# Copyright 1995, 1996, 1997, 1998, 1999, 2000, 2001
+# Free Software Foundation, Inc.
#
# This file is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
catch "exec rm -f tmpdir/undefined" exec_output
+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 -o tmpdir/undefined tmpdir/undefined.o\n"
-verbose "$ld -e start -o tmpdir/undefined tmpdir/undefined.o"
+send_log "$ld -e start $flags -o tmpdir/undefined tmpdir/undefined.o\n"
+verbose "$ld -e start $flags -o tmpdir/undefined tmpdir/undefined.o"
-catch "exec $ld -e start -o tmpdir/undefined tmpdir/undefined.o" exec_output
+catch "exec $ld -e start $flags -o tmpdir/undefined tmpdir/undefined.o" exec_output
send_log "$exec_output\n"
verbose "$exec_output"
}
}
-set mu "undefined reference to `this_function_is_not_defined'"
+set mu "undefined reference to `*this_function_is_not_defined'"
checkund $mu $testund
# ARM PE defaults to using stabs debugging, which we can't handle for
# Just doesn't work for PA ELF. No clue why.
setup_xfail "hppa*-*-*elf*"
-set mf "tmpdir/undefined.o: In function `function':"
+# With dwarf-2, we can't get the function in which the reference
+# occurs; see below.
+setup_xfail "alpha*-*-linux*"
+setup_xfail "hppa*64*-*-*"
+setup_xfail "mn10300-*-elf"
+setup_xfail "sh-*-*"
+
+set mf "tmpdir/undefined.o* In function `function':"
checkund $mf $testfn
# COFF SH gets this test wrong--it reports line 10, because although
# Just doesn't work for PA ELF. No clue why.
setup_xfail "hppa*-*-*elf*"
-set ml "undefined.c:9: undefined reference to `this_function_is_not_defined'"
+set ml "undefined.c:9: undefined reference to `*this_function_is_not_defined'"
# With targets that use elf/dwarf2, such as the arm-elf and thumb-elf
# toolchains, the code in bfd/elf.c:_bfd_elf_find_nearest_line() is called
# in order to locate the file name/line number where the undefined
#
# hence the xfails below.
-setup_xfail arm-*-elf
-setup_xfail strongarm-*-elf
-setup_xfail thumb-*-elf
+#setup_xfail arm-*-elf
+setup_xfail i?86-*-freebsd*
+#setup_xfail strongarm-*-elf
+#setup_xfail thumb-*-elf
setup_xfail mcore-*-elf
+setup_xfail mips-sgi-irix6*
+setup_xfail "sh64-*-*"
+
+# The undefined test fails on 31 bit s/390 because the address of the
+# function `this_function_is_not_defined' is stored in the literal pool of
+# the function. Therefore the line number in the error message is 8 instead
+# of 9. On 64 bit s/390 this works because of the new brasl instruction that
+# doesn't need a literal pool entry.
+setup_xfail s390-*-*
checkund $ml $testline