aboutsummaryrefslogtreecommitdiff
path: root/gold
diff options
context:
space:
mode:
authorRafael Ávila de Espíndola <respindola@mozilla.com>2010-09-08 18:31:35 +0000
committerRafael Ávila de Espíndola <respindola@mozilla.com>2010-09-08 18:31:35 +0000
commit731ca54a85292ebb897a0d01efefe7f6320279d9 (patch)
tree2212fb89a4140377d5992e4ea65c0ddf921ac15c /gold
parent9bd89d67b6a67f05379ee423e89146671d8ace83 (diff)
downloadgdb-731ca54a85292ebb897a0d01efefe7f6320279d9.zip
gdb-731ca54a85292ebb897a0d01efefe7f6320279d9.tar.gz
gdb-731ca54a85292ebb897a0d01efefe7f6320279d9.tar.bz2
2010-09-08 Rafael Espindola <espindola@google.com>
* arm.cc (do_finalize_sections): Create the __exidx_start and __exdix_end symbols even when the section is missing.
Diffstat (limited to 'gold')
-rw-r--r--gold/ChangeLog5
-rw-r--r--gold/arm.cc69
2 files changed, 48 insertions, 26 deletions
diff --git a/gold/ChangeLog b/gold/ChangeLog
index 45b3d7c..c5f3bda 100644
--- a/gold/ChangeLog
+++ b/gold/ChangeLog
@@ -1,3 +1,8 @@
+2010-09-08 Rafael Espindola <espindola@google.com>
+
+ * arm.cc (do_finalize_sections): Create the __exidx_start and
+ __exdix_end symbols even when the section is missing.
+
2010-09-08 Nick Clifton <nickc@redhat.com>
* README: Remove claim that MEMORY is not supported.
diff --git a/gold/arm.cc b/gold/arm.cc
index 4353489..85f9542 100644
--- a/gold/arm.cc
+++ b/gold/arm.cc
@@ -8426,33 +8426,50 @@ Target_arm<big_endian>::do_finalize_sections(
// Handle the .ARM.exidx section.
Output_section* exidx_section = layout->find_output_section(".ARM.exidx");
- if (exidx_section != NULL
- && exidx_section->type() == elfcpp::SHT_ARM_EXIDX
- && !parameters->options().relocatable())
- {
- // Create __exidx_start and __exdix_end symbols.
- symtab->define_in_output_data("__exidx_start", NULL,
- Symbol_table::PREDEFINED,
- exidx_section, 0, 0, elfcpp::STT_OBJECT,
- elfcpp::STB_GLOBAL, elfcpp::STV_HIDDEN, 0,
- false, true);
- symtab->define_in_output_data("__exidx_end", NULL,
- Symbol_table::PREDEFINED,
- exidx_section, 0, 0, elfcpp::STT_OBJECT,
- elfcpp::STB_GLOBAL, elfcpp::STV_HIDDEN, 0,
- true, true);
- // For the ARM target, we need to add a PT_ARM_EXIDX segment for
- // the .ARM.exidx section.
- if (!layout->script_options()->saw_phdrs_clause())
- {
- gold_assert(layout->find_output_segment(elfcpp::PT_ARM_EXIDX, 0, 0)
- == NULL);
- Output_segment* exidx_segment =
- layout->make_output_segment(elfcpp::PT_ARM_EXIDX, elfcpp::PF_R);
- exidx_segment->add_output_section_to_nonload(exidx_section,
- elfcpp::PF_R);
- }
+ if (!parameters->options().relocatable())
+ {
+ if (exidx_section != NULL
+ && exidx_section->type() == elfcpp::SHT_ARM_EXIDX)
+ {
+ // Create __exidx_start and __exdix_end symbols.
+ symtab->define_in_output_data("__exidx_start", NULL,
+ Symbol_table::PREDEFINED,
+ exidx_section, 0, 0, elfcpp::STT_OBJECT,
+ elfcpp::STB_GLOBAL, elfcpp::STV_HIDDEN,
+ 0, false, true);
+ symtab->define_in_output_data("__exidx_end", NULL,
+ Symbol_table::PREDEFINED,
+ exidx_section, 0, 0, elfcpp::STT_OBJECT,
+ elfcpp::STB_GLOBAL, elfcpp::STV_HIDDEN,
+ 0, true, true);
+
+ // For the ARM target, we need to add a PT_ARM_EXIDX segment for
+ // the .ARM.exidx section.
+ if (!layout->script_options()->saw_phdrs_clause())
+ {
+ gold_assert(layout->find_output_segment(elfcpp::PT_ARM_EXIDX, 0,
+ 0)
+ == NULL);
+ Output_segment* exidx_segment =
+ layout->make_output_segment(elfcpp::PT_ARM_EXIDX, elfcpp::PF_R);
+ exidx_segment->add_output_section_to_nonload(exidx_section,
+ elfcpp::PF_R);
+ }
+ }
+ else
+ {
+ symtab->define_as_constant("__exidx_start", NULL,
+ Symbol_table::PREDEFINED,
+ 0, 0, elfcpp::STT_OBJECT,
+ elfcpp::STB_GLOBAL, elfcpp::STV_HIDDEN, 0,
+ true, false);
+ symtab->define_as_constant("__exidx_end", NULL,
+ Symbol_table::PREDEFINED,
+ 0, 0, elfcpp::STT_OBJECT,
+ elfcpp::STB_GLOBAL, elfcpp::STV_HIDDEN, 0,
+ true, false);
+ }
}
// Create an .ARM.attributes section if we have merged any attributes