gold: Fix 64-bit sparc GOLD crash in gdb-index code.
[binutils-gdb.git] / gold / gold.cc
index 2700bdb5ef67a61bf156b7698f92e994b4dee1da..f810bf913ba00fc7bdce210c3f00f1ac0819a2c4 100644 (file)
@@ -45,6 +45,7 @@
 #include "gc.h"
 #include "icf.h"
 #include "incremental.h"
+#include "timer.h"
 
 namespace gold
 {
@@ -487,6 +488,10 @@ queue_middle_tasks(const General_options& options,
                   Workqueue* workqueue,
                   Mapfile* mapfile)
 {
+  Timer* timer = parameters->timer();
+  if (timer != NULL)
+    timer->stamp(0);
+
   // Add any symbols named with -u options to the symbol table.
   symtab->add_undefined_symbols_from_command_line(layout);
 
@@ -674,6 +679,8 @@ queue_middle_tasks(const General_options& options,
   // Attach sections to segments.
   layout->attach_sections_to_segments();
 
+  // TODO(csilvers): figure out a more principled way to get the target
+  Target* target = const_cast<Target*>(&parameters->target());
   if (!parameters->options().relocatable())
     {
       // Predefine standard symbols.
@@ -682,6 +689,9 @@ queue_middle_tasks(const General_options& options,
       // Define __start and __stop symbols for output sections where
       // appropriate.
       layout->define_section_symbols(symtab);
+
+      // Define target-specific symbols.
+      target->define_standard_symbols(symtab, layout);
     }
 
   // Make sure we have symbols for any required group signatures.
@@ -763,8 +773,6 @@ queue_middle_tasks(const General_options& options,
 
   // When all those tasks are complete, we can start laying out the
   // output file.
-  // TODO(csilvers): figure out a more principled way to get the target
-  Target* target = const_cast<Target*>(&parameters->target());
   workqueue->queue(new Task_function(new Layout_task_runner(options,
                                                            input_objects,
                                                            symtab,
@@ -786,6 +794,10 @@ queue_final_tasks(const General_options& options,
                  Workqueue* workqueue,
                  Output_file* of)
 {
+  Timer* timer = parameters->timer();
+  if (timer != NULL)
+    timer->stamp(1);
+
   int thread_count = options.thread_count_final();
   if (thread_count == 0)
     thread_count = std::max(2, input_objects->number_of_input_objects());