This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: gold patch committed: Put .interp first
"H.J. Lu" <hjl.tools@gmail.com> writes:
> This patch breaks gold:
>
> http://www.sourceware.org/bugzilla/show_bug.cgi?id=10910
I forgot a return statement. Fixed by this patch. Committed to
mainline and 2.20 branch.
Ian
2009-11-05 Ian Lance Taylor <iant@google.com>
PR 10910
* output.cc (Output_segment::add_output_section): Add missing
return statement.
Index: output.cc
===================================================================
RCS file: /cvs/src/src/gold/output.cc,v
retrieving revision 1.94.2.3
diff -p -u -r1.94.2.3 output.cc
--- output.cc 4 Nov 2009 15:56:34 -0000 1.94.2.3
+++ output.cc 5 Nov 2009 19:58:16 -0000
@@ -3053,6 +3053,7 @@ Output_segment::add_output_section(Outpu
gold_assert((os->flags() & elfcpp::SHF_ALLOC) != 0);
gold_assert(!this->is_max_align_known_);
gold_assert(os->is_large_data_section() == this->is_large_data_segment());
+ gold_assert(this->type() == elfcpp::PT_LOAD || !do_sort);
// Update the segment flags.
this->flags_ |= seg_flags;
@@ -3068,13 +3069,7 @@ Output_segment::add_output_section(Outpu
// output segment. The loops below are expected to be fast.
// So that PT_NOTE segments will work correctly, we need to ensure
- // that all SHT_NOTE sections are adjacent. This will normally
- // happen automatically, because all the SHT_NOTE input sections
- // will wind up in the same output section. However, it is possible
- // for multiple SHT_NOTE input sections to have different section
- // flags, and thus be in different output sections, but for the
- // different section flags to map into the same segment flags and
- // thus the same output segment.
+ // that all SHT_NOTE sections are adjacent.
if (os->type() == elfcpp::SHT_NOTE && !pdl->empty())
{
Output_segment::Output_data_list::iterator p = pdl->end();
@@ -3254,6 +3249,7 @@ Output_segment::add_output_section(Outpu
if ((*p)->is_section() && (*p)->output_section()->is_interp())
++p;
pdl->insert(p, os);
+ return;
}
// If this section is used by the dynamic linker, and it is not