ELFLoader: Set both the read-write and execute flags if the section has both
Not good for W^X, but the compiler decides to squash everything into a single program header :(
This commit is contained in:
parent
87a4bc91d8
commit
e37280b0e5
@ -96,8 +96,7 @@ namespace ELFLoader
|
|||||||
|
|
||||||
int flags = MMU::User | MMU::NoExecute;
|
int flags = MMU::User | MMU::NoExecute;
|
||||||
if (can_write_segment(program_header.p_flags)) flags |= MMU::ReadWrite;
|
if (can_write_segment(program_header.p_flags)) flags |= MMU::ReadWrite;
|
||||||
else if (can_execute_segment(program_header.p_flags))
|
if (can_execute_segment(program_header.p_flags)) flags &= ~MMU::NoExecute;
|
||||||
flags &= ~MMU::NoExecute;
|
|
||||||
|
|
||||||
// Allocate physical memory for the segment
|
// Allocate physical memory for the segment
|
||||||
TRY(MemoryManager::alloc_at(
|
TRY(MemoryManager::alloc_at(
|
||||||
|
Loading…
Reference in New Issue
Block a user