[PATCH] Reduce file size for PT_GNU_RELRO segment

H.J. Lu hjl.tools@gmail.com
Sat Mar 28 18:30:00 GMT 2015


On Fri, Mar 27, 2015 at 9:15 PM, Alan Modra <amodra@gmail.com> wrote:
> On Fri, Mar 27, 2015 at 01:00:20PM -0700, H.J. Lu wrote:
>> On Wed, Mar 25, 2015 at 7:22 PM, Alan Modra <amodra@gmail.com> wrote:
>> > Isn't this just re-inventing the commonpage adjustment done for
>> > DATA_SEGMENT_ALIGN?  Why didn't the existing code in ldexp.c work for
>> > you?
>>
>> segment.  In order to properly align PT_GNU_RELRO segment, we pad the first
>> section of PT_GNU_RELRO segment by
>
> Adjusting the start of the first section of the PT_GNU_RELRO segment
> is exactly what DATA_SEGMENT_ALIGN is supposed to do.  You are
> patching the wrong place.  Any adjustment to the start of the relro
> segment belongs in ldexp.c code evaluating DATA_SEGMENT_ALIGN.
>

Since output_section_statement isn't passed to ldexp.c, I don't see how
DATA_SEGMENT_ALIGN  in ldexp.c can check the section address and size.


-- 
H.J.



More information about the Binutils mailing list