diff options
author | Andrew Hsieh <andrewhsieh@google.com> | 2013-06-03 09:31:19 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2013-06-03 09:31:19 +0000 |
commit | 6e4f9ded07a7e180ad3f38be99b3a027351a7e67 (patch) | |
tree | aa5100edc5a6043efe91a610f92760499d73a815 /binutils-2.22/gold/layout.cc | |
parent | 93e5e14dd61bc5c558ef5b0d1d1c0e9e3e11dc2c (diff) | |
parent | 2d40f3b3a19a2dbe48157af32fb3089bffb14aae (diff) | |
download | toolchain_binutils-6e4f9ded07a7e180ad3f38be99b3a027351a7e67.tar.gz toolchain_binutils-6e4f9ded07a7e180ad3f38be99b3a027351a7e67.tar.bz2 toolchain_binutils-6e4f9ded07a7e180ad3f38be99b3a027351a7e67.zip |
Merge "[2.22], [2.23] Backport of the patch that enables "--sort-section=name" command line option in gold."
Diffstat (limited to 'binutils-2.22/gold/layout.cc')
-rw-r--r-- | binutils-2.22/gold/layout.cc | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/binutils-2.22/gold/layout.cc b/binutils-2.22/gold/layout.cc index 994249b1..fbad2723 100644 --- a/binutils-2.22/gold/layout.cc +++ b/binutils-2.22/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 |