diff options
Diffstat (limited to 'binutils-2.23/gold/layout.cc')
-rw-r--r-- | binutils-2.23/gold/layout.cc | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/binutils-2.23/gold/layout.cc b/binutils-2.23/gold/layout.cc index 994249b..fbad272 100644 --- a/binutils-2.23/gold/layout.cc +++ b/binutils-2.23/gold/layout.cc @@ -1577,6 +1577,10 @@ Layout::make_output_section(const char* name, elfcpp::Elf_Word type, && strcmp(name, ".text") == 0) os->set_may_sort_attached_input_sections(); + // GNU linker sorts section by name with --sort-section=name. + if (strcmp(parameters->options().sort_section(), "name") == 0) + os->set_must_sort_attached_input_sections(); + // Check for .stab*str sections, as .stab* sections need to link to // them. if (type == elfcpp::SHT_STRTAB |