2010-10-20 Doug Kwan <dougkwan@google.com>
authorDoug Kwan <dougkwan@google.com>
Wed, 20 Oct 2010 15:30:54 +0000 (15:30 +0000)
committerDoug Kwan <dougkwan@google.com>
Wed, 20 Oct 2010 15:30:54 +0000 (15:30 +0000)
* arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
without SHF_LINK_ORDER flags.
* layout.cc (Layout::choose_output_section): Do not filter
SHF_LINK_ORDER flag in a relocatable link.

gold/ChangeLog
gold/arm.cc
gold/layout.cc

index a6e6ab6fbf0af7ccf5c9819a3b9081098d708170..9560dab84885ebdf900a9965ab5de4121130d1b8 100644 (file)
@@ -1,3 +1,10 @@
+2010-10-20  Doug Kwan  <dougkwan@google.com>
+
+       * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
+       without SHF_LINK_ORDER flags.
+       * layout.cc (Layout::choose_output_section): Do not filter
+       SHF_LINK_ORDER flag in a relocatable link.
+
 2010-10-17  Cary Coutant  <ccoutant@google.com>
 
        * output.h (Output_segment::set_section_addresses): Change function
index f13ef234397108693df7b0f4f1a8d83acfe310cb..c2dc026dac177d25f1fa7700b766924824099900 100644 (file)
@@ -6662,6 +6662,10 @@ Arm_relobj<big_endian>::do_read_symbols(Read_symbols_data* sd)
                                                     + text_shndx * shdr_size);
              this->make_exidx_input_section(i, shdr, text_shndx, text_shdr);
            }
+         // EHABI 4.4.1 requires that SHF_LINK_ORDER flag to be set.
+         if ((shdr.get_sh_flags() & elfcpp::SHF_LINK_ORDER) == 0)
+           gold_warning(_("SHF_LINK_ORDER not set in EXIDX section %s of %s"),
+                        this->section_name(i).c_str(), this->name().c_str());
        }
     }
 
index 95f1de755a0e425953a613b84f1db8e9fc3b9670..bc6a053c487ecccd55b0ebea2611c672d6fc10d4 100644 (file)
@@ -489,11 +489,15 @@ Layout::choose_output_section(const Relobj* relobj, const char* name,
   // Some flags in the input section should not be automatically
   // copied to the output section.
   flags &= ~ (elfcpp::SHF_INFO_LINK
-             | elfcpp::SHF_LINK_ORDER
              | elfcpp::SHF_GROUP
              | elfcpp::SHF_MERGE
              | elfcpp::SHF_STRINGS);
 
+  // We only clear the SHF_LINK_ORDER flag in for
+  // a non-relocatable link.
+  if (!parameters->options().relocatable())
+    flags &= ~elfcpp::SHF_LINK_ORDER;
+
   if (this->script_options_->saw_sections_clause())
     {
       // We are using a SECTIONS clause, so the output section is