p_vaddr_offset vs lma

Alan Modra amodra@bigpond.net.au
Mon Jul 2 06:47:00 GMT 2007


Nathan, would you mind checking that this fix for your
http://sourceware.org/ml/binutils/2006-12/msg00165.html change doesn't
break your test files, if you have them around still?

	PR 4712
	* elf.c (assign_file_positions_for_load_sections): Adjust lma
	by p_vaddr_offset.

Index: bfd/elf.c
===================================================================
RCS file: /cvs/src/src/bfd/elf.c,v
retrieving revision 1.394
diff -u -p -r1.394 elf.c
--- bfd/elf.c	29 Jun 2007 16:29:15 -0000	1.394
+++ bfd/elf.c	2 Jul 2007 06:15:32 -0000
@@ -4373,7 +4373,7 @@ assign_file_positions_for_load_sections 
       else if (m->count == 0)
 	p->p_paddr = 0;
       else
-	p->p_paddr = m->sections[0]->lma;
+	p->p_paddr = m->sections[0]->lma - m->p_vaddr_offset;
 
       if (p->p_type == PT_LOAD
 	  && (abfd->flags & D_PAGED) != 0)

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre



More information about the Binutils mailing list