[RFC] Aligning segments in gold
Ian Lance Taylor
iant@google.com
Fri Jan 9 23:24:00 GMT 2015
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
More information about the Binutils
mailing list