]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
2010-02-01 Doug Kwan <dougkwan@google.com>
authorDoug Kwan <dougkwan@google.com>
Tue, 2 Feb 2010 00:25:57 +0000 (00:25 +0000)
committerDoug Kwan <dougkwan@google.com>
Tue, 2 Feb 2010 00:25:57 +0000 (00:25 +0000)
* arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
first_output_text_section_.
(Arm_exidx_fixup::first_output_text_section): New method definition.
(Arm_exidx_fixup::first_output_text_section_): New data member.
(Arm_exidx_fixup::process_exidx_section): Record the first text
output section seen.
(Arm_output_section::fix_exidx_coverage): Set correct linked section
and entsize in output section header.

gold/ChangeLog
gold/arm.cc

index 861ae2a9a8aff424161342b4d7b57a5ec28cf68f..2a811dbc9c8444037fe78e7f7c1cb26c8dd46d66 100644 (file)
@@ -1,3 +1,14 @@
+2010-02-01  Doug Kwan  <dougkwan@google.com>
+
+       * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
+       first_output_text_section_.
+       (Arm_exidx_fixup::first_output_text_section): New method definition.
+       (Arm_exidx_fixup::first_output_text_section_): New data member.
+       (Arm_exidx_fixup::process_exidx_section): Record the first text
+       output section seen.
+       (Arm_output_section::fix_exidx_coverage): Set correct linked section
+       and entsize in output section header.
+
 2010-01-29  Viktor Kutuzov  <vkutuzov@accesssoftek.com>
 
        * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
index 90deaa6dfe064dcb732231c487c7dea489f73046..89a4149f4917df1e676257f6bb70f5bbe1f5c448 100644 (file)
@@ -1210,7 +1210,7 @@ class Arm_exidx_fixup
   Arm_exidx_fixup(Output_section* exidx_output_section)
     : exidx_output_section_(exidx_output_section), last_unwind_type_(UT_NONE),
       last_inlined_entry_(0), last_input_section_(NULL),
-      section_offset_map_(NULL)
+      section_offset_map_(NULL), first_output_text_section_(NULL)
   { }
 
   ~Arm_exidx_fixup()
@@ -1231,6 +1231,12 @@ class Arm_exidx_fixup
   void
   add_exidx_cantunwind_as_needed();
 
+  // Return the output section for the text section which is linked to the
+  // first exidx input in output.
+  Output_section*
+  first_output_text_section() const
+  { return this->first_output_text_section_; }
+
  private:
   // Copying is not allowed.
   Arm_exidx_fixup(const Arm_exidx_fixup&);
@@ -1273,6 +1279,9 @@ class Arm_exidx_fixup
   const Arm_exidx_input_section* last_input_section_;
   // Section offset map created in process_exidx_section.
   Arm_exidx_section_offset_map* section_offset_map_;
+  // Output section for the text section which is linked to the first exidx
+  // input in output.
+  Output_section* first_output_text_section_;
 };
 
 // Arm output section class.  This is defined mainly to add a number of
@@ -5159,6 +5168,17 @@ Arm_exidx_fixup::process_exidx_section(
   this->section_offset_map_ = NULL;
   this->last_input_section_ = exidx_input_section;
   
+  // Set the first output text section so that we can link the EXIDX output
+  // section to it.  Ignore any EXIDX input section that is completely merged.
+  if (this->first_output_text_section_ == NULL
+      && deleted_bytes != section_size)
+    {
+      unsigned int link = exidx_input_section->link();
+      Output_section* os = relobj->output_section(link);
+      gold_assert(os != NULL);
+      this->first_output_text_section_ = os;
+    }
+
   return deleted_bytes;
 }
 
@@ -5547,6 +5567,11 @@ Arm_output_section<big_endian>::fix_exidx_coverage(
        }
     }
     
+  // Link exidx output section to the first seen output section and
+  // set correct entry size.
+  this->set_link_section(exidx_fixup.first_output_text_section());
+  this->set_entsize(8);
+
   // Make changes permanent.
   this->save_states();
   this->set_section_offsets_need_adjustment();