Fix bug where -u option with empty archive results in internal error.
authorCary Coutant <ccoutant@gmail.com>
Mon, 21 Nov 2016 22:05:40 +0000 (14:05 -0800)
committerCary Coutant <ccoutant@gmail.com>
Mon, 21 Nov 2016 22:06:15 +0000 (14:06 -0800)
gold/
PR gold/20693
* gold.cc (queue_middle_tasks): Force valid target earlier.

gold/ChangeLog
gold/gold.cc

index bb035f38f85674c3910e6be7b243f47e5f14ec59..63476cda47c04af785d6288239ef1e61ef5f04d5 100644 (file)
@@ -1,3 +1,8 @@
+2016-11-21  Cary Coutant  <ccoutant@gmail.com>
+
+       PR gold/20693
+       * gold.cc (queue_middle_tasks): Force valid target earlier.
+
 2016-11-21  Igor Kudrin  <ikudrin@accesssoftek.com>
 
        * layout.cc: Include windows.h and rpcdce.h (for MinGW32).
index 123d79bc17d65a44076896a3580ff3d3053b7d37..7b3414f5f918f30f8357b23d3693b260a85bc40a 100644 (file)
@@ -492,6 +492,14 @@ queue_middle_tasks(const General_options& options,
   if (timer != NULL)
     timer->stamp(0);
 
+  // We have to support the case of not seeing any input objects, and
+  // generate an empty file.  Existing builds depend on being able to
+  // pass an empty archive to the linker and get an empty object file
+  // out.  In order to do this we need to use a default target.
+  if (input_objects->number_of_input_objects() == 0
+      && layout->incremental_base() == NULL)
+    parameters_force_valid_target();
+
   // Add any symbols named with -u options to the symbol table.
   symtab->add_undefined_symbols_from_command_line(layout);
 
@@ -589,14 +597,6 @@ queue_middle_tasks(const General_options& options,
        }
     }
 
-  // We have to support the case of not seeing any input objects, and
-  // generate an empty file.  Existing builds depend on being able to
-  // pass an empty archive to the linker and get an empty object file
-  // out.  In order to do this we need to use a default target.
-  if (input_objects->number_of_input_objects() == 0
-      && layout->incremental_base() == NULL)
-    parameters_force_valid_target();
-
   int thread_count = options.thread_count_middle();
   if (thread_count == 0)
     thread_count = std::max(2, input_objects->number_of_input_objects());
This page took 0.027183 seconds and 4 git commands to generate.