Fix internal error in do_relocate_sections when using plugins.
authorCary Coutant <ccoutant@gmail.com>
Sun, 22 Mar 2015 00:47:49 +0000 (17:47 -0700)
committerCary Coutant <ccoutant@gmail.com>
Sun, 22 Mar 2015 00:49:21 +0000 (17:49 -0700)
In a previous patch for PR 14675, to fix a problem with
the .eh_frame section when static linking, I added a step to
finalize the .eh_frame section at the end of the first link
pass. This patch caused PR 18152, where a plugin-claimed
object caused a non-claimed object's layout to be deferred
until replacement files were read. The call to
finalize_eh_frame_section() is happening before the layout of
the deferred objects, leading to the internal error in
do_relocate_sections.

This patch moves the finalization of the .eh_frame section to
after deferred objects have been processed.

gold/
PR gold/14675
PR gold/18152
* gold.cc (queue_middle_tasks): Finalize .eh_frame after laying out
deferred objects.

gold/ChangeLog
gold/gold.cc

index f94e170b86429151bf11b785b5917db252bc5305..30de67c73de9d1d35789ddeee73c00a4e9770364 100644 (file)
@@ -1,3 +1,9 @@
+2015-03-21  Cary Coutant  <ccoutant@google.com>
+
+       PR gold/18152
+       * gold.cc (queue_middle_tasks): Finalize .eh_frame after laying out
+       deferred objects.
+
 2015-03-11  Cary Coutant  <ccoutant@google.com>
 
        * options.cc (General_options::finalize): Don't allow -z relro
index e345887ac12956f088f10fe3d6c342c488f017ad..39843c28684f0c80ff74b7df7e983f97705227ba 100644 (file)
@@ -492,9 +492,6 @@ queue_middle_tasks(const General_options& options,
   if (timer != NULL)
     timer->stamp(0);
 
-  // Finalize the .eh_frame section.
-  layout->finalize_eh_frame_section();
-
   // Add any symbols named with -u options to the symbol table.
   symtab->add_undefined_symbols_from_command_line(layout);
 
@@ -555,6 +552,9 @@ queue_middle_tasks(const General_options& options,
       plugins->layout_deferred_objects();
     }
 
+  // Finalize the .eh_frame section.
+  layout->finalize_eh_frame_section();
+
   /* If plugins have specified a section order, re-arrange input sections
      according to a specified section order.  If --section-ordering-file is
      also specified, do not do anything here.  */
This page took 0.033883 seconds and 4 git commands to generate.