fix(tools): handle zero-size segments in unbacked PT_LOAD ranges in unwrap_self #8543
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/8543"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by tkcm01 on 2026-10-20T16:01:15Z.
What
Treat zero-size non-
PT_LOADsegments (such as pure-.tbssPT_TLSsegments withp_filesz == 0) that fall inside a file-emptyPT_LOADsegment (p_filesz == 0) or in the unbacked.bsstail (offset > host["size"]) as having no file backing (source = 0), instead of adding their virtual offset to the host segment's file offset and failing bounds checks or emitting a stalep_offset.Tested
macOS (
ctest --test-dir build-relinker -R unwrap_self --output-on-failure).Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-20T22:35:07Z.
Windows data point for
7679fbd657: Windows 10.0.19045, Python 3.12.10,python -I -m unittest discover -s tools/tests -p test_unwrap_self.py, PR head checked out (not merged ontomain).tools/unwrap_self.pyrestored tomain(new test kept): 30 tests, 10 failures, all sub-cases oftest_zero_size_segment_in_unbacked_load_range_is_accepted(segment 3/4 does not fit the fileand a wrong source offset).Not tested: other platforms, a merge onto current
main.AI-assisted (Claude Code).
Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-21T03:11:54Z.
Linux data point for
7679fbd657(WSL2, Ubuntu 24.04, kernel 6.18 - a virtualised kernel, not bare-metal Linux; Python 3.12.3), this head merged ontomain5d10ea9ea(clean merge),python3 -I tools/tests/test_unwrap_self.py:test_unwrap_self.pyon top ofmainwithout the PR's source change): FAILED (10 failures).Not tested: macOS, Windows (Windows data from another run is not part of this comment).
AI-assisted (Claude Code).