2010-02-24 Doug Kwan <dougkwan@google.com>
[deliverable/binutils-gdb.git] / gold / fileread.cc
index 4e8157f7957c33cfb786ca9b693319e6eaa74774..9f190990a602082d008879d2156bc96424b566de 100644 (file)
@@ -938,17 +938,22 @@ Input_file::open(const Dirsearch& dirpath, const Task* task, int *pindex)
     this->input_argument_->options().format_enum();
   bool ok;
   if (format == General_options::OBJECT_FORMAT_ELF)
-    ok = this->file_.open(task, name);
+    {
+      ok = this->file_.open(task, name);
+      this->format_ = FORMAT_ELF;
+    }
   else
     {
       gold_assert(format == General_options::OBJECT_FORMAT_BINARY);
       ok = this->open_binary(task, name);
+      this->format_ = FORMAT_BINARY;
     }
 
   if (!ok)
     {
       gold_error(_("cannot open %s: %s"),
                 name.c_str(), strerror(errno));
+      this->format_ = FORMAT_NONE;
       return false;
     }
 
This page took 0.02386 seconds and 4 git commands to generate.