From edcac0c105556029774320bc8288beb472e999b5 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Fri, 21 Dec 2012 06:24:31 +0000 Subject: * layout.cc (Layout::special_ordering_of_input_section): New function. (Layout::layout): If input section requires special ordering, must sort input sections. (Layout::make_output_section): May sort .text input sections. (Layout::is_section_name_prefix_grouped): Remove. * layout.h (class Layout): Declare special_ordering_of_input_section. Don't declare is_section_name_prefix_grouped. * output.cc (Output_section::add_input_section): Revert last change. (Output_section::Input_section_sort::match_file_name): Don't crash if called on output section data. (Output_section::Input_section_sort_compare): Sort based on special ordering. (Output_section::Input_section_sort_section_order_index_compare): Revert last patch. (Output_section::sort_attached_input_sections): Likewise. --- gold/layout.h | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'gold/layout.h') diff --git a/gold/layout.h b/gold/layout.h index 71f1aa7a495..6da96075047 100644 --- a/gold/layout.h +++ b/gold/layout.h @@ -553,11 +553,14 @@ class Layout void insert_section_segment_map(Const_section_id secn, Unique_segment_info *s); - // By default, gold groups input sections with certain prefixes. This - // function returns true if this section name NAME contains such a prefix. - bool - is_section_name_prefix_grouped(const char *name); - + // Some input sections require special ordering, for compatibility + // with GNU ld. Given the name of an input section, return -1 if it + // does not require special ordering. Otherwise, return the index + // by which it should be ordered compared to other input sections + // that require special ordering. + static int + special_ordering_of_input_section(const char* name); + bool is_section_ordering_specified() { return this->section_ordering_specified_; } -- cgit v1.2.1