This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [RFC] Aligning segments in gold
- From: Ian Lance Taylor <iant at google dot com>
- To: Cary Coutant <ccoutant at google dot com>
- Cc: Binutils <binutils at sourceware dot org>
- Date: Fri, 9 Jan 2015 15:24:22 -0800
- Subject: Re: [RFC] Aligning segments in gold
- Authentication-results: sourceware.org; auth=none
- References: <CAHACq4r+uun3awgdM3VBybWF9+eC66C12mcMS2CyHm0k43bBPg at mail dot gmail dot com> <CAKOQZ8y2pjt=d0YgGRznmqXUPH=xUrVTW7bxaURa3D_o8op1bA at mail dot gmail dot com> <CAHACq4pTA88UeYgXV2aYQ9eU+KV2DC+ESrHdfCmA5WiiZi9=tg at mail dot gmail dot com>
On Fri, Jan 9, 2015 at 3:01 PM, Cary Coutant <ccoutant@google.com> wrote:
>> (*p)->maximum_alignment is going to feed into the p_align field. It
>> sounds like you are saying that it's OK if a phdr is not aligned
>> according to what its p_align field says. Is that right?
>
> Right. Segments aren't expected to begin at p_align boundaries (and
> typically don't). From the gABI:
>
> p_align
> As ``Program Loading'' describes in this chapter of the processor
> supplement, loadable process segments must have congruent values for
> p_vaddr and p_offset, modulo the page size. This member gives the
> value to which the segments are aligned in memory and in the file.
> Values 0 and 1 mean no alignment is required. Otherwise, p_align
> should be a positive, integral power of 2, and p_vaddr should equal
> p_offset, modulo p_align.
>
> While "This member gives the value to which the segments are aligned
> in memory and in the file" might be read to imply otherwise, I think
> the last sentence is generally understood to mean that p_offset and
> p_vaddr are not individually required to be aligned at a p_align
> boundary.
Ah, right.
OK, original messages sounds good to me.
Ian