diff options
author | Ian Lance Taylor <ian@airs.com> | 2010-01-07 18:31:30 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@airs.com> | 2010-01-07 18:31:30 +0000 |
commit | dc3f80feec3ab89febde78bc6d11655431555365 (patch) | |
tree | 38969cf3bada06c432cebc60cb7af3f0f1ee3a06 /gold/errors.cc | |
parent | ffeef7dfa55fe9608a46a991ce5413fe0db844f4 (diff) | |
download | gdb-dc3f80feec3ab89febde78bc6d11655431555365.zip gdb-dc3f80feec3ab89febde78bc6d11655431555365.tar.gz gdb-dc3f80feec3ab89febde78bc6d11655431555365.tar.bz2 |
PR 10980
* options.h (class General_options): Add --warn-unresolved-symbols
and --error-unresolved-symbols.
* errors.cc (Errors::undefined_symbol): Implement
--warn-unresolved-symbols.
Diffstat (limited to 'gold/errors.cc')
-rw-r--r-- | gold/errors.cc | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/gold/errors.cc b/gold/errors.cc index 618f9cd..b8031b1 100644 --- a/gold/errors.cc +++ b/gold/errors.cc @@ -1,6 +1,6 @@ // errors.cc -- handle errors for gold -// Copyright 2006, 2007, 2008 Free Software Foundation, Inc. +// Copyright 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. // Written by Ian Lance Taylor <iant@google.com>. // This file is part of gold. @@ -156,21 +156,33 @@ Errors::undefined_symbol(const Symbol* sym, const std::string& location) { bool initialized = this->initialize_lock(); gold_assert(initialized); + + const char* zmsg; { Hold_lock h(*this->lock_); if (++this->undefined_symbols_[sym] >= max_undefined_error_report) return; - ++this->error_count_; + if (parameters->options().warn_unresolved_symbols()) + { + ++this->warning_count_; + zmsg = _("warning"); + } + else + { + ++this->error_count_; + zmsg = _("error"); + } } + const char* const version = sym->version(); if (version == NULL) - fprintf(stderr, _("%s: %s: error: undefined reference to '%s'\n"), - this->program_name_, location.c_str(), + fprintf(stderr, _("%s: %s: %s: undefined reference to '%s'\n"), + this->program_name_, location.c_str(), zmsg, sym->demangled_name().c_str()); else fprintf(stderr, - _("%s: %s: error: undefined reference to '%s', version '%s'\n"), - this->program_name_, location.c_str(), + _("%s: %s: %s: undefined reference to '%s', version '%s'\n"), + this->program_name_, location.c_str(), zmsg, sym->demangled_name().c_str(), version); } |