aboutsummaryrefslogtreecommitdiff
path: root/gold
diff options
context:
space:
mode:
authorDoug Kwan <dougkwan@google.com>2010-10-29 20:49:20 +0000
committerDoug Kwan <dougkwan@google.com>2010-10-29 20:49:20 +0000
commitd06fb4d1df16ab118624e9abd711005d044a176b (patch)
treeaa6a4a62b185dea10390a299c048c1e13a595b7e /gold
parentae6a0217c573fdf00a40820a325cb988a03271d2 (diff)
downloadgdb-d06fb4d1df16ab118624e9abd711005d044a176b.zip
gdb-d06fb4d1df16ab118624e9abd711005d044a176b.tar.gz
gdb-d06fb4d1df16ab118624e9abd711005d044a176b.tar.bz2
2010-10-29 Doug Kwan <dougkwan@google.com>
* arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to Output_section::add_relaxed_input_section. * output.cc (Output_section::add_relaxed_input_section): Add new arguments LAYOUT and NAME. Set section order index. (Output_section::convert_input_sections_in_list_to_relaxed_sections): Copy section order index. * output.h (Output_section::add_relaxed_input_section): Add new arguments LAYOUT and NAME.
Diffstat (limited to 'gold')
-rw-r--r--gold/ChangeLog11
-rw-r--r--gold/arm.cc3
-rw-r--r--gold/output.cc24
-rw-r--r--gold/output.h7
4 files changed, 41 insertions, 4 deletions
diff --git a/gold/ChangeLog b/gold/ChangeLog
index e187759..ad1bd19 100644
--- a/gold/ChangeLog
+++ b/gold/ChangeLog
@@ -1,3 +1,14 @@
+2010-10-29 Doug Kwan <dougkwan@google.com>
+
+ * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
+ Output_section::add_relaxed_input_section.
+ * output.cc (Output_section::add_relaxed_input_section): Add new
+ arguments LAYOUT and NAME. Set section order index.
+ (Output_section::convert_input_sections_in_list_to_relaxed_sections):
+ Copy section order index.
+ * output.h (Output_section::add_relaxed_input_section): Add new
+ arguments LAYOUT and NAME.
+
2010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
* testsuite/Makefile.am: Move gcctestdir/ld rule to
diff --git a/gold/arm.cc b/gold/arm.cc
index c2dc026..6556828 100644
--- a/gold/arm.cc
+++ b/gold/arm.cc
@@ -5847,7 +5847,8 @@ Arm_output_section<big_endian>::fix_exidx_coverage(
Arm_exidx_merged_section* merged_section =
new Arm_exidx_merged_section(*exidx_input_section,
*section_offset_map, deleted_bytes);
- this->add_relaxed_input_section(merged_section);
+ const std::string secname = exidx_relobj->section_name(exidx_shndx);
+ this->add_relaxed_input_section(layout, merged_section, secname);
arm_relobj->convert_input_section_to_relaxed_section(exidx_shndx);
// All local symbols defined in discarded portions of this input
diff --git a/gold/output.cc b/gold/output.cc
index 1368c19..dda475d 100644
--- a/gold/output.cc
+++ b/gold/output.cc
@@ -2203,9 +2203,25 @@ Output_section::add_output_section_data(Output_section_data* posd)
// Add a relaxed input section.
void
-Output_section::add_relaxed_input_section(Output_relaxed_input_section* poris)
+Output_section::add_relaxed_input_section(Layout* layout,
+ Output_relaxed_input_section* poris,
+ const std::string& name)
{
Input_section inp(poris);
+
+ // If the --section-ordering-file option is used to specify the order of
+ // sections, we need to keep track of sections.
+ if (parameters->options().section_ordering_file())
+ {
+ unsigned int section_order_index =
+ layout->find_section_order_index(name);
+ if (section_order_index != 0)
+ {
+ inp.set_section_order_index(section_order_index);
+ this->set_input_section_order_specified();
+ }
+ }
+
this->add_output_section_data(&inp);
if (this->lookup_maps_->is_valid())
this->lookup_maps_->add_relaxed_input_section(poris->relobj(),
@@ -2373,7 +2389,13 @@ Output_section::convert_input_sections_in_list_to_relaxed_sections(
Relaxation_map::const_iterator p = map.find(sid);
gold_assert(p != map.end());
gold_assert((*input_sections)[p->second].is_input_section());
+
+ // Remember section order index of original input section
+ // if it is set. Copy it to the relaxed input section.
+ unsigned int soi =
+ (*input_sections)[p->second].section_order_index();
(*input_sections)[p->second] = Input_section(poris);
+ (*input_sections)[p->second].set_section_order_index(soi);
}
}
diff --git a/gold/output.h b/gold/output.h
index d36d587..1bfb054 100644
--- a/gold/output.h
+++ b/gold/output.h
@@ -2542,9 +2542,12 @@ class Output_section : public Output_data
void
add_output_section_data(Output_section_data* posd);
- // Add a relaxed input section PORIS to this output section.
+ // Add a relaxed input section PORIS called NAME to this output section
+ // with LAYOUT.
void
- add_relaxed_input_section(Output_relaxed_input_section* poris);
+ add_relaxed_input_section(Layout* layout,
+ Output_relaxed_input_section* poris,
+ const std::string& name);
// Return the section name.
const char*