Repository navigation
fix(relinker): tolerate trailing data in TLS scan - #299
Conversation
14ecc2f to
66fd86c
Compare
|
Thanks, the tail rule reads as sound to me: an FS instruction starting in the skipped bytes would have its 0x64 byte there, so the no-0x64 check plus the branch check covers it. The overlap part has a hole though: the 0x64 search starts at previousEnd, so an FS-prefixed instruction that starts inside the previous one (0x64 at |
66fd86c to
49feb79
Compare
|
Done: the 0x64 scan now starts at the overlapping address, plus a prefix scan of the overlapped previous instruction so a branch landing inside an FS-prefixed instruction (like overlapping-entry) is still rejected as overlapping boundaries. overlapping-entry expectation restored, new overlapping-fs-prefix case added. ctest empty_tls/tls_function_coverage/guest_tls 3/3 green. |
|
Thanks, starting the scan at |
|
Done: the previous-instruction check now decodes it and compares SegmentPrefix to 0x64, matching exactly what WindowsTlsBuilder patches (any number of 0x66 prefixes included). Added an overlapping-fs-prefix-66 case with four 0x66 prefixes; verified it fails without the fix and passes with it. Also dropped the stray libSceAudioIn hunk from this branch. |
|
Thanks, decoding the previous instruction and comparing its A small note, no action needed: the |
What
The TLS code scan over unwind function ranges failed the whole relink when a range ended with undecodable bytes. TLOU Part I has an FDE range ending with trailing jump-table data, so the scan now tolerates a short tail (at most 15 bytes, the longest x64 instruction) without an FS prefix instead of aborting. A branch target that lands inside a skipped tail is still rejected, and an overlapping instruction that starts with, or lands inside, an FS-prefixed instruction is rejected as overlapping boundaries (the 0x64 scan now starts at the overlapping address instead of after the previous instruction).
Tested
test_tls_function_coverage.pyagainst the rebuilt relinker: all pass, including the restoredoverlapping-entryexpectation (Code analysis: overlapping instruction boundaries) and the newoverlapping-fs-prefixcase (FS-prefixed instruction starting inside the previous one is rejected).empty_tls,tls_function_coverage,guest_tls: 3/3 pass.Checklist