This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] [gold] Do not attempt to merge sections with an entsize of 0.


>> 2015-02-04  Peter Collingbourne  <pcc@google.com>
>>
>>         * merge.cc (Output_merge_data::do_add_input_section): Do not attempt to
>>         merge sections with an entsize of 0.

I've committed the following patch.

-cary


2015-02-04  Peter Collingbourne  <pcc@google.com>
            Cary Coutant  <ccoutant@google.com>

       * output.cc (Output_section::add_merge_input_section): Do not
       attempt to merge sections with an entsize of 0.




diff --git a/gold/output.cc b/gold/output.cc
index e9dd522..01838cc 100644
--- a/gold/output.cc
+++ b/gold/output.cc
@@ -2636,6 +2636,10 @@ Output_section::add_merge_input_section(Relobj*
object, unsigned int shndx,
                                        uint64_t addralign,
                                        bool keeps_input_sections)
 {
+  // We cannot merge sections with entsize == 0.
+  if (entsize == 0)
+    return false;
+
   bool is_string = (flags & elfcpp::SHF_STRINGS) != 0;

   // We cannot restore merged input section states.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]