mirror of
https://github.com/RPCSX/rpcsx.git
synced 2024-11-23 03:19:47 +00:00
linker: fix map flags
This commit is contained in:
parent
f972e14325
commit
86942b3ba8
@ -862,8 +862,19 @@ Ref<orbis::Module> rx::linker::loadModule(std::span<std::byte> image,
|
||||
phdr.p_flags |= vm::kMapProtCpuWrite; // TODO: reprotect on relocations
|
||||
}
|
||||
|
||||
vm::protect(imageBase + segmentBegin, segmentSize,
|
||||
phdr.p_flags & (vm::kMapProtCpuAll | vm::kMapProtGpuAll));
|
||||
int mapFlags = 0;
|
||||
|
||||
if (phdr.p_flags & PF_X) {
|
||||
mapFlags |= vm::kMapProtCpuExec;
|
||||
}
|
||||
if (phdr.p_flags & PF_W) {
|
||||
mapFlags |= vm::kMapProtCpuWrite;
|
||||
}
|
||||
if (phdr.p_flags & PF_R) {
|
||||
mapFlags |= vm::kMapProtCpuRead;
|
||||
}
|
||||
|
||||
vm::protect(imageBase + segmentBegin, segmentSize, mapFlags);
|
||||
|
||||
if (phdr.p_type == kElfProgramTypeLoad) {
|
||||
if (result->segmentCount >= std::size(result->segments)) {
|
||||
|
Loading…
Reference in New Issue
Block a user