diff options
author | Ian Lance Taylor <iant@google.com> | 2007-11-07 00:31:32 +0000 |
---|---|---|
committer | Ian Lance Taylor <iant@google.com> | 2007-11-07 00:31:32 +0000 |
commit | 019cdb1a59d66739843fdb0e6221566bcf7d60bd (patch) | |
tree | e11f61bfc508817a13f8ce7ed438795b33225476 /gold/archive.cc | |
parent | 53c8095f6074f3a8338e73f81ec45fc077fa0195 (diff) | |
download | gdb-019cdb1a59d66739843fdb0e6221566bcf7d60bd.zip gdb-019cdb1a59d66739843fdb0e6221566bcf7d60bd.tar.gz gdb-019cdb1a59d66739843fdb0e6221566bcf7d60bd.tar.bz2 |
From Craig Silverstein: Don't crash if we see a file we don't recognize.
Diffstat (limited to 'gold/archive.cc')
-rw-r--r-- | gold/archive.cc | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/gold/archive.cc b/gold/archive.cc index 4d95b79..5862f34 100644 --- a/gold/archive.cc +++ b/gold/archive.cc @@ -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. |