Default text reordering fix with a flag to turn it off.
[deliverable/binutils-gdb.git] / gold / layout.cc
index 250782a92bead199a193ca48ed9c6d4b7e41c70c..1eb2cc018d3995d309b203752730de2e32afaa64 100644 (file)
@@ -1149,7 +1149,8 @@ Layout::layout(Sized_relobj_file<size, big_endian>* object, unsigned int shndx,
 
   // By default the GNU linker sorts some special text sections ahead
   // of others.  We are compatible.
-  if (!this->script_options_->saw_sections_clause()
+  if (parameters->options().text_reorder()
+      && !this->script_options_->saw_sections_clause()
       && !this->is_section_ordering_specified()
       && !parameters->options().relocatable()
       && Layout::special_ordering_of_input_section(name) >= 0)
@@ -1646,7 +1647,8 @@ Layout::make_output_section(const char* name, elfcpp::Elf_Word type,
   // sections before other .text sections.  We are compatible.  We
   // need to know that this might happen before we attach any input
   // sections.
-  if (!this->script_options_->saw_sections_clause()
+  if (parameters->options().text_reorder()
+      && !this->script_options_->saw_sections_clause()
       && !this->is_section_ordering_specified()
       && !parameters->options().relocatable()
       && strcmp(name, ".text") == 0)
This page took 0.025097 seconds and 4 git commands to generate.