mirror of
https://github.com/boykopovar/AnyPS5.git
synced 2026-10-10 01:28:44 +02:00
fix(relinker): skip the flagless dynlib data segment in linux guest modules
GuestModuleWriter::WriteLinux adds read permission to every PT_LOAD, including the SCE dynlib data segment, which has no flags and is never mapped on the PS5. When that segment starts inside the last page of the preceding RW segment, the read-only mapping covers the tail of its bss and the module's initializer faults on its first write there. The symbol and relocation tables it holds are already copied into the appended segment, so it no longer needs to be mapped. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ButHENCbXXt8h4EZuWUabJ
This commit is contained in:
@@ -12,8 +12,9 @@ std::vector<std::uint8_t> GuestModuleWriter::WriteLinux(const Relinker::GuestIma
|
||||
for (auto header : image.Headers) {
|
||||
if (header.Type != 1 && header.Type != 7 && header.Type != 0x6474e550 && header.Type != 0x6474e551) continue;
|
||||
if (header.Type == 1) {
|
||||
header.Flags |= 4;
|
||||
end = std::max(end, header.MappedAddress + header.MemorySize);
|
||||
if (header.Flags == 0) continue;
|
||||
header.Flags |= 4;
|
||||
}
|
||||
headers.push_back(header);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user