AnyPS5/core/relinker
Yassine 6158444f71 fix(relinker): leave zero-filled PT_LOAD memory out of Windows files
WindowsPeWriter stored every PE section with SizeOfRawData equal to its
virtual size, so the zero-filled tail of a PT_LOAD segment (p_memsz above
p_filesz, the .bss) was written to the executable byte for byte. A segment
with 256 MiB of .bss produced a 269 MB .exe, while the Linux output of the
same image is under 5 KB.

Each section is now stored up to its last non-zero byte, aligned to the file
alignment, and VirtualSize keeps the full size. The PE loader zero-fills the
part of a section beyond SizeOfRawData (Microsoft PE format, section table:
SizeOfRawData). A section with no non-zero byte gets no raw data and a zero
PointerToRawData.

windows_bss relinks an image with 64 MiB of .bss, checks the section table
and the mapped image, and on Windows runs the executable, which reads the
last word of the .bss.
2026-10-10 21:23:19 +13:00
..
cli feat(relinker): support explicit CLI help 2026-10-10 10:31:52 +05:30
codegen Merge pull request #2568 from oneandonlydean/fix/relinker-decode-xop-2559 2026-10-10 19:47:50 +13:00
domain/include/domain fix(relinker): discover required guest module identities 2026-10-09 13:53:48 +02:00
elfpatcher fix(relinker): leave zero-filled PT_LOAD memory out of Windows files 2026-10-10 21:23:19 +13:00
io fix(relinker): reject non-regular input files 2026-10-10 08:26:32 +02:00
relinker fix(relinker): leave zero-filled PT_LOAD memory out of Windows files 2026-10-10 21:23:19 +13:00
CMakeLists.txt fix(relinker): leave zero-filled PT_LOAD memory out of Windows files 2026-10-10 21:23:19 +13:00
main.cpp feat(relinker): support explicit CLI help 2026-10-10 10:31:52 +05:30