aboutsummaryrefslogtreecommitdiff
path: root/gold/arm.cc
diff options
context:
space:
mode:
authorAndrew Haley <aph@redhat.com>2010-04-21 16:32:31 +0000
committerAndrew Haley <aph@redhat.com>2010-04-21 16:32:31 +0000
commit85fdf9067facc06446531798a158b53c03c1373c (patch)
tree812878934b79e19dd3c22fd67069c92f9c2c3900 /gold/arm.cc
parenta8ae7dc0fb885e983d813eec04a6a4d67e454baf (diff)
downloadgdb-85fdf9067facc06446531798a158b53c03c1373c.zip
gdb-85fdf9067facc06446531798a158b53c03c1373c.tar.gz
gdb-85fdf9067facc06446531798a158b53c03c1373c.tar.bz2
2010-04-15 Andrew Haley <aph@redhat.com>
* emultempl/armelf.em (merge_exidx_entries): New variable. (OPTION_NO_MERGE_EXIDX_ENTRIES): New definition. ("no-merge-exidx-entries"): New option. * ld.texinfo (merge-exidx-entries): Document this option. 2010-04-15 Andrew Haley <aph@redhat.com> * bfd-in.h (elf32_arm_fix_exidx_coverage): Add new flag: merge_exidx_entries. * bfd-in2.h: Likewise. * elf32-arm.c (elf32_arm_fix_exidx_coverage): Likewise. Use it to control merging of exidx entries. 2010-04-15 Andrew Haley <aph@redhat.com> * options.h (merge_exidx_entries): New option. * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries. (class Arm_exidx_fixup::merge_exidx_entries_): New member. (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries. (Target_arm::merge_exidx_entries): New function. (process_exidx_entry): Don't merge if merge_exidx_entries_ is false. (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries to Arm_exidx_fixup constructor. Add new arg, merge_exidx_entries. (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to Arm_output_section::fix_exidx_coverage.
Diffstat (limited to 'gold/arm.cc')
-rw-r--r--gold/arm.cc27
1 files changed, 20 insertions, 7 deletions
diff --git a/gold/arm.cc b/gold/arm.cc
index 028069b..11a0734 100644
--- a/gold/arm.cc
+++ b/gold/arm.cc
@@ -1226,10 +1226,12 @@ class Arm_input_section : public Output_relaxed_input_section
class Arm_exidx_fixup
{
public:
- Arm_exidx_fixup(Output_section* exidx_output_section)
+ Arm_exidx_fixup(Output_section* exidx_output_section,
+ bool merge_exidx_entries = true)
: exidx_output_section_(exidx_output_section), last_unwind_type_(UT_NONE),
last_inlined_entry_(0), last_input_section_(NULL),
- section_offset_map_(NULL), first_output_text_section_(NULL)
+ section_offset_map_(NULL), first_output_text_section_(NULL),
+ merge_exidx_entries_(merge_exidx_entries)
{ }
~Arm_exidx_fixup()
@@ -1301,6 +1303,8 @@ class Arm_exidx_fixup
// Output section for the text section which is linked to the first exidx
// input in output.
Output_section* first_output_text_section_;
+
+ bool merge_exidx_entries_;
};
// Arm output section class. This is defined mainly to add a number of
@@ -1340,7 +1344,8 @@ class Arm_output_section : public Output_section
void
fix_exidx_coverage(Layout* layout,
const Text_section_list& sorted_text_section,
- Symbol_table* symtab);
+ Symbol_table* symtab,
+ bool merge_exidx_entries);
private:
// For convenience.
@@ -2261,6 +2266,11 @@ class Target_arm : public Sized_target<32, big_endian>
fix_cortex_a8() const
{ return this->fix_cortex_a8_; }
+ // Whether we merge exidx entries in debuginfo.
+ bool
+ merge_exidx_entries() const
+ { return parameters->options().merge_exidx_entries(); }
+
// Whether we fix R_ARM_V4BX relocation.
// 0 - do not fix
// 1 - replace with MOV instruction (armv4 target)
@@ -5186,7 +5196,8 @@ Arm_exidx_fixup::process_exidx_entry(uint32_t second_word)
else if ((second_word & 0x80000000) != 0)
{
// Inlined unwinding data. Merge if equal to previous.
- delete_entry = (this->last_unwind_type_ == UT_INLINED_ENTRY
+ delete_entry = (merge_exidx_entries_
+ && this->last_unwind_type_ == UT_INLINED_ENTRY
&& this->last_inlined_entry_ == second_word);
this->last_unwind_type_ = UT_INLINED_ENTRY;
this->last_inlined_entry_ = second_word;
@@ -5553,7 +5564,8 @@ void
Arm_output_section<big_endian>::fix_exidx_coverage(
Layout* layout,
const Text_section_list& sorted_text_sections,
- Symbol_table* symtab)
+ Symbol_table* symtab,
+ bool merge_exidx_entries)
{
// We should only do this for the EXIDX output section.
gold_assert(this->type() == elfcpp::SHT_ARM_EXIDX);
@@ -5585,7 +5597,7 @@ Arm_output_section<big_endian>::fix_exidx_coverage(
known_input_sections.insert(Section_id(p->relobj(), p->shndx()));
}
- Arm_exidx_fixup exidx_fixup(this);
+ Arm_exidx_fixup exidx_fixup(this, merge_exidx_entries);
// Go over the sorted text sections.
Section_id_set processed_input_sections;
@@ -10884,7 +10896,8 @@ Target_arm<big_endian>::fix_exidx_coverage(
arm_output_section->append_text_sections_to_list(&sorted_text_sections);
}
- exidx_section->fix_exidx_coverage(layout, sorted_text_sections, symtab);
+ exidx_section->fix_exidx_coverage(layout, sorted_text_sections, symtab,
+ merge_exidx_entries());
}
Target_selector_arm<false> target_selector_arm;