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]

p_vaddr_offset vs lma


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


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