From 6934001a98509d5f40ececbd9aa793b8969e27a3 Mon Sep 17 00:00:00 2001 From: Cary Coutant Date: Thu, 30 May 2013 23:01:11 +0000 Subject: 2013-05-30 Alexander Ivchenko Sriraman Tallam * options.h (sort_section): New option. * output.h (Input_section_sort_section_prefix_special_ordering_compare): Rename from Input_section_sort_section_name_special_ordering_compare. (Input_section_sort_section_name_compare): New struct. * output.cc (Output_section::Input_section_sort_section_name_compare:: operator()): New function. (Output_section::sort_attached_input_sections): Use new sort function for .text if --sort-section=name is specified. * layout.cc (Layout::make_output_section): Add sorting by name when --sort-section=name is specified. * testsuite/Makefile.am (text_section_grouping): Test option --sort-section=name. * testsuite/Makefile.in: Regenerate. * testsuite/section_sorting_name.cc: New file. * testsuite/section_sorting_name.sh: New file. --- gold/options.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'gold/options.h') diff --git a/gold/options.h b/gold/options.h index 0055826..052e382 100644 --- a/gold/options.h +++ b/gold/options.h @@ -1056,6 +1056,12 @@ class General_options N_("Sort common symbols by alignment"), N_("[={ascending,descending}]")); + DEFINE_enum(sort_section, options::TWO_DASHES, '\0', "none", + N_("Sort sections by name. \'--no-text-reorder\'" + " will override \'--sort-section=name\' for .text"), + N_("[none,name]"), + {"none", "name"}); + DEFINE_uint(spare_dynamic_tags, options::TWO_DASHES, '\0', 5, N_("Dynamic tag slots to reserve (default 5)"), N_("COUNT")); -- cgit v1.1