From ea8d5390ebe2f1917d07f4eed416661ade96c953 Mon Sep 17 00:00:00 2001 From: Miquel Sabaté Solà Date: Sun, 24 Nov 2024 22:37:20 +0100 Subject: Simplify the entry address computation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We actually don't need to preserve the initially computed base address for each binary, but we can just preserve the final entry address. Signed-off-by: Miquel Sabaté Solà --- kernel/initrd.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'kernel/initrd.c') diff --git a/kernel/initrd.c b/kernel/initrd.c index ff1f52b..27d0ece 100644 --- a/kernel/initrd.c +++ b/kernel/initrd.c @@ -101,8 +101,9 @@ __kernel void extract_elf(int task_id, const unsigned char *const addr, size_t s /* }; */ #ifdef __KERNEL__ - tasks[task_id].addr = (const void *)addr; - tasks[task_id].entry_offset = (uint64_t)addr[0x18]; + uint64_t offset = (uint64_t)addr[0x18]; + + tasks[task_id].entry_addr = (const void *)(addr + offset); #endif } -- cgit v1.2.3