2007-09-08 H.J. Lu <hongjiu.lu@intel.com>
[deliverable/binutils-gdb.git] / gold / readsyms.cc
index 2b200ba54849764e8143bce102391520253e6f6a..86828fc0a7c4dfd459dfe5568301b8714b423d80 100644 (file)
@@ -61,7 +61,7 @@ Read_symbols::run(Workqueue* 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.
@@ -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.026344 seconds and 4 git commands to generate.