This is the mail archive of the
mailing list for the binutils project.
Re: [PATCH] Reduce file size for PT_GNU_RELRO segment
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: Binutils <binutils at sourceware dot org>
- Date: Sat, 28 Mar 2015 11:30:02 -0700
- Subject: Re: [PATCH] Reduce file size for PT_GNU_RELRO segment
- Authentication-results: sourceware.org; auth=none
- References: <20150319130244 dot GA22592 at intel dot com> <20150326022246 dot GU26234 at bubble dot grove dot modra dot org> <CAMe9rOrVpthhMfZEXcMkKzmHcxymfQHKuTuZPi_y36=s6KJ9iA at mail dot gmail dot com> <20150328041540 dot GE26234 at bubble dot grove dot modra dot org>
On Fri, Mar 27, 2015 at 9:15 PM, Alan Modra <firstname.lastname@example.org> 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 <email@example.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.