From 83982a24e218fc857c817cd7006e3e0b87470a02 Mon Sep 17 00:00:00 2001 From: apio Date: Thu, 13 Oct 2022 21:21:02 +0200 Subject: [PATCH] add a comment --- kernel/src/sys/elf/ELFLoader.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/kernel/src/sys/elf/ELFLoader.cpp b/kernel/src/sys/elf/ELFLoader.cpp index 03f1ae7f..91d6d554 100644 --- a/kernel/src/sys/elf/ELFLoader.cpp +++ b/kernel/src/sys/elf/ELFLoader.cpp @@ -67,7 +67,9 @@ ELFImage* ELFLoader::load_elf_from_vfs(VFS::Node* node) { Elf64_Ehdr elf_ehdr; ASSERT(VFS::read(node, 0, sizeof(elf_ehdr), (char*)&elf_ehdr) >= 0); - ASSERT(strncmp((const char*)elf_ehdr.e_ident, ELFMAG, SELFMAG) == 0); + ASSERT(strncmp((const char*)elf_ehdr.e_ident, ELFMAG, SELFMAG) == + 0); // If you haven't checked the ELF executable with check_elf_image() first, then an assertion fail is your + // fault =D ASSERT(elf_ehdr.e_ident[EI_CLASS] == ELFCLASS64); ASSERT(elf_ehdr.e_ident[EI_DATA] == ELFDATA2LSB); ASSERT(elf_ehdr.e_type == ET_EXEC);