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: PATCH: Preserve ELF program header


On Thu, May 25, 2006 at 07:30:23PM -0700, H. J. Lu wrote:
> On Fri, May 26, 2006 at 10:21:00AM +0930, Alan Modra wrote:
> > I don't see the need for m->p_vaddr and m->p_vaddr_valid.  How can you
> > get into a situation where m->sections[0]->vma or 0 is not the right
> > initialisation for p->p_vaddr?
> > 
> 
> Here is an x86 example, which is generated with 2MB maximum page size.
> Due to
> 
> TEXT_START_ADDR=0x08048000
> 
> We got p->p_vaddr != m->sections[0]->vma to satisfy 2MB alignment.

Sure.  Obviously you need to subtract off space for the headers then
align.  I'm thinking that you can do this by modifying the assignments
to "align" in the function, particularly places that set "align" from
"bed->maxpagesize" to instead use your m->p_align.  After all, the
problem you are trying to solve is one where alignment due to
bed->maxpagesize changes.

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre


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