aboutsummaryrefslogtreecommitdiff
path: root/gold/testsuite
diff options
context:
space:
mode:
authorChris Demetriou <cgd@google.com>2009-02-06 19:20:10 +0000
committerChris Demetriou <cgd@google.com>2009-02-06 19:20:10 +0000
commitf073bbf7e0a9d7ebe5323c660b34c893c5dfedee (patch)
tree2a2c928d8b04dba0709b00826ab5f15552b10a2a /gold/testsuite
parent5a7c5e86304d6298cbeee81f07b626b194980073 (diff)
downloadbinutils-f073bbf7e0a9d7ebe5323c660b34c893c5dfedee.zip
binutils-f073bbf7e0a9d7ebe5323c660b34c893c5dfedee.tar.gz
binutils-f073bbf7e0a9d7ebe5323c660b34c893c5dfedee.tar.bz2
2009-02-06 Chris Demetriou <cgd@google.com>
* gold.h (gold_undefined_symbol): Change to take only a Symbol pointer and to report location as the file name associated with the symbol. (gold_undefined_symbol_at_location): New function to replace the old gold_undefined_symbol functionality. * target-reloc.h (relocate_section): Update to use gold_undefined_symbol_at_location. * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol): Call gold_undefined_symbol function rather than gold_error. * errors.h (Errors::undefined_symbol): Take location as a string, rather than calculating it from a relocation. * errors.cc (Errors::fatal): Print "fatal error:" before the formatted message. (Errors::error, Errors::error_at_location): Print "error: " before the formatted message. (Errors::undefined_symbol): Take location as a string, rather than calculating it from a relocation. (gold_undefined_symbol_at_location): New function akin to old gold_undefined_symbol, calculates location from relocation. (gold_undefined_symbol): Change to take only a Symbol pointer and to report location as the file name associated with the symbol. * testsuite/debug_msg.sh: Update for changed error messages. * testsuite/undef_symbol.sh: Likewise.
Diffstat (limited to 'gold/testsuite')
-rwxr-xr-xgold/testsuite/debug_msg.sh34
-rwxr-xr-xgold/testsuite/undef_symbol.sh2
2 files changed, 18 insertions, 18 deletions
diff --git a/gold/testsuite/debug_msg.sh b/gold/testsuite/debug_msg.sh
index 23da5a2..7339b41 100755
--- a/gold/testsuite/debug_msg.sh
+++ b/gold/testsuite/debug_msg.sh
@@ -55,18 +55,18 @@ check_missing()
# We don't know how the compiler might order these variables, so we
# can't test for the actual offset from .data, hence the regexp.
-check debug_msg.err "debug_msg.o: in function fn_array:debug_msg.cc(.data+0x[0-9a-fA-F]*): undefined reference to 'undef_fn1()'"
-check debug_msg.err "debug_msg.o: in function fn_array:debug_msg.cc(.data+0x[0-9a-fA-F]*): undefined reference to 'undef_fn2()'"
-check debug_msg.err "debug_msg.o: in function badref1:debug_msg.cc(.data+0x[0-9a-fA-F]*): undefined reference to 'undef_int'"
+check debug_msg.err "debug_msg.o: in function fn_array:debug_msg.cc(.data+0x[0-9a-fA-F]*): error: undefined reference to 'undef_fn1()'"
+check debug_msg.err "debug_msg.o: in function fn_array:debug_msg.cc(.data+0x[0-9a-fA-F]*): error: undefined reference to 'undef_fn2()'"
+check debug_msg.err "debug_msg.o: in function badref1:debug_msg.cc(.data+0x[0-9a-fA-F]*): error: undefined reference to 'undef_int'"
-check debug_msg.err "debug_msg.o: in function Base::virtfn():${srcdir}/debug_msg.cc:50: undefined reference to 'undef_fn1()'"
-check debug_msg.err "debug_msg.o: in function Derived::virtfn():${srcdir}/debug_msg.cc:55: undefined reference to 'undef_fn2()'"
-check debug_msg.err "debug_msg.o: in function int testfn<int>(int):${srcdir}/debug_msg.cc:43: undefined reference to 'undef_fn1()'"
-check debug_msg.err "debug_msg.o: in function int testfn<int>(int):${srcdir}/debug_msg.cc:44: undefined reference to 'undef_fn2()'"
-check debug_msg.err "debug_msg.o: in function int testfn<int>(int):${srcdir}/debug_msg.cc:45: undefined reference to 'undef_int'"
-check debug_msg.err "debug_msg.o: in function int testfn<double>(double):${srcdir}/debug_msg.cc:43: undefined reference to 'undef_fn1()'"
-check debug_msg.err "debug_msg.o: in function int testfn<double>(double):${srcdir}/debug_msg.cc:44: undefined reference to 'undef_fn2()'"
-check debug_msg.err "debug_msg.o: in function int testfn<double>(double):${srcdir}/debug_msg.cc:45: undefined reference to 'undef_int'"
+check debug_msg.err "debug_msg.o: in function Base::virtfn():${srcdir}/debug_msg.cc:50: error: undefined reference to 'undef_fn1()'"
+check debug_msg.err "debug_msg.o: in function Derived::virtfn():${srcdir}/debug_msg.cc:55: error: undefined reference to 'undef_fn2()'"
+check debug_msg.err "debug_msg.o: in function int testfn<int>(int):${srcdir}/debug_msg.cc:43: error: undefined reference to 'undef_fn1()'"
+check debug_msg.err "debug_msg.o: in function int testfn<int>(int):${srcdir}/debug_msg.cc:44: error: undefined reference to 'undef_fn2()'"
+check debug_msg.err "debug_msg.o: in function int testfn<int>(int):${srcdir}/debug_msg.cc:45: error: undefined reference to 'undef_int'"
+check debug_msg.err "debug_msg.o: in function int testfn<double>(double):${srcdir}/debug_msg.cc:43: error: undefined reference to 'undef_fn1()'"
+check debug_msg.err "debug_msg.o: in function int testfn<double>(double):${srcdir}/debug_msg.cc:44: error: undefined reference to 'undef_fn2()'"
+check debug_msg.err "debug_msg.o: in function int testfn<double>(double):${srcdir}/debug_msg.cc:45: error: undefined reference to 'undef_int'"
# Check we detected the ODR (One Definition Rule) violation.
check debug_msg.err ": symbol 'Ordering::operator()(int, int)' defined in multiple places (possible ODR violation):"
@@ -75,17 +75,17 @@ check debug_msg.err "odr_violation2.cc:5"
# When linking together .so's, we don't catch the line numbers, but we
# still find all the undefined variables, and the ODR violation.
-check debug_msg_so.err "debug_msg.so: undefined reference to 'undef_fn1()'"
-check debug_msg_so.err "debug_msg.so: undefined reference to 'undef_fn2()'"
-check debug_msg_so.err "debug_msg.so: undefined reference to 'undef_int'"
+check debug_msg_so.err "debug_msg.so: error: undefined reference to 'undef_fn1()'"
+check debug_msg_so.err "debug_msg.so: error: undefined reference to 'undef_fn2()'"
+check debug_msg_so.err "debug_msg.so: error: undefined reference to 'undef_int'"
check debug_msg_so.err ": symbol 'Ordering::operator()(int, int)' defined in multiple places (possible ODR violation):"
check debug_msg_so.err "odr_violation1.cc:5"
check debug_msg_so.err "odr_violation2.cc:5"
# These messages shouldn't need any debug info to detect:
-check debug_msg_ndebug.err "debug_msg_ndebug.so: undefined reference to 'undef_fn1()'"
-check debug_msg_ndebug.err "debug_msg_ndebug.so: undefined reference to 'undef_fn2()'"
-check debug_msg_ndebug.err "debug_msg_ndebug.so: undefined reference to 'undef_int'"
+check debug_msg_ndebug.err "debug_msg_ndebug.so: error: undefined reference to 'undef_fn1()'"
+check debug_msg_ndebug.err "debug_msg_ndebug.so: error: undefined reference to 'undef_fn2()'"
+check debug_msg_ndebug.err "debug_msg_ndebug.so: error: undefined reference to 'undef_int'"
# However, we shouldn't detect or declare any ODR violation
check_missing debug_msg_ndebug.err "(possible ODR violation)"
diff --git a/gold/testsuite/undef_symbol.sh b/gold/testsuite/undef_symbol.sh
index 03c1576..b689edc 100755
--- a/gold/testsuite/undef_symbol.sh
+++ b/gold/testsuite/undef_symbol.sh
@@ -40,6 +40,6 @@ check()
fi
}
-check "undef_symbol.so: undefined reference to 'a'"
+check "undef_symbol.so: error: undefined reference to 'a'"
exit 0