aboutsummaryrefslogtreecommitdiff
path: root/gold/layout.cc
diff options
context:
space:
mode:
authorSriraman Tallam <tmsriram@google.com>2013-01-16 22:47:14 +0000
committerSriraman Tallam <tmsriram@google.com>2013-01-16 22:47:14 +0000
commit7c381248b302a5290a3f7a240a2cfe14181d7e24 (patch)
treee55f6bc22d214f59b4a6b19ce27364d4dbb485d4 /gold/layout.cc
parent6a3e1baeae1ce25cc959d53a84925074a97deef9 (diff)
downloadgdb-7c381248b302a5290a3f7a240a2cfe14181d7e24.zip
gdb-7c381248b302a5290a3f7a240a2cfe14181d7e24.tar.gz
gdb-7c381248b302a5290a3f7a240a2cfe14181d7e24.tar.bz2
2013-01-16 Sriraman Tallam <tmsriram@google.com>
* layout.cc (Layout::layout): Do not do default sorting for text sections when section ordering is specified. (make_output_section): Ditto. * testsuite/plugin_final_layout.cc: Name the function sections to catch reordering issues.
Diffstat (limited to 'gold/layout.cc')
-rw-r--r--gold/layout.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/gold/layout.cc b/gold/layout.cc
index f7f0e7e..576d44b 100644
--- a/gold/layout.cc
+++ b/gold/layout.cc
@@ -1150,6 +1150,7 @@ 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()
+ && !this->is_section_ordering_specified()
&& !parameters->options().relocatable()
&& Layout::special_ordering_of_input_section(name) >= 0)
os->set_must_sort_attached_input_sections();
@@ -1646,6 +1647,7 @@ Layout::make_output_section(const char* name, elfcpp::Elf_Word type,
// need to know that this might happen before we attach any input
// sections.
if (!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();