// errors.cc -- handle errors for gold
-// Copyright 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+// Copyright (C) 2006-2019 Free Software Foundation, Inc.
// Written by Ian Lance Taylor <iant@google.com>.
// This file is part of gold.
fprintf(stderr, _("%s: fatal error: "), this->program_name_);
vfprintf(stderr, format, args);
fputc('\n', stderr);
- gold_exit(false);
+ gold_exit(GOLD_ERR);
+}
+
+// Report a fallback error.
+
+void
+Errors::fallback(const char* format, va_list args)
+{
+ fprintf(stderr, _("%s: fatal error: "), this->program_name_);
+ vfprintf(stderr, format, args);
+ fputc('\n', stderr);
+ gold_exit(GOLD_FALLBACK);
}
// Report an error.
size_t relnum, off_t reloffset,
const char* format, va_list args)
{
- fprintf(stderr, _("%s: %s: error: "), this->program_name_,
+ fprintf(stderr, _("%s: error: "),
relinfo->location(relnum, reloffset).c_str());
vfprintf(stderr, format, args);
fputc('\n', stderr);
size_t relnum, off_t reloffset,
const char* format, va_list args)
{
- fprintf(stderr, _("%s: %s: warning: "), this->program_name_,
+ fprintf(stderr, _("%s: warning: "),
relinfo->location(relnum, reloffset).c_str());
vfprintf(stderr, format, args);
fputc('\n', stderr);
const char* const version = sym->version();
if (version == NULL)
- fprintf(stderr, _("%s: %s: %s: undefined reference to '%s'\n"),
- this->program_name_, location.c_str(), zmsg,
- sym->demangled_name().c_str());
+ fprintf(stderr, _("%s: %s: undefined reference to '%s'\n"),
+ location.c_str(), zmsg, sym->demangled_name().c_str());
else
fprintf(stderr,
- _("%s: %s: %s: undefined reference to '%s', version '%s'\n"),
- this->program_name_, location.c_str(), zmsg,
- sym->demangled_name().c_str(), version);
+ _("%s: %s: undefined reference to '%s', version '%s'\n"),
+ location.c_str(), zmsg, sym->demangled_name().c_str(), version);
+
+ if (sym->is_cxx_vtable())
+ gold_info(_("%s: the vtable symbol may be undefined because "
+ "the class is missing its key function"),
+ program_name);
+ if (sym->is_placeholder())
+ gold_info(_("%s: the symbol should have been defined by a plugin"),
+ program_name);
}
// Issue a debugging message.
va_end(args);
}
+// Report a fallback error.
+
+void
+gold_fallback(const char* format, ...)
+{
+ va_list args;
+ va_start(args, format);
+ parameters->errors()->fallback(format, args);
+ va_end(args);
+}
+
// Report an error.
void