aboutsummaryrefslogtreecommitdiff
path: root/gold/layout.cc
diff options
context:
space:
mode:
Diffstat (limited to 'gold/layout.cc')
-rw-r--r--gold/layout.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/gold/layout.cc b/gold/layout.cc
index 250782a..1eb2cc0 100644
--- a/gold/layout.cc
+++ b/gold/layout.cc
@@ -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)