This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: PATCH: Preserve ELF program header
- From: Alan Modra <amodra at bigpond dot net dot au>
- To: "H. J. Lu" <hjl at lucon dot org>
- Cc: binutils at sources dot redhat dot com
- Date: Fri, 26 May 2006 10:21:00 +0930
- Subject: Re: PATCH: Preserve ELF program header
- References: <20060525214416.GA15454@lucon.org>
On Thu, May 25, 2006 at 02:44:16PM -0700, H. J. Lu wrote:
> --- binutils/bfd/elf.c.pagesize 2006-05-22 12:36:40.000000000 -0700
> +++ binutils/bfd/elf.c 2006-05-22 16:24:05.000000000 -0700
> @@ -4292,7 +4292,9 @@ assign_file_positions_for_load_sections
> return FALSE;
> }
>
> - if (m->count == 0)
> + if (m->p_vaddr_valid)
> + p->p_vaddr = m->p_vaddr;
> + else if (m->count == 0)
> p->p_vaddr = 0;
> else
> p->p_vaddr = m->sections[0]->vma;
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?
--
Alan Modra
IBM OzLabs - Linux Technology Centre