mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-10-12 10:28:59 +08:00
From Craig Silverstein: Don't crash if we see a file we don't recognize.
This commit is contained in:
@ -399,12 +399,19 @@ Archive::include_member(Symbol_table* symtab, Layout* layout,
|
||||
this->input_file_, memoff, ehdr_buf,
|
||||
read_size);
|
||||
|
||||
input_objects->add_object(obj);
|
||||
if (input_objects->add_object(obj))
|
||||
{
|
||||
Read_symbols_data sd;
|
||||
obj->read_symbols(&sd);
|
||||
obj->layout(symtab, layout, &sd);
|
||||
obj->add_symbols(symtab, &sd);
|
||||
}
|
||||
else
|
||||
{
|
||||
// FIXME: We need to close the descriptor here.
|
||||
delete obj;
|
||||
}
|
||||
|
||||
Read_symbols_data sd;
|
||||
obj->read_symbols(&sd);
|
||||
obj->layout(symtab, layout, &sd);
|
||||
obj->add_symbols(symtab, &sd);
|
||||
}
|
||||
|
||||
// Add_archive_symbols methods.
|
||||
|
Reference in New Issue
Block a user