From f762a0c7a3520ed06c84455b2b9fcd97efbb4f11 Mon Sep 17 00:00:00 2001 From: mintsuki Date: Wed, 25 Mar 2020 05:05:06 +0100 Subject: [PATCH] elf: Remove stupid code --- src/lib/elf.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/lib/elf.c b/src/lib/elf.c index 1cbcbb5c..f2f47ed3 100644 --- a/src/lib/elf.c +++ b/src/lib/elf.c @@ -122,10 +122,6 @@ int elf_load(struct echfs_file_handle *fd) { for (size_t i = 0; i < 512 * 4; i++) (&pagemap->pml2_0gb[0])[i] = (i * 0x1000) | 0x03 | (1 << 7); - uint32_t entry_point = elf_higher_half - ? (uint32_t)(hdr.entry - FIXED_HIGHER_HALF_OFFSET) - : (uint32_t)hdr.entry; - asm volatile ( "cli\n\t" "mov cr3, eax\n\t" @@ -147,11 +143,11 @@ int elf_load(struct echfs_file_handle *fd) { "mov fs, ax\n\t" "mov gs, ax\n\t" "mov ss, ax\n\t" - "jmp rbx\n\t" + "jmp [rbx]\n\t" ".code32\n\t" : - : "a" (pagemap), "b" (entry_point) + : "a" (pagemap), "b" (&hdr.entry) ); - for (;;); + return 0; }