PATCH: Preserve ELF program header

Alan Modra amodra@bigpond.net.au
Fri May 26 14:00:00 GMT 2006


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



More information about the Binutils mailing list