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:
apio 2023-01-06 17:34:24 +01:00
parent 87a4bc91d8
commit e37280b0e5
Signed by: apio
GPG Key ID: B8A7D06E42258954

View File

@ -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(