Commit Graph

7 Commits

Author SHA1 Message Date
boykopovar 5e5eba8922 fix(relinker): reject layouts that would discard exception metadata 2026-10-13 12:57:06 +03:00
MrMha d85d1c268f fix(relinker): validate program layout ranges before writing 2026-10-11 19:51:17 +04:00
jweidenh 25984a728c fix(relinker): count all synthetic Linux program headers 2026-10-10 01:38:07 -04:00
ctj01 1352b9b34d fix(relinker): write Linux PT_LOAD headers in ascending address order
The header-block PT_LOAD has the highest address but was the first
loadable entry in the table. Linux before 5.18 sizes the ET_DYN mapping
from the first and last PT_LOAD entries in table order, so the output
failed to exec with SIGSEGV. Write PT_PHDR and PT_INTERP first, sort the
kept PT_LOAD entries by address, and place the extra and header blocks
after them.
2026-10-09 06:27:23 -05:00
clem-gb d16cac0ab2 fix(relinker): keep PT_GNU_EH_FRAME in the relinked executable
The segment filter dropped every header in the PT_LOOS..PT_HIOS range,
which includes PT_GNU_EH_FRAME. The unwinders find the executable's
unwind tables through that header, so no C++ exception thrown in the
main executable could be caught on Linux.

The header is kept only when the output program header table still fits
in the input's table; otherwise it is dropped as before, with a warning.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HeC9bA3n74TzJRYv9AgBE8
2026-10-08 15:47:39 +02:00
Dean Galvin 06b3413961 fix(relinker): align the linux header load segment to the largest segment alignment
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ButHENCbXXt8h4EZuWUabJ
2026-09-28 14:22:48 +13:00
boykopovar 4b643c6655 refactor(core): seprated folders for relinker and libs 2026-09-11 14:53:01 +03:00
Renamed from core/elfpatcher/src/general/ProgramHeaderLayoutBuilder.cpp (Browse further)