diff options
author | Sriraman Tallam <tmsriram@google.com> | 2011-09-29 23:45:57 +0000 |
---|---|---|
committer | Sriraman Tallam <tmsriram@google.com> | 2011-09-29 23:45:57 +0000 |
commit | f0558624db8e79622bb71ea5279ec6b5f8c9bc79 (patch) | |
tree | d197f7cab34bbcca71419dd08cdc05e47d661d0d /gold/output.cc | |
parent | a7dac15368485853f4bd463352afb9b49517b624 (diff) | |
download | fsf-binutils-gdb-f0558624db8e79622bb71ea5279ec6b5f8c9bc79.zip fsf-binutils-gdb-f0558624db8e79622bb71ea5279ec6b5f8c9bc79.tar.gz fsf-binutils-gdb-f0558624db8e79622bb71ea5279ec6b5f8c9bc79.tar.bz2 |
2011-09-29 Sriraman Tallam <tmsriram@google.com>
* layout.h (section_order_map_): New member.
(get_section_order_map): New member function.
* output.cc (Output_section::add_input_section): Check for patterns
only when --section-ordering-file is specified.
* gold.cc (queue_middle_tasks): Delay updating order of sections till
output_sections have been formed.
* layout.cc (Layout_Layout): Initialize section_order_map_.
* plugin.cc (update_section_order): Store order in order_map. Do not
update the order.
* testsuite/Makefile.am: Add test case for plugin_final_layout.
* testsuite/Makefile.in: Regenerate.
* testsuite/plugin_section_order.c: New file.
* testsuite/plugin_final_layout.cc: New file.
* testsuite/plugin_final_layout.sh: New file.
Diffstat (limited to 'gold/output.cc')
-rw-r--r-- | gold/output.cc | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/gold/output.cc b/gold/output.cc index 29d8e3d..63f0109 100644 --- a/gold/output.cc +++ b/gold/output.cc @@ -2476,7 +2476,10 @@ Output_section::add_input_section(Layout* layout, || layout->is_section_ordering_specified()) { Input_section isecn(object, shndx, input_section_size, addralign); - if (layout->is_section_ordering_specified()) + /* If section ordering is requested by specifying a ordering file, + using --section-ordering-file, match the section name with + a pattern. */ + if (parameters->options().section_ordering_file()) { unsigned int section_order_index = layout->find_section_order_index(std::string(secname)); @@ -3485,7 +3488,7 @@ Output_section::Input_section_sort_section_order_index_compare::operator()( void Output_section::update_section_layout( - const Section_layout_order& order_map) + const Section_layout_order* order_map) { for (Input_section_list::iterator p = this->input_sections_.begin(); p != this->input_sections_.end(); @@ -3499,8 +3502,8 @@ Output_section::update_section_layout( : p->relaxed_input_section()->relobj()); unsigned int shndx = p->shndx(); Section_layout_order::const_iterator it - = order_map.find(Section_id(obj, shndx)); - if (it == order_map.end()) + = order_map->find(Section_id(obj, shndx)); + if (it == order_map->end()) continue; unsigned int section_order_index = it->second; if (section_order_index != 0) |