Subject: how do I map an ELF section?
To: None <tech-kern@netbsd.org>
From: Emmanuel Dreyfus <manu@netbsd.org>
List: tech-kern
Date: 11/28/2001 22:33:56
For Irix emulation, I need to map an ELF section, given a ELF Program
header (struct Elf32_Phdr) and a file descriptor, both given by the
calling process. 

As I understand, I need to mmap the data at p_offset in the file
somewhere in user memory, and update the p_vaddr and p_paddr fields of
the struct Elf32_Phdr. I also have to consider p_flags for setting up
the mapping.

I think this kind of thing is done in
sys/kern/exec_elf32.c:elf_load_psection(), but I have trouble to figure
out how it works and how to get the job done for me.

elf_load_psection() works with a struct exec_vmcmd_set. I understanded
it was a VM command, but how do I execute this VM command?
 



-- 
Emmanuel Dreyfus
manu@netbsd.org