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]

[GOLD] assertion on more than one PT_NOTE


I see no reason why an executable should be limited to one PT_NOTE
header.  This patch removes that limitation in gold.

As far as I can see there is no code in gold that needs segments to be
unique like this.  OK to apply?

	PR gold/15355
	* layout.cc (Layout::segment_precedes): Allow more than one
	segment with the same type and flags.

Index: gold/layout.cc
===================================================================
RCS file: /cvs/src/src/gold/layout.cc,v
retrieving revision 1.248
diff -u -p -r1.248 layout.cc
--- gold/layout.cc	21 Mar 2013 04:52:55 -0000	1.248
+++ gold/layout.cc	14 Apr 2013 05:22:26 -0000
@@ -3174,13 +3174,11 @@ Layout::segment_precedes(const Output_se
   const elfcpp::Elf_Word flags2 = seg2->flags();
 
   // The order of non-PT_LOAD segments is unimportant.  We simply sort
-  // by the numeric segment type and flags values.  There should not
-  // be more than one segment with the same type and flags.
+  // by the numeric segment type and flags values.
   if (type1 != elfcpp::PT_LOAD)
     {
       if (type1 != type2)
 	return type1 < type2;
-      gold_assert(flags1 != flags2);
       return flags1 < flags2;
     }
 

-- 
Alan Modra
Australia Development Lab, IBM


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