summaryrefslogtreecommitdiff
path: root/gold/gold.cc
diff options
context:
space:
mode:
authorSriraman Tallam <tmsriram@google.com>2011-09-29 23:45:57 +0000
committerSriraman Tallam <tmsriram@google.com>2011-09-29 23:45:57 +0000
commitf0558624db8e79622bb71ea5279ec6b5f8c9bc79 (patch)
treed197f7cab34bbcca71419dd08cdc05e47d661d0d /gold/gold.cc
parenta7dac15368485853f4bd463352afb9b49517b624 (diff)
downloadbinutils-gdb-f0558624db8e79622bb71ea5279ec6b5f8c9bc79.tar.gz
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/gold.cc')
-rw-r--r--gold/gold.cc14
1 files changed, 14 insertions, 0 deletions
diff --git a/gold/gold.cc b/gold/gold.cc
index 693ff79b28b..2700bdb5ef6 100644
--- a/gold/gold.cc
+++ b/gold/gold.cc
@@ -539,6 +539,20 @@ queue_middle_tasks(const General_options& options,
}
}
+ /* If plugins have specified a section order, re-arrange input sections
+ according to a specified section order. If --section-ordering-file is
+ also specified, do not do anything here. */
+ if (parameters->options().has_plugins()
+ && layout->is_section_ordering_specified()
+ && !parameters->options().section_ordering_file ())
+ {
+ for (Layout::Section_list::const_iterator p
+ = layout->section_list().begin();
+ p != layout->section_list().end();
+ ++p)
+ (*p)->update_section_layout(layout->get_section_order_map());
+ }
+
// Layout deferred objects due to plugins.
if (parameters->options().has_plugins())
{