summaryrefslogtreecommitdiff
path: root/src/kernel/linker/elf.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/kernel/linker/elf.cpp')
-rw-r--r--src/kernel/linker/elf.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/kernel/linker/elf.cpp b/src/kernel/linker/elf.cpp
index c94e5c0..9477e8a 100644
--- a/src/kernel/linker/elf.cpp
+++ b/src/kernel/linker/elf.cpp
@@ -17,14 +17,14 @@ thread_entry elf_load(uint8_t *data, process* process) {
size_t dataseg = 0;
if (elf_check(data)) return 0;
- page_directory *r = current_pagedir;
cli();
+ page_directory *r = current_pagedir;
pagedir_switch(process->pagedir);
phdr = (elf_phdr*)((uint8_t*)(data + ehdr->e_phoff));
for (i = 0; i < ehdr->e_phnum; i++) {
if (phdr[i].p_type == PT_LOAD) {
- seg_map(simpleseg_make(phdr[i].p_vaddr, phdr[i].p_memsz, (phdr[i].p_flags & PF_W) != 0), process->pagedir, 0);
+ (new simpleseg(phdr[i].p_vaddr, phdr[i].p_memsz, (phdr[i].p_flags & PF_W) != 0))->map(process->pagedir, 0);
memcpy((uint8_t*)phdr[i].p_vaddr, data + phdr[i].p_offset, phdr[i].p_filesz);
if (phdr[i].p_memsz > phdr[i].p_filesz) {
memset((uint8_t*)phdr[i].p_vaddr + phdr[i].p_memsz, 0, phdr[i].p_memsz - phdr[i].p_filesz);