mirror of
https://github.com/bminor/binutils-gdb.git
synced 2025-12-26 09:08:59 +00:00
From Craig Silverstein: Don't crash if we see a file we don't recognize.
This commit is contained in:
@@ -866,6 +866,15 @@ Sized_relobj<size, big_endian>::get_symbol_location_info(
|
||||
bool
|
||||
Input_objects::add_object(Object* obj)
|
||||
{
|
||||
Target* target = obj->target();
|
||||
if (this->target_ == NULL)
|
||||
this->target_ = target;
|
||||
else if (this->target_ != target)
|
||||
{
|
||||
gold_error(_("%s: incompatible target"), obj->name().c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!obj->is_dynamic())
|
||||
this->relobj_list_.push_back(static_cast<Relobj*>(obj));
|
||||
else
|
||||
@@ -884,15 +893,6 @@ Input_objects::add_object(Object* obj)
|
||||
this->dynobj_list_.push_back(dynobj);
|
||||
}
|
||||
|
||||
Target* target = obj->target();
|
||||
if (this->target_ == NULL)
|
||||
this->target_ = target;
|
||||
else if (this->target_ != target)
|
||||
{
|
||||
gold_error(_("%s: incompatible target"), obj->name().c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
set_parameters_size_and_endianness(target->get_size(),
|
||||
target->is_big_endian());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user