mirror of
https://github.com/RPCSX/rpcsx.git
synced 2024-11-26 21:00:35 +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
|
phdr.p_flags |= vm::kMapProtCpuWrite; // TODO: reprotect on relocations
|
||||||
}
|
}
|
||||||
|
|
||||||
vm::protect(imageBase + segmentBegin, segmentSize,
|
int mapFlags = 0;
|
||||||
phdr.p_flags & (vm::kMapProtCpuAll | vm::kMapProtGpuAll));
|
|
||||||
|
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 (phdr.p_type == kElfProgramTypeLoad) {
|
||||||
if (result->segmentCount >= std::size(result->segments)) {
|
if (result->segmentCount >= std::size(result->segments)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user