2009-10-29 Sandra Loosemore <sandra@codesourcery.com>
[deliverable/binutils-gdb.git] / gold / readsyms.cc
index b6da88d45ce4f5ddd9bf13f5d766040c2e86bd5c..6cff8534bb9ff679bac69211bcf88723144c3598 100644 (file)
@@ -33,6 +33,8 @@
 #include "script.h"
 #include "readsyms.h"
 #include "plugin.h"
+#include "layout.h"
+#include "incremental.h"
 
 namespace gold
 {
@@ -199,7 +201,7 @@ Read_symbols::do_read_symbols(Workqueue* workqueue)
     {
       bool is_thin_archive
           = memcmp(ehdr, Archive::armagt, Archive::sarmag) == 0;
-      if (is_thin_archive 
+      if (is_thin_archive
           || memcmp(ehdr, Archive::armag, Archive::sarmag) == 0)
        {
          // This is an archive.
@@ -207,7 +209,13 @@ Read_symbols::do_read_symbols(Workqueue* workqueue)
                                      input_file, is_thin_archive,
                                      this->dirpath_, this);
          arch->setup();
-         
+
+         if (this->layout_->incremental_inputs())
+           {
+             const Input_argument* ia = this->input_argument_;       
+             this->layout_->incremental_inputs()->report_archive(ia, arch);
+           }
+
          // Unlock the archive so it can be used in the next task.
          arch->unlock(this);
 
@@ -258,13 +266,16 @@ Read_symbols::do_read_symbols(Workqueue* workqueue)
     {
       // This is an ELF object.
 
-      bool unconfigured;
+      bool unconfigured = false;
+      bool* punconfigured = (input_file->will_search_for()
+                            ? &unconfigured
+                            : NULL);
       Object* obj = make_elf_object(input_file->filename(),
                                    input_file, 0, ehdr, read_size,
-                                   &unconfigured);
+                                   punconfigured);
       if (obj == NULL)
        {
-         if (unconfigured && input_file->will_search_for())
+         if (unconfigured)
            {
              Read_symbols::incompatible_warning(this->input_argument_,
                                                 input_file);
@@ -280,6 +291,12 @@ Read_symbols::do_read_symbols(Workqueue* workqueue)
       Read_symbols_data* sd = new Read_symbols_data;
       obj->read_symbols(sd);
 
+      if (this->layout_->incremental_inputs())
+       {
+         const Input_argument* ia = this->input_argument_;
+         this->layout_->incremental_inputs()->report_object(ia, obj);
+       }
+
       // Opening the file locked it, so now we need to unlock it.  We
       // need to unlock it before queuing the Add_symbols task,
       // because the workqueue doesn't know about our lock on the
@@ -381,6 +398,8 @@ Read_symbols::get_name() const
       std::string ret("Read_symbols ");
       if (this->input_argument_->file().is_lib())
        ret += "-l";
+      else if (this->input_argument_->file().is_searched_file())
+       ret += "-l:";
       ret += this->input_argument_->file().name();
       return ret;
     }
@@ -433,7 +452,7 @@ Add_symbols::locks(Task_locker* tl)
 // Add the symbols in the object to the symbol table.
 
 void
-Add_symbols::run(Workqueue* workqueue)
+Add_symbols::run(Workqueue*)
 {
   Pluginobj* pluginobj = this->object_->pluginobj();
   if (pluginobj != NULL)
@@ -442,21 +461,7 @@ Add_symbols::run(Workqueue* workqueue)
       return;
     }
 
-  // If this file has an incompatible format, try for another file
-  // with the same name.
-  if (this->object_->searched_for()
-      && !parameters->is_compatible_target(this->object_->target()))
-    {
-      Read_symbols::incompatible_warning(this->input_argument_,
-                                        this->object_->input_file());
-      Read_symbols::requeue(workqueue, this->input_objects_, this->symtab_,
-                           this->layout_, this->dirpath_, this->dirindex_,
-                           this->mapfile_, this->input_argument_,
-                           this->input_group_, this->next_blocker_);
-      this->object_->release();
-      delete this->object_;
-    }
-  else if (!this->input_objects_->add_object(this->object_))
+  if (!this->input_objects_->add_object(this->object_))
     {
       this->object_->release();
       delete this->object_;
@@ -587,6 +592,8 @@ Read_script::get_name() const
   std::string ret("Read_script ");
   if (this->input_argument_->file().is_lib())
     ret += "-l";
+  else if (this->input_argument_->file().is_searched_file())
+    ret += "-l:";
   ret += this->input_argument_->file().name();
   return ret;
 }
This page took 0.024395 seconds and 4 git commands to generate.