summaryrefslogtreecommitdiffstats
path: root/binutils-2.22/gold/layout.cc
diff options
context:
space:
mode:
Diffstat (limited to 'binutils-2.22/gold/layout.cc')
-rw-r--r--binutils-2.22/gold/layout.cc8
1 files changed, 6 insertions, 2 deletions
diff --git a/binutils-2.22/gold/layout.cc b/binutils-2.22/gold/layout.cc
index cc800cdb..994249b1 100644
--- a/binutils-2.22/gold/layout.cc
+++ b/binutils-2.22/gold/layout.cc
@@ -1081,7 +1081,9 @@ 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)
os->set_must_sort_attached_input_sections();
@@ -1568,7 +1570,9 @@ 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)
os->set_may_sort_attached_input_sections();