Re:Re: elf_map: why offset of vma need to subtract eppnt->p_vaddr ?

2013-03-29 Thread Jacky
Great ! Thanks Prabhunath. Let me make sure I understand you correctly: Substracting ELF_PAGEOFFSET(eppnt->p_vaddr) from variable off makes vma map the page-aligned file contents, right ? 在 2013-03-29 16:56:29,"Prabhu nath" 写道: On Fri, Mar 29, 2013 at 12:45 PM, Jacky wrote: Hi All, W

Re: Re: elf_map: why offset of vma need to subtract eppnt->p_vaddr ?

2013-03-29 Thread Prabhu nath
On Fri, Mar 29, 2013 at 3:03 PM, Jacky wrote: > > Great ! Thanks Prabhunath. > > Let me make sure I understand you correctly: > > Substracting ELF_PAGEOFFSET(eppnt->p_vaddr) from variable off makes vma > map the page-aligned file contents, right ? > Small change : Substracting ELF_PAGEOFFSET(e

Re: elf_map: why offset of vma need to subtract eppnt->p_vaddr ?

2013-03-29 Thread Prabhu nath
On Fri, Mar 29, 2013 at 12:45 PM, Jacky wrote: > Hi All, > > When mmaping elf image into memory, why offset vma need to subtract > eppnt->p_vaddr as the following code ? > > static unsigned long elf_map() > { > ... > unsigned long off = eppnt->p_offset - ELF_PAGEOFFSET(eppnt->p_vaddr); >

elf_map: why offset of vma need to subtract eppnt->p_vaddr ?

2013-03-29 Thread Jacky
Hi All, When mmaping elf image into memory, why offset vma need to subtract eppnt->p_vaddr as the following code ? static unsigned long elf_map() { ... unsigned long off = eppnt->p_offset - ELF_PAGEOFFSET(eppnt->p_vaddr); ... } Thanks in advance. Jacky _