fix(relinker): reject executable TLS relocations against an undefined symbol that is not STT_TLS #12341

Merged
roboterspinne merged 6 commits from upstream-pr/12341 into main 2026-11-02 13:37:22 +00:00
roboterspinne commented 2026-10-28 10:19:13 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by roboterspinne on 2026-10-28T10:19:13Z.


What

On 3a40945e62 (line numbers below refer to it), RelinkerPipeline::Relink checks the symbol of an executable R_X86_64_DTPMOD64, DTPOFF64 or TPOFF64 relocation in definedTlsSymbolValue, which rejects a defined symbol that is not STT_TLS (line 353) but returns early for every undefined one (line 350), so an undefined STT_NOTYPE, STT_OBJECT or STT_FUNC symbol becomes an import, and SysVDynamicSectionBuilder (tls ? STT_TLS : ref.SymbolType, line 95) writes it typed STT_TLS, a type the input never declared. On untouched 62b3ba2522 such a relocation against the undefined ImportedTls with st_info 0x10, 0x11 or 0x12 converts with exit 0 on Linux and --lazy-binding, and DT_RELA of the output holds (0x401000, 18, ImportedTls, STT_TLS, 0) for TPOFF64 (likewise 16 and 17, and at 0x1000 with --lazy-binding); --windows and --macos fail only later with Imported TLS relocation N is not supported for this target (offset 0x1000). The guest reader already rejects the same relocation in guest modules as Invalid guest TLS relocation (GuestImageReader.cpp:285-286).

  • Rule. definedTlsSymbolValue now throws TLS relocation names an undefined symbol that is not STT_TLS at the relocation for an undefined symbol whose type is not STT_TLS, before any import is recorded, on every target; the defined-symbol message of line 353 is mirrored, and that branch now compares the type read for the new check instead of masking st_info again. The ELF gABI (Symbol Table, STT_TLS) states that thread-local storage relocations can only reference STT_TLS symbols. Both callers (line 404 in extractRela, through definedTlsSymbol at 364-366, and line 628) run only for these three types with a nonzero symbol index, so symbolless TLS relocations and every other relocation are unchanged, and the symbol-bounds check of symbolEntryPos still fails first. STT_SECTION symbols are covered too. The guest reader accepts DTPMOD64 and DTPOFF64 against a local section symbol (st_info 3) with section and value 0 (ownTlsBlock, 6f3e4a147f, libSceFios2.prx of CUSA01664), and this change does not touch it; in an executable that unnamed shape already failed on 62b3ba2522 with Unnamed import symbol is not a null symbol entry (offset 0x4948) for all three types on all four targets, and now fails one check earlier with the new message (offset 0x4700). A named undefined STT_SECTION symbol (st_info 0x13) converted on Linux and --lazy-binding with the import typed STT_TLS and failed on --windows and --macos with Imported TLS relocation N is not supported for this target; it now fails with the new message on every target. An all-zero symbol entry at a nonzero index is STT_NOTYPE and now fails as well; before, Linux and --lazy-binding emitted it as an unnamed STT_NOTYPE import, and the guest reader rejects it too. Undefined STT_TLS imports, global or weak, are unchanged. #11881 adds the sibling rule, non-TLS relocations against STT_TLS symbols; the two are independent and merge without conflict. With this rule every symbol a TLS relocation imports is already STT_TLS, so the override in SysVDynamicSectionBuilder.cpp:95 no longer changes any type; removing it is left for a follow-up.
  • Tests. test_executable_tls_relocations.py gets a loop after the failures list: DTPMOD64, DTPOFF64 and TPOFF64 against the undefined IMPORTED symbol with st_info 0x10, 0x11, 0x12, 0x13, 0x1a (STT_GNU_IFUNC) and 0x1e and, with the name field zeroed, 0x03, on Linux, --lazy-binding, --windows and --macos (84 relinks), each expecting exit 2, FAIL: TLS relocation names an undefined symbol that is not STT_TLS (offset 0x4700) and no output. The two types above STT_TLS make the loop fail on a check written as type < STT_TLS (at linux-undefined-16-1a) or one masking the type with 7 instead of 15 (at linux-undefined-16-1e); every other st_info in the loop has a type below 6. The existing case with IMPORTED as STT_TLS still expects (0x401020, TPOFF64, ImportedTls, STT_TLS, 0) on Linux. test_call_registry.py (loop at lines 102-117, added by #10679 after this branch's first base) relinks the fixture's undefined symbol with relocation types 16, 17 and 18 and expects exit 0; with this rule it fails at type 16 with FAIL: TLS relocation names an undefined symbol that is not STT_TLS (offset 0x700). The loop now sets the symbol's st_info to 0x06 (STT_TLS, binding unchanged) for those three types only; the other four types keep 0x00, because #11881 rejects non-TLS relocations against STT_TLS symbols. The name assertion is unchanged, and the three TLS cases still reach the registry on Linux with R_X86_64_DTPMOD64, R_X86_64_DTPOFF64 and R_X86_64_TPOFF64. That loop, which uses the fixture's default st_info 0x00 (STB_LOCAL, STT_NOTYPE) only to read the relocation's name from the registry, is the only repository test that relinked a TLS relocation against an undefined non-TLS symbol; no debt entry, issue or commit shows that shape.
  • Overlap. pr_overlap.py reports no shared lines with open pull requests that merge with main. It cannot compare this branch with #10861 (RelinkerPipeline.cpp), because that pull request does not merge with main. Checked by hand at #10861's head bb3f33f1ae: a trial merge of this branch with #10861 conflicts only in RelinkerPipeline.cpp, in the same single block as main with #10861 (the #include list, main's <iterator> at line 8 against #10861's <bit>); none of this change's lines are involved. #11881 adds the converse rule in extractRela and edits test_executable_tls_relocations.py; the two merge without conflict. #11626 adds a loop to test_call_registry.py before the names loop (after line 48); it shares no lines with the two lines this change adds after line 107, and the two merge without conflict.

Tested

Windows 11, GCC 15.2.0 (WinLibs UCRT), relinker-only Release build (-DANYPS5_RELINKER_ONLY=ON -DBUILD_TESTING=ON); synthetic fixtures only, no title or homebrew.

  • Counter-check: executable_tls_relocations with the new loop fails on untouched 62b3ba2522 at its first case with AssertionError: ('linux-undefined-16-10', 0, ''), and on a first version of this change that also exempted undefined STT_SECTION symbols, at AssertionError: ('linux-undefined-16-13', 0, ''). On 90fb3186bc (871517aaee merged) with the RelinkerPipeline.cpp of 871517aaee restored, it fails again at AssertionError: ('linux-undefined-16-10', 0, '') while call_registry passes. Run one by one on 62b3ba2522, all 18 Linux and --lazy-binding cases with st_info 0x10, 0x11 and 0x12 exit 0 with the import typed STT_TLS in DT_RELA, and all 18 --windows and --macos cases exit 2 with Imported TLS relocation N is not supported for this target (offset 0x1000). On that first version, which handles STT_SECTION exactly as 62b3ba2522, the named 0x13 case exits 0 on Linux and --lazy-binding with DT_RELA holding (0x401000, 16|17|18, ImportedTls, STT_TLS, 0) (0x1000 with --lazy-binding) and exits 2 on --windows and --macos with Imported TLS relocation N is not supported for this target (offset 0x1000), and the unnamed 0x03 case exits 2 with Unnamed import symbol is not a null symbol entry (offset 0x4948) on all four targets for all three types. With the change all 84 exit 2 with the new message and write no output; undefined STT_TLS imports with st_info 0x16 and 0x26 still convert on Linux and --lazy-binding with the import typed STT_TLS and fail on --windows and --macos as before. An all-zero entry at the IMPORTED index converted on Linux and --lazy-binding on 62b3ba2522 and now fails with the new message on every target. Registry fixture with types 16, 17 and 18 on Linux and --lazy-binding: st_info 0x00 exits 2 with the new message, 0x06 and 0x16 exit 0 with the matching relocationType in the registry.
  • Mutants on 53d9015e9d: with the undefined-symbol check written as type < STT_TLS, executable_tls_relocations fails at AssertionError: ('linux-undefined-16-1a', 0, ''); with the type masked by 7, at AssertionError: ('linux-undefined-16-1e', 0, '').
  • On 53d9015e9d (3a40945e62 merged): ctest -R 'tls|import_symbol|executable_|null_symbol|section_symbol|guest_|call_registry|elf_header|restricted' -j 4: 90 tests passed in 46.9 s; run alone, executable_tls_relocations took 9.5 s, call_registry 3.1 s, import_symbol_types 2.9 s.
  • Full suite: ctest --test-dir build-relinker -j 5 on 53d9015e9d: 388 tests, 386 passed, long_paths skipped; the one failure, select_tests (Windows symlink fixture), fails on main on this machine as well.
  • python tools/check_conventions.py --base upstream/main with this title and description passed on 53d9015e9d.
  • Not tested on Linux or macOS; CI runs the tests on all three hosts.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes (Claude Code)
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5048827575 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12341). Originally posted by [roboterspinne](https://github.com/roboterspinne) on 2026-10-28T10:19:13Z. --- ### What On 3a40945e62 (line numbers below refer to it), `RelinkerPipeline::Relink` checks the symbol of an executable `R_X86_64_DTPMOD64`, `DTPOFF64` or `TPOFF64` relocation in `definedTlsSymbolValue`, which rejects a defined symbol that is not `STT_TLS` (line 353) but returns early for every undefined one (line 350), so an undefined `STT_NOTYPE`, `STT_OBJECT` or `STT_FUNC` symbol becomes an import, and `SysVDynamicSectionBuilder` (`tls ? STT_TLS : ref.SymbolType`, line 95) writes it typed `STT_TLS`, a type the input never declared. On untouched 62b3ba2522 such a relocation against the undefined `ImportedTls` with `st_info` 0x10, 0x11 or 0x12 converts with exit 0 on Linux and `--lazy-binding`, and `DT_RELA` of the output holds `(0x401000, 18, ImportedTls, STT_TLS, 0)` for `TPOFF64` (likewise 16 and 17, and at 0x1000 with `--lazy-binding`); `--windows` and `--macos` fail only later with `Imported TLS relocation N is not supported for this target (offset 0x1000)`. The guest reader already rejects the same relocation in guest modules as `Invalid guest TLS relocation` (`GuestImageReader.cpp:285-286`). - **Rule.** `definedTlsSymbolValue` now throws `TLS relocation names an undefined symbol that is not STT_TLS` at the relocation for an undefined symbol whose type is not `STT_TLS`, before any import is recorded, on every target; the defined-symbol message of line 353 is mirrored, and that branch now compares the type read for the new check instead of masking `st_info` again. The ELF gABI (Symbol Table, `STT_TLS`) states that thread-local storage relocations can only reference `STT_TLS` symbols. Both callers (line 404 in `extractRela`, through `definedTlsSymbol` at 364-366, and line 628) run only for these three types with a nonzero symbol index, so symbolless TLS relocations and every other relocation are unchanged, and the symbol-bounds check of `symbolEntryPos` still fails first. `STT_SECTION` symbols are covered too. The guest reader accepts `DTPMOD64` and `DTPOFF64` against a local section symbol (`st_info` 3) with section and value 0 (`ownTlsBlock`, 6f3e4a147f, `libSceFios2.prx` of CUSA01664), and this change does not touch it; in an executable that unnamed shape already failed on 62b3ba2522 with `Unnamed import symbol is not a null symbol entry (offset 0x4948)` for all three types on all four targets, and now fails one check earlier with the new message (offset 0x4700). A named undefined `STT_SECTION` symbol (`st_info` 0x13) converted on Linux and `--lazy-binding` with the import typed `STT_TLS` and failed on `--windows` and `--macos` with `Imported TLS relocation N is not supported for this target`; it now fails with the new message on every target. An all-zero symbol entry at a nonzero index is `STT_NOTYPE` and now fails as well; before, Linux and `--lazy-binding` emitted it as an unnamed `STT_NOTYPE` import, and the guest reader rejects it too. Undefined `STT_TLS` imports, global or weak, are unchanged. #11881 adds the sibling rule, non-TLS relocations against `STT_TLS` symbols; the two are independent and merge without conflict. With this rule every symbol a TLS relocation imports is already `STT_TLS`, so the override in `SysVDynamicSectionBuilder.cpp:95` no longer changes any type; removing it is left for a follow-up. - **Tests.** `test_executable_tls_relocations.py` gets a loop after the `failures` list: `DTPMOD64`, `DTPOFF64` and `TPOFF64` against the undefined `IMPORTED` symbol with `st_info` 0x10, 0x11, 0x12, 0x13, 0x1a (`STT_GNU_IFUNC`) and 0x1e and, with the name field zeroed, 0x03, on Linux, `--lazy-binding`, `--windows` and `--macos` (84 relinks), each expecting exit 2, `FAIL: TLS relocation names an undefined symbol that is not STT_TLS (offset 0x4700)` and no output. The two types above `STT_TLS` make the loop fail on a check written as `type < STT_TLS` (at `linux-undefined-16-1a`) or one masking the type with 7 instead of 15 (at `linux-undefined-16-1e`); every other `st_info` in the loop has a type below 6. The existing case with `IMPORTED` as `STT_TLS` still expects `(0x401020, TPOFF64, ImportedTls, STT_TLS, 0)` on Linux. `test_call_registry.py` (loop at lines 102-117, added by #10679 after this branch's first base) relinks the fixture's undefined symbol with relocation types 16, 17 and 18 and expects exit 0; with this rule it fails at type 16 with `FAIL: TLS relocation names an undefined symbol that is not STT_TLS (offset 0x700)`. The loop now sets the symbol's `st_info` to 0x06 (`STT_TLS`, binding unchanged) for those three types only; the other four types keep 0x00, because #11881 rejects non-TLS relocations against `STT_TLS` symbols. The name assertion is unchanged, and the three TLS cases still reach the registry on Linux with `R_X86_64_DTPMOD64`, `R_X86_64_DTPOFF64` and `R_X86_64_TPOFF64`. That loop, which uses the fixture's default `st_info` 0x00 (`STB_LOCAL`, `STT_NOTYPE`) only to read the relocation's name from the registry, is the only repository test that relinked a TLS relocation against an undefined non-TLS symbol; no debt entry, issue or commit shows that shape. - **Overlap.** `pr_overlap.py` reports no shared lines with open pull requests that merge with `main`. It cannot compare this branch with #10861 (`RelinkerPipeline.cpp`), because that pull request does not merge with `main`. Checked by hand at #10861's head bb3f33f1ae: a trial merge of this branch with #10861 conflicts only in `RelinkerPipeline.cpp`, in the same single block as `main` with #10861 (the `#include` list, `main`'s `<iterator>` at line 8 against #10861's `<bit>`); none of this change's lines are involved. #11881 adds the converse rule in `extractRela` and edits `test_executable_tls_relocations.py`; the two merge without conflict. #11626 adds a loop to `test_call_registry.py` before the `names` loop (after line 48); it shares no lines with the two lines this change adds after line 107, and the two merge without conflict. ### Tested <!-- OS, title or homebrew, what was checked. "Not tested" is a valid answer. A performance change: the summary lines of main and of this PR from the same machine and scene, with the traces attached, captured as the Performance report issue form describes. --> Windows 11, GCC 15.2.0 (WinLibs UCRT), relinker-only Release build (`-DANYPS5_RELINKER_ONLY=ON -DBUILD_TESTING=ON`); synthetic fixtures only, no title or homebrew. - Counter-check: `executable_tls_relocations` with the new loop fails on untouched 62b3ba2522 at its first case with `AssertionError: ('linux-undefined-16-10', 0, '')`, and on a first version of this change that also exempted undefined `STT_SECTION` symbols, at `AssertionError: ('linux-undefined-16-13', 0, '')`. On 90fb3186bc (871517aaee merged) with the `RelinkerPipeline.cpp` of 871517aaee restored, it fails again at `AssertionError: ('linux-undefined-16-10', 0, '')` while `call_registry` passes. Run one by one on 62b3ba2522, all 18 Linux and `--lazy-binding` cases with `st_info` 0x10, 0x11 and 0x12 exit 0 with the import typed `STT_TLS` in `DT_RELA`, and all 18 `--windows` and `--macos` cases exit 2 with `Imported TLS relocation N is not supported for this target (offset 0x1000)`. On that first version, which handles `STT_SECTION` exactly as 62b3ba2522, the named 0x13 case exits 0 on Linux and `--lazy-binding` with `DT_RELA` holding `(0x401000, 16|17|18, ImportedTls, STT_TLS, 0)` (0x1000 with `--lazy-binding`) and exits 2 on `--windows` and `--macos` with `Imported TLS relocation N is not supported for this target (offset 0x1000)`, and the unnamed 0x03 case exits 2 with `Unnamed import symbol is not a null symbol entry (offset 0x4948)` on all four targets for all three types. With the change all 84 exit 2 with the new message and write no output; undefined `STT_TLS` imports with `st_info` 0x16 and 0x26 still convert on Linux and `--lazy-binding` with the import typed `STT_TLS` and fail on `--windows` and `--macos` as before. An all-zero entry at the `IMPORTED` index converted on Linux and `--lazy-binding` on 62b3ba2522 and now fails with the new message on every target. Registry fixture with types 16, 17 and 18 on Linux and `--lazy-binding`: `st_info` 0x00 exits 2 with the new message, 0x06 and 0x16 exit 0 with the matching `relocationType` in the registry. - Mutants on 53d9015e9d: with the undefined-symbol check written as `type < STT_TLS`, `executable_tls_relocations` fails at `AssertionError: ('linux-undefined-16-1a', 0, '')`; with the type masked by 7, at `AssertionError: ('linux-undefined-16-1e', 0, '')`. - On 53d9015e9d (3a40945e62 merged): `ctest -R 'tls|import_symbol|executable_|null_symbol|section_symbol|guest_|call_registry|elf_header|restricted' -j 4`: 90 tests passed in 46.9 s; run alone, `executable_tls_relocations` took 9.5 s, `call_registry` 3.1 s, `import_symbol_types` 2.9 s. - Full suite: `ctest --test-dir build-relinker -j 5` on 53d9015e9d: 388 tests, 386 passed, `long_paths` skipped; the one failure, `select_tests` (Windows symlink fixture), fails on `main` on this machine as well. - `python tools/check_conventions.py --base upstream/main` with this title and description passed on 53d9015e9d. - Not tested on Linux or macOS; CI runs the tests on all three hosts. ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: <!-- #PR, or none --> none - [x] Fixes: <!-- issue it closes as Fixes #N, or none --> none - [x] Unblocks: <!-- title ID and Game bring-up discussion, e.g. PPSA01325 #3232, or none --> none - [x] GPUs tested: <!-- for AGC, shader recompiler or VideoOut changes: vendor, model, driver and OS of each GPU the GPU tests ran on; otherwise n/a --> n/a - [x] AI-assisted: <!-- yes / no --> yes (Claude Code)
rooklz commented 2026-10-28 10:46:27 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by rooklz on 2026-10-28T10:46:27Z.

Review: APPROVED


Reviewed 2de9d68a58 merged onto main 3a40945e62, macOS arm64 (Apple clang), relinker-only Release build.

  • Build 270/270, ctest -j 8: 378/378 passed.
  • Removing the new check from the source makes executable_tls_relocations fail; call_registry still passes.
  • Mutants of the new condition:
    • exempt STT_SECTION (&& type != 3): killed
    • only reject STT_NOTYPE: killed
    • type < STT_TLS instead of type != STT_TLS: survives
    • & 7 instead of & 15 for the type nibble: survives

The two survivors are there because every non-TLS type in the new loop is below 6 (0x10–0x13, 0x03). So nothing checks an undefined symbol whose type is above STT_TLS, such as STT_GNU_IFUNC (10) or STT_HIPROC (15). Adding (0x1a, IMPORT_NAME) and (0x1e, IMPORT_NAME) to the info tuple kills both mutants, the head still passes, and the test takes 0.65 s:

-            for info, symbol_name in ((0x10, IMPORT_NAME), (0x11, IMPORT_NAME), (0x12, IMPORT_NAME), (0x13, IMPORT_NAME), (0x03, 0)):
+            for info, symbol_name in ((0x10, IMPORT_NAME), (0x11, IMPORT_NAME), (0x12, IMPORT_NAME), (0x13, IMPORT_NAME), (0x1a, IMPORT_NAME), (0x1e, IMPORT_NAME), (0x03, 0)):

A small optional cleanup: the defined-symbol branch right below it could reuse type instead of (raw[symOff + 4] & 15).

check_conventions.py --base upstream/main passed. pr_overlap.py flags only #10861, which can't be compared; your manual check of #10861 (an #include-block conflict only) agrees with the code. The rule matches the gABI STT_TLS requirement and the guest reader's existing Invalid guest TLS relocation. Approving; the test addition above isn't required.

AI-assisted: yes

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5681390982 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12341#pullrequestreview-5681390982). Originally posted by [rooklz](https://github.com/rooklz) on 2026-10-28T10:46:27Z. **Review:** APPROVED --- Reviewed 2de9d68a58 merged onto `main` 3a40945e62, macOS arm64 (Apple clang), relinker-only Release build. - Build 270/270, `ctest -j 8`: 378/378 passed. - Removing the new check from the source makes `executable_tls_relocations` fail; `call_registry` still passes. - Mutants of the new condition: - exempt `STT_SECTION` (`&& type != 3`): killed - only reject `STT_NOTYPE`: killed - `type < STT_TLS` instead of `type != STT_TLS`: **survives** - `& 7` instead of `& 15` for the type nibble: **survives** The two survivors are there because every non-TLS type in the new loop is below 6 (0x10–0x13, 0x03). So nothing checks an undefined symbol whose type is above `STT_TLS`, such as `STT_GNU_IFUNC` (10) or `STT_HIPROC` (15). Adding `(0x1a, IMPORT_NAME)` and `(0x1e, IMPORT_NAME)` to the `info` tuple kills both mutants, the head still passes, and the test takes 0.65 s: ```diff - for info, symbol_name in ((0x10, IMPORT_NAME), (0x11, IMPORT_NAME), (0x12, IMPORT_NAME), (0x13, IMPORT_NAME), (0x03, 0)): + for info, symbol_name in ((0x10, IMPORT_NAME), (0x11, IMPORT_NAME), (0x12, IMPORT_NAME), (0x13, IMPORT_NAME), (0x1a, IMPORT_NAME), (0x1e, IMPORT_NAME), (0x03, 0)): ``` A small optional cleanup: the defined-symbol branch right below it could reuse `type` instead of `(raw[symOff + 4] & 15)`. `check_conventions.py --base upstream/main` passed. `pr_overlap.py` flags only #10861, which can't be compared; your manual check of #10861 (an `#include`-block conflict only) agrees with the code. The rule matches the gABI `STT_TLS` requirement and the guest reader's existing `Invalid guest TLS relocation`. Approving; the test addition above isn't required. AI-assisted: yes
MarcZX10 commented 2026-10-28 10:52:12 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-28T10:52:12Z.

Review: APPROVED


Reviewed the undefined-symbol type check, its bounds/order relative to symbolEntryPos, and both fixture updates. The new matrix exercises all three executable TLS relocation types against undefined non-TLS symbol types across the target modes; the registry fixture now explicitly uses STT_TLS, preserving its intended case. Hosted Linux and Windows relinker plus ASAN checks pass. The macOS x86_64 relinker check remains pending.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5681459112 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12341#pullrequestreview-5681459112). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-28T10:52:12Z. **Review:** APPROVED --- Reviewed the undefined-symbol type check, its bounds/order relative to `symbolEntryPos`, and both fixture updates. The new matrix exercises all three executable TLS relocation types against undefined non-TLS symbol types across the target modes; the registry fixture now explicitly uses `STT_TLS`, preserving its intended case. Hosted Linux and Windows relinker plus ASAN checks pass. The macOS x86_64 relinker check remains pending.
MarcZX10 commented 2026-10-28 11:40:49 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-28T11:40:49Z.

Review: COMMENTED


Re-reviewed exact head 53d9015e9dec23d7654b2c3d1480898c47a3cc4a. The added undefined-symbol cases include types above STT_TLS, so the type != STT_TLS guard is exercised beyond the earlier low-valued types; the call-registry fixture now uses STT_TLS for the relocation types it expects to remain valid. I configured and built the relinker-only tree on Linux (cmake -S . -B build -G Ninja -DANYPS5_RELINKER_ONLY=ON -DBUILD_TESTING=ON; cmake --build build --parallel 8, 293/293 steps), then ran ctest --test-dir build -R '^(executable_tls_relocations|call_registry)$' --output-on-failure -V: 2/2 passed (8.57s and 5.07s). The hosted Linux/Windows/macOS relinker checks for this head are still pending, so I have not approved yet.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5682015878 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12341#pullrequestreview-5682015878). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-28T11:40:49Z. **Review:** COMMENTED --- Re-reviewed exact head `53d9015e9dec23d7654b2c3d1480898c47a3cc4a`. The added undefined-symbol cases include types above `STT_TLS`, so the `type != STT_TLS` guard is exercised beyond the earlier low-valued types; the call-registry fixture now uses `STT_TLS` for the relocation types it expects to remain valid. I configured and built the relinker-only tree on Linux (`cmake -S . -B build -G Ninja -DANYPS5_RELINKER_ONLY=ON -DBUILD_TESTING=ON`; `cmake --build build --parallel 8`, 293/293 steps), then ran `ctest --test-dir build -R '^(executable_tls_relocations|call_registry)$' --output-on-failure -V`: 2/2 passed (8.57s and 5.07s). The hosted Linux/Windows/macOS relinker checks for this head are still pending, so I have not approved yet.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!12341
No description provided.