From f0558624db8e79622bb71ea5279ec6b5f8c9bc79 Mon Sep 17 00:00:00 2001 From: Sriraman Tallam Date: Thu, 29 Sep 2011 23:45:57 +0000 Subject: 2011-09-29 Sriraman Tallam * 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. --- gold/layout.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'gold/layout.h') diff --git a/gold/layout.h b/gold/layout.h index 05cb50f..d76fc96 100644 --- a/gold/layout.h +++ b/gold/layout.h @@ -522,6 +522,10 @@ class Layout const char* name, const elfcpp::Shdr& shdr, unsigned int reloc_shndx, unsigned int reloc_type, off_t* offset); + std::map* + get_section_order_map() + { return &this->section_order_map_; } + bool is_section_ordering_specified() { return this->section_ordering_specified_; } @@ -1322,6 +1326,9 @@ class Layout Segment_states* segment_states_; // A relaxation debug checker. We only create one when in debugging mode. Relaxation_debug_check* relaxation_debug_check_; + // Plugins specify section_ordering using this map. This is set in + // update_section_order in plugin.cc + std::map section_order_map_; // Hash a pattern to its position in the section ordering file. Unordered_map input_section_position_; // Vector of glob only patterns in the section_ordering file. -- cgit v1.1