From c6ac678db54ed727cb673a87beeb7a41bdf13182 Mon Sep 17 00:00:00 2001 From: Sriraman Tallam Date: Thu, 24 Jan 2013 18:49:55 +0000 Subject: Default text reordering fix with a flag to turn it off. 2013-01-24 Sriraman Tallam * layout.cc (Layout::layout): Check for option text_reorder. (Layout::make_output_section): Ditto. * options.h (text_reorder): New option. * output.cc (Input_section_sort_compare): Remove special ordering of section names. (Output_section:: Input_section_sort_section_name_special_ordering_compare:: operator()): New function. (Output_section::sort_attached_input_sections): Use new sort function for .text. * output.h (Input_section_sort_section_name_special_ordering_compare): New struct. * testsuite/Makefile.am (text_section_grouping): Test option --no-text-reorder * testsuite/Makefile.in: Regenerate. * testsuite/text_section_grouping.sh: Check order of functions without default text reordering. --- gold/options.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'gold/options.h') diff --git a/gold/options.h b/gold/options.h index 9e65e8d..c138fa2 100644 --- a/gold/options.h +++ b/gold/options.h @@ -878,6 +878,11 @@ class General_options DEFINE_dirlist(library_path, options::TWO_DASHES, 'L', N_("Add directory to search path"), N_("DIR")); + DEFINE_bool(text_reorder, options::TWO_DASHES, '\0', true, + N_("Enable text section reordering for GCC section names " + "(default)"), + N_("Disable text section reordering for GCC section names")); + DEFINE_bool(nostdlib, options::ONE_DASH, '\0', false, N_(" Only search directories specified on the command line."), NULL); -- cgit v1.1