[Prev][Next][Index][Thread]

elf loader is broken



The elf standard says that elf executables must be extracted to the
physical load address, not the virtual memory address.  This is not
done in oskit/exec/elf.c--at least in the version released on March
17, 2002; I have attached a patch.


--- elf.c.orig  Fri Jul  5 16:18:46 2002
+++ elf.c       Fri Jul  5 16:18:59 2002
@@ -95,7 +95,7 @@ int exec_load_elf(exec_read_func_t *read
                        if (ph->p_flags & PF_X) type |= EXEC_SECTYPE_EXECUTE;
                        result = (*read_exec)(handle,
                                              ph->p_offset, ph->p_filesz,
-                                             ph->p_vaddr, ph->p_memsz, type);
+                                             ph->p_paddr, ph->p_memsz, type);
                }
        }
 

Follow-Ups: