}
bool adjust_common_sizes;
- if (Symbol_table::should_override(to, frombits, &adjust_common_sizes))
+ if (Symbol_table::should_override(to, frombits, object,
+ &adjust_common_sizes))
{
typename Sized_symbol<size>::Size_type tosize = to->symsize();
bool
Symbol_table::should_override(const Symbol* to, unsigned int frombits,
- bool* adjust_common_sizes)
+ Object* object, bool* adjust_common_sizes)
{
*adjust_common_sizes = false;
{
case DEF * 16 + DEF:
// Two definitions of the same symbol.
- // FIXME: Report locations.
- gold_error(_("multiple definition of %s"), to->name());
+ // FIXME: Do a better job of reporting locations.
+ gold_error(_("%s: multiple definition of %s"),
+ object != NULL ? object->name().c_str() : _("command line"),
+ to->name());
+ gold_error(_("%s: previous definition here"),
+ (to->source() == Symbol::FROM_OBJECT
+ ? to->object()->name().c_str()
+ : _("command line")));
return false;
case WEAK_DEF * 16 + DEF:
{
bool adjust_common_sizes;
unsigned int frombits = global_flag | regular_flag | def_flag;
- bool ret = Symbol_table::should_override(to, frombits, &adjust_common_sizes);
+ bool ret = Symbol_table::should_override(to, frombits, NULL,
+ &adjust_common_sizes);
gold_assert(!adjust_common_sizes);
return ret;
}
// Whether we should override a symbol, based on flags in
// resolve.cc.
static bool
- should_override(const Symbol*, unsigned int, bool*);
+ should_override(const Symbol*, unsigned int, Object*, bool*);
// Whether we should override a symbol with a special symbol which
// is automatically defined by the linker.