From 346b7280e260f1293592b8c4b5ee590ddd6c19ce Mon Sep 17 00:00:00 2001 From: Dean Galvin Date: Mon, 28 Sep 2026 13:32:36 +1300 Subject: [PATCH] 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) Claude-Session: https://claude.ai/code/session_01ButHENCbXXt8h4EZuWUabJ --- core/relinker/elfpatcher/src/linux/LinuxGuestModuleWriter.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/relinker/elfpatcher/src/linux/LinuxGuestModuleWriter.cpp b/core/relinker/elfpatcher/src/linux/LinuxGuestModuleWriter.cpp index 31168ebd6..11b2348ef 100644 --- a/core/relinker/elfpatcher/src/linux/LinuxGuestModuleWriter.cpp +++ b/core/relinker/elfpatcher/src/linux/LinuxGuestModuleWriter.cpp @@ -12,8 +12,9 @@ std::vector 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); }