* elflink.c (_bfd_elf_link_assign_sym_version): Improve error
[deliverable/binutils-gdb.git] / gold / readsyms.cc
index c301d16040c0791ede6b9a86c9f8007d5e59a5dc..86828fc0a7c4dfd459dfe5568301b8714b423d80 100644 (file)
@@ -56,12 +56,12 @@ Read_symbols::run(Workqueue* workqueue)
 {
   if (this->input_argument_->is_group())
     {
-      assert(this->input_group_ == NULL);
+      gold_assert(this->input_group_ == NULL);
       this->do_group(workqueue);
       return;
     }
 
-  Input_file* input_file = new Input_file(this->input_argument_->file());
+  Input_file* input_file = new Input_file(&this->input_argument_->file());
   input_file->open(this->options_, this->dirpath_);
 
   // Read enough of the file to pick up the entire ELF header.
@@ -170,7 +170,7 @@ Read_symbols::do_group(Workqueue* workqueue)
        ++p)
     {
       const Input_argument* arg = &*p;
-      assert(arg->is_file());
+      gold_assert(arg->is_file());
 
       Task_token* next_blocker = new Task_token();
       next_blocker->add_blocker();
@@ -240,10 +240,17 @@ Add_symbols::locks(Workqueue* workqueue)
 void
 Add_symbols::run(Workqueue*)
 {
-  this->input_objects_->add_object(this->object_);
-  this->object_->layout(this->options_, this->symtab_, this->layout_,
-                       this->sd_);
-  this->object_->add_symbols(this->symtab_, this->sd_);
+  if (!this->input_objects_->add_object(this->object_))
+    {
+      // FIXME: We need to close the descriptor here.
+      delete this->object_;
+    }
+  else
+    {
+      this->object_->layout(this->options_, this->symtab_, this->layout_,
+                           this->sd_);
+      this->object_->add_symbols(this->symtab_, this->sd_);
+    }
   delete this->sd_;
   this->sd_ = NULL;
 }
This page took 0.025838 seconds and 4 git commands to generate.