aboutsummaryrefslogtreecommitdiff
path: root/gold
diff options
context:
space:
mode:
authorDoug Kwan <dougkwan@google.com>2010-02-02 00:25:57 +0000
committerDoug Kwan <dougkwan@google.com>2010-02-02 00:25:57 +0000
commit546c74577f9ddfeb870b518f3c1d32e71bed52be (patch)
treeaac5de7101f45e40c8767415959513580ec9855c /gold
parent54c4e2c2dcf7dba4c248b474cf1b3ba3ba8a37d7 (diff)
downloadgdb-546c74577f9ddfeb870b518f3c1d32e71bed52be.zip
gdb-546c74577f9ddfeb870b518f3c1d32e71bed52be.tar.gz
gdb-546c74577f9ddfeb870b518f3c1d32e71bed52be.tar.bz2
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.
Diffstat (limited to 'gold')
-rw-r--r--gold/ChangeLog11
-rw-r--r--gold/arm.cc27
2 files changed, 37 insertions, 1 deletions
diff --git a/gold/ChangeLog b/gold/ChangeLog
index 861ae2a..2a811db 100644
--- a/gold/ChangeLog
+++ b/gold/ChangeLog
@@ -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,
diff --git a/gold/arm.cc b/gold/arm.cc
index 90deaa6..89a4149 100644
--- a/gold/arm.cc
+++ b/gold/arm.cc
@@ -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();