[patch][gold] Don't put rodata and text in the same segment.

Ian Lance Taylor iant@google.com
Wed Sep 8 15:25:00 GMT 2010


Rafael Espindola <espindola@google.com> writes:

> Looking a bit more in the code I was curious why the optimization of
> trying to keep the data contiguous on disk but not in memory could not
> be applied in more cases. I also noticed that was_readonly was never
> being set back to false. Is it because the code knows how the segments
> are ordered? That is wrong in the presence of large segments, no?
>
> Anyway, I tried to apply the optimization unconditionally and I could
> not find a case that fails. Would you mind reviewing the attached
> patch first? If you do know a case that would fail let me know and I
> will add a testcase for it instead.
>
> 2010-09-03  Rafael Espindola  <espindola@google.com>
>
>        * layout.cc (Layout::set_segment_offsets): Try harder to save disk
> 	space.

As noted in my last reply, I think this is correct whenever the segment
flags change.  When the segment flags do not change there is no reason
to do this.

Ian



More information about the Binutils mailing list