* archive.cc: Formatting fixes: Remove whitespace between
[binutils-gdb.git] / gold / gold.cc
index 545057334233c1b57e8ba35f08fad8252499d10a..74294d769248a64c55a6d9339dc36e5572f9fbf7 100644 (file)
@@ -206,7 +206,7 @@ queue_initial_tasks(const General_options& options,
       next_blocker->add_blocker();
       workqueue->queue(new Read_symbols(input_objects, symtab, layout,
                                        &search_path, 0, mapfile, &*p, NULL,
-                                       this_blocker, next_blocker));
+                                       NULL, this_blocker, next_blocker));
       this_blocker = next_blocker;
     }
 
@@ -276,6 +276,16 @@ queue_middle_gc_tasks(const General_options& options,
                                       next_blocker));
       this_blocker = next_blocker;
     }
+
+  // If we are given only archives in input, we have no regular
+  // objects and THIS_BLOCKER is NULL here.  Create a dummy
+  // blocker here so that we can run the middle tasks immediately.
+  if (this_blocker == NULL)
+    {
+      gold_assert(input_objects->number_of_relobjs() == 0);
+      this_blocker = new Task_token(true);
+    }
+
   workqueue->queue(new Task_function(new Middle_runner(options,
                                                        input_objects,
                                                        symtab,
@@ -299,7 +309,7 @@ queue_middle_tasks(const General_options& options,
                   Mapfile* mapfile)
 {
   // Add any symbols named with -u options to the symbol table.
-  symtab->add_undefined_symbols_from_command_line();
+  symtab->add_undefined_symbols_from_command_line(layout);
 
   // If garbage collection was chosen, relocs have been read and processed
   // at this point by pre_middle_tasks.  Layout can then be done for all 
@@ -323,7 +333,7 @@ queue_middle_tasks(const General_options& options,
             }
         }
       // Symbols named with -u should not be considered garbage.
-      symtab->gc_mark_undef_symbols();
+      symtab->gc_mark_undef_symbols(layout);
       gold_assert(symtab->gc() != NULL);
       // Do a transitive closure on all references to determine the worklist.
       symtab->gc()->do_transitive_closure();
@@ -369,7 +379,7 @@ queue_middle_tasks(const General_options& options,
            ++p)
         {
           // Update the value of output_section stored in rd.
-          Read_relocs_data *rd = (*p)->get_relocs_data();
+          Read_relocs_datard = (*p)->get_relocs_data();
           for (Read_relocs_data::Relocs_list::iterator q = rd->relocs.begin();
                q != rd->relocs.end();
                ++q)
@@ -532,13 +542,23 @@ queue_middle_tasks(const General_options& options,
         }
     }
 
-  // If we failed to open any input files, it's possible for
-  // THIS_BLOCKER to be NULL here.  There's no real point in
-  // continuing if that happens.
   if (this_blocker == NULL)
     {
-      gold_assert(parameters->errors()->error_count() > 0);
-      gold_exit(false);
+      if (input_objects->number_of_relobjs() == 0)
+       {
+         // If we are given only archives in input, we have no regular
+         // objects and THIS_BLOCKER is NULL here.  Create a dummy
+         // blocker here so that we can run the layout task immediately.
+         this_blocker = new Task_token(true);
+       }
+      else 
+       {
+         // If we failed to open any input files, it's possible for
+         // THIS_BLOCKER to be NULL here.  There's no real point in
+         // continuing if that happens.
+         gold_assert(parameters->errors()->error_count() > 0);
+         gold_exit(false);
+       }
     }
 
   // When all those tasks are complete, we can start laying out the
@@ -635,7 +655,7 @@ queue_final_tasks(const General_options& options,
     }
   else
     {
-      Task_token *new_final_blocker = new Task_token(true);
+      Task_tokennew_final_blocker = new Task_token(true);
       new_final_blocker->add_blocker();
       Task* t = new Write_after_input_sections_task(layout, of,
                                                    final_blocker,