This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFC] Aligning segments in gold


> (*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.

-cary


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]