diff options
Diffstat (limited to 'gold/object.cc')
-rw-r--r-- | gold/object.cc | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/gold/object.cc b/gold/object.cc index 433fbc8..f82827c 100644 --- a/gold/object.cc +++ b/gold/object.cc @@ -1248,12 +1248,13 @@ Sized_relobj<size, big_endian>::get_symbol_location_info( bool Input_objects::add_object(Object* obj) { + // Set the global target from the first object file we recognize. Target* target = obj->target(); - if (this->target_ == NULL) - this->target_ = target; - else if (this->target_ != target) + if (!parameters->is_target_valid()) + set_parameters_target(target); + else if (target != parameters->target()) { - gold_error(_("%s: incompatible target"), obj->name().c_str()); + obj->error(_("incompatible target")); return false; } @@ -1289,8 +1290,6 @@ Input_objects::add_object(Object* obj) } } - set_parameters_target(target); - return true; } |