diff --git a/gold/ChangeLog b/gold/ChangeLog index 6dbb2e6..684500e 100644 --- a/gold/ChangeLog +++ b/gold/ChangeLog @@ -1,16 +1,21 @@ +2013-01-29 Alexander Ivchenko + + * output.h (Input_section_sort_section_name_special_ordering_compare): + Add sorting by name for .text sections with the same prefix. + 2013-01-28 Cary Coutant - * dwp.cc (File_list): New typedef. - (Dwo_name_info_reader): New class. - (Dwo_id_info_reader::Dwo_id_info_reader): Remove unused parameters. - (Dwo_id_info_reader::visit_top_die): Remove unused member function. - (Dwo_file::~Dwo_file): Delete input_file_ after obj_. - (Dwo_file::read_executable): New function. - (Dwo_file::read): Move common setup code to ... - (Dwo_file::make_object): ... here. - (dwp_options): Add --exec/-e. - (usage): Likewise. - (main): Likewise. + * dwp.cc (File_list): New typedef. + (Dwo_name_info_reader): New class. + (Dwo_id_info_reader::Dwo_id_info_reader): Remove unused parameters. + (Dwo_id_info_reader::visit_top_die): Remove unused member function. + (Dwo_file::~Dwo_file): Delete input_file_ after obj_. + (Dwo_file::read_executable): New function. + (Dwo_file::read): Move common setup code to ... + (Dwo_file::make_object): ... here. + (dwp_options): Add --exec/-e. + (usage): Likewise. + (main): Likewise. 2013-01-24 Sriraman Tallam diff --git a/gold/output.cc b/gold/output.cc index 22c0bf0..ef4cb51 100644 --- a/gold/output.cc +++ b/gold/output.cc @@ -3513,7 +3513,7 @@ Output_section::Input_section_sort_section_name_special_ordering_compare return false; return s1.index() < s2.index(); } - + // Some input section names have special ordering requirements. int o1 = Layout::special_ordering_of_input_section(s1.section_name().c_str()); int o2 = Layout::special_ordering_of_input_section(s2.section_name().c_str()); @@ -3527,8 +3527,13 @@ Output_section::Input_section_sort_section_name_special_ordering_compare return o1 < o2; } + // Within each prefix we sort by name. + int compare = s1.section_name().compare(s2.section_name()); + if (compare != 0) + return compare < 0; + // Keep input order otherwise. - return s1.index() < s2.index(); + return s1.index() < s2.index(); } // This updates the section order index of input sections according to the