diff --git a/kernel/src/ELF.cpp b/kernel/src/ELF.cpp index df28d389..1af55e15 100644 --- a/kernel/src/ELF.cpp +++ b/kernel/src/ELF.cpp @@ -96,8 +96,7 @@ namespace ELFLoader int flags = MMU::User | MMU::NoExecute; if (can_write_segment(program_header.p_flags)) flags |= MMU::ReadWrite; - else if (can_execute_segment(program_header.p_flags)) - flags &= ~MMU::NoExecute; + if (can_execute_segment(program_header.p_flags)) flags &= ~MMU::NoExecute; // Allocate physical memory for the segment TRY(MemoryManager::alloc_at(