fix(relinker): resolve a needed module on the executable that exports its imports #15245

Closed
simnJS wants to merge 11 commits from upstream-pr/15245 into main
simnJS commented 2026-11-02 22:04:56 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by simnJS on 2026-11-02T22:04:56Z.


What

Builds on #11432, which is in main; only the commits after it are new here.

A converted module can name the executable of its title as a dependency, under a module name the image does not record. Trackmania (PPSA02195) has such a module: the Windows entry stub then looks for a library of that name in libs/ and stops with error 126.

--executable-module <name> (repeatable) names the needed libraries to resolve on the executable. For a named library the Windows entry stub takes the image handle with GetModuleHandleW(NULL) when there is no libs/<name>.dll; a libs/<name>.dll that is present but fails to load stops start-up with its load error. Linux and macOS leave a named library out of DT_NEEDED and LC_LOAD_DYLIB at conversion. GetProcAddress resolution stays on the export table #11432 adds. Conversion fails when the executable does not export a symbol imported from a named library, and prints a line for each library resolved this way.

The name is given explicitly because the image does not keep the executable's module name, and overlapping export names do not show that a library is the executable. A library that is not named loads as before, and a bundled module of the same name is still loaded. The debt file records how the provider is chosen and the remaining gaps: on Windows the name stays in .needed.json, and a TLS import from the executable fails at conversion.

Tested

Linux x86-64, relinker-only build (-DANYPS5_RELINKER_ONLY=ON), Release: executable_module_imports (a named library, an unnamed library whose imports the executable exports, and a named library with an import the executable does not export, converted for Windows, Linux and macOS), windows_executable_exports, cli_args, cli_help and the guest module tests pass. With the named binding disabled, executable_module_imports fails. The native Windows cases of executable_module_imports run only on Windows and were not run on this head; on Linux the test checks that the generated PE holds the .dll path only for a named library. On Linux and macOS only the converted dependency lists were checked; nothing was executed there. Trackmania (PPSA02195) was not converted with --executable-module.

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: #11432
  • Fixes: none
  • Unblocks: PPSA02195 #13709
  • GPUs tested: n/a
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5128159144 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/15245). Originally posted by [simnJS](https://github.com/simnJS) on 2026-11-02T22:04:56Z. --- ### What Builds on #11432, which is in `main`; only the commits after it are new here. A converted module can name the executable of its title as a dependency, under a module name the image does not record. Trackmania (PPSA02195) has such a module: the Windows entry stub then looks for a library of that name in `libs/` and stops with error 126. `--executable-module <name>` (repeatable) names the needed libraries to resolve on the executable. For a named library the Windows entry stub takes the image handle with `GetModuleHandleW(NULL)` when there is no `libs/<name>.dll`; a `libs/<name>.dll` that is present but fails to load stops start-up with its load error. Linux and macOS leave a named library out of `DT_NEEDED` and `LC_LOAD_DYLIB` at conversion. `GetProcAddress` resolution stays on the export table #11432 adds. Conversion fails when the executable does not export a symbol imported from a named library, and prints a line for each library resolved this way. The name is given explicitly because the image does not keep the executable's module name, and overlapping export names do not show that a library is the executable. A library that is not named loads as before, and a bundled module of the same name is still loaded. The debt file records how the provider is chosen and the remaining gaps: on Windows the name stays in `.needed.json`, and a TLS import from the executable fails at conversion. ### Tested Linux x86-64, relinker-only build (`-DANYPS5_RELINKER_ONLY=ON`), Release: `executable_module_imports` (a named library, an unnamed library whose imports the executable exports, and a named library with an import the executable does not export, converted for Windows, Linux and macOS), `windows_executable_exports`, `cli_args`, `cli_help` and the guest module tests pass. With the named binding disabled, `executable_module_imports` fails. The native Windows cases of `executable_module_imports` run only on Windows and were not run on this head; on Linux the test checks that the generated PE holds the `.dll` path only for a named library. On Linux and macOS only the converted dependency lists were checked; nothing was executed there. Trackmania (PPSA02195) was not converted with `--executable-module`. ### 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: #11432 - [x] Fixes: none - [x] Unblocks: PPSA02195 #13709 - [x] GPUs tested: n/a - [x] AI-assisted: yes
XairRrR commented 2026-11-02 22:58:00 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by XairRrR on 2026-11-02T22:58:00Z.

Review: CHANGES_REQUESTED


Reviewed — changes requested

The change builds, the relinker tests it reaches pass, and the negative control fails as it should. One problem blocks it: the Windows stub checks for the file libs/<name>, but the loader opens libs/<name>.dll. So a libs/<name>.dll that is present but fails to load for any reason is silently replaced by the executable, and the debt entry and the test do not show this.

What I ran

Head 16b292dab4a936dc9737b79357e62f481a62baee, main 5cb015caaaaf83f8ee431414ee6a457b5b307d49, merged tree df336d6a6cf8b23a2340d3104e49dad981fe4576, on Debian 13 with GCC 14.2.0 (Release, Ninja).

git diff --check 5cb015caaaaf83f8ee431414ee6a457b5b307d49...16b292dab4a936dc9737b79357e62f481a62baee
python3 tools/check_conventions.py --base 5cb015caaaaf83f8ee431414ee6a457b5b307d49
ctest --test-dir build -j8 --test-load 32 --output-on-failure -R "^(windows_executable_exports|executable_module_imports|linux_executable_exports|macos_executable_exports|guest_module_dir|guest_module_directories|guest_module_identity|guest_module_fini|guest_module_args|windows_import_modules|macos_output|windows_fixed_base|agc_driver_image_sample_lod_clamp_shader_lane|agc_driver_image_sample_lod_clamp)$"
# negative control 1: production files of 4807af4ff254 back to 67d34af2df49 (#11432 only)
ninja -C build -j32 -l32 relinker
ctest --test-dir build --output-on-failure -R "^(executable_module_imports|windows_executable_exports)$"
# negative control 2: also WindowsElfPatcher.hpp, WindowsPePatcher.cpp, Conversion.cpp from main
ninja -C build -j32 -l32 relinker
ctest --test-dir build --output-on-failure -R "^windows_executable_exports$"
# restore the merged tree, rebuild, rerun both tests
ninja -C build -j32 -l32 relinker
ctest --test-dir build -R "^(executable_module_imports|windows_executable_exports)$"
git status --porcelain

Results

Check Result
git diff --check clean
check_conventions.py All conventions checks passed
Configure / build / libs (script) ok
windows_executable_exports, executable_module_imports pass (0.12 s and 0.14 s)
linux_executable_exports, macos_executable_exports, guest_module_*, windows_import_modules, macos_output, windows_fixed_base pass
agc_driver_image_sample_lod_clamp_shader_lane (new failure in build.json) fails again; not caused by this PR, see below
unwrap_self_..._destination_directory_group (new failure in build.json) not caused by this PR, see below
Worktree after restore git status --porcelain empty

About the two failures build.json lists as new:

  • agc_driver_image_sample_lod_clamp_shader_lane: the failure baseline is from 096c45570f, 227 commits behind main. Since then main has merged AGC changes to the same feature (#12980, 4e2a028e43 fix(agc): bind a T# minimum LOD through an S# that holds the LOD at 0). This PR changes only files under core/relinker, its tests and a debt doc, and nothing of the AGC driver or the shader recompiler. The failure comes from main, not this PR. I did not rebuild the AGC test with the PR's files reverted.
  • unwrap_self_UnwrapTest_test_new_output_inherits_the_destination_directory_group: fails with os.chown(...) → EINVAL inside the sandbox. This PR does not touch tools/, so the failure comes from the test environment.
Failing AGC test, last line
AGC graphics: image_sample_lz through the S# that holds the LOD at 0 with T# MIN_LOD 768 over BASE_LEVEL 0 with a second S# of words 1 0 and 2 5242880, and a second T# of MIN_LOD 0 and LAST_LEVEL 0: thread 0 component 1 is 0.000000, expected 0.062500

Negative control

  1. I set the production files of commit 4807af4ff254 back to their state at 67d34af2df49, which keeps only #11432's export table: WindowsEntryStubBuilder.{hpp,cpp}, WindowsExportBuilder.{hpp,cpp}, WindowsPePatcher.cpp and GuestModuleBuilder.cpp. After rebuilding relinker, executable_module_imports fails in check_linux, and windows_executable_exports still passes, as expected:

    output
    AssertionError: ['$ORIGIN/app0/sce_module/consumer.prx.guest.prx', 'SyntheticMain', 'libkernel.prx']
    
  2. I then also restored WindowsElfPatcher.hpp, WindowsPePatcher.cpp and Conversion.cpp from main, which unhooks the executable export table. windows_executable_exports fails with AssertionError: {}.

  3. I restored the merged files and rebuilt. Both tests pass again, and the worktree matches the merged tree.

On Linux this control covers only the Linux and macOS dependency lists and the presence of the PE export. The Windows parts of executable_module_imports run only when os.name == 'nt', so this machine does not run the new entry-stub code (see "Not verified").

Findings

Blocking

The file probe checks a different file than the one LoadLibraryExW opens, so a broken libs/<name>.dll silently falls back to the executable
WindowsEntryStubBuilder.cpp#L656-L676, #L705-L711

  • What the code does: the path in rsi is path + libraries[index] (L150-L152). An executable provider has no module suffix, so that path has no extension. LoadLibraryExW adds .dll to such a path. The PR's own windows-library case depends on that: it puts the provider at libs/SyntheticMain.dll and expects it to load (test L90-L99). GetFileAttributesW does not add anything, so probeMissingFile checks libs\SyntheticMain.
  • Result: a libs/<name>.dll can be present and still fail to load: missing dependency, corrupt file, wrong architecture, failing DllMain. The probe then finds no libs\<name>, takes the missingOptional branch, and resolves every import against the executable. It prints a message only with --windows-diagnostics, and that message says the module was "not found".
  • Why it blocks: CONTRIBUTING says missing imports fail at startup with a clear error, and fallbacks that keep running are not allowed. The debt entry also understates the gap: it names only "a libs/<name>.dll whose own dependency is missing", and the gap covers every load failure.
  • Test: the "not a module" case in the test writes libs/SyntheticMain with no extension (test L66-L69). The loader never opens that file, so the case fails for the wrong reason. A broken .dll is not tested at all.
  • Suggested fix:
    • For an executable provider, probe the name the loader opens, <path>.dll. A trailing . would also do if you prefer to keep the bare name: then add . to the LoadLibraryExW path for these names instead.
    • Change the test to write the invalid file as libs/SyntheticMain.dll and expect the load to fail.
    • Shorten the debt sentence about libs/<name>.dll to what is still open, or drop it once the probe matches.

Non-blocking

  • The bare-name file and the .dll file are not told apart. The same mismatch affects the existing optional-library probe on main (the !imported[index] path). After the fix, a stray libs/<name> with no extension would still make the stub fail instead of falling back. That is safe, but worth keeping consistent with whatever fix you choose.
  • Earlier commit: the branch carries #11432's commit 67d34af2df49, as the description says. Its executable export table is only checked here through windows_executable_exports and negative control 2, and I did not review it beyond its interaction with this change.

Not verified

  • The Windows entry stub was not run. The test's native cases (GetModuleHandleW(NULL), the diagnostics text, the partial, suffix and library cases) execute only on Windows, and this machine is Linux. The blocking finding rests on the code and on the PR's own windows-library case, which needs the .dll added; I did not reproduce it on Windows.
  • macOS: only the Linux-hosted --macos dependency-list check ran; nothing was executed on macOS.
  • Trackmania (PPSA02195): not converted or run.
  • I did not confirm the AGC failure on main by rebuilding the AGC test with this PR's relinker files reverted. My conclusion that it comes from main rests on the PR touching no AGC files and on recent main commits to the same feature.
  • Vulkan validation comparison: skipped by the script because no AGC driver, shader recompiler or VideoOut file changed. It does not apply to this PR.

To get this to a good state

  1. Make the executable-provider probe check the file LoadLibraryExW opens (<name>.dll), so a present but broken library stops startup with the load error.
  2. Change the "not a module" case to libs/SyntheticMain.dll, and rerun the Windows tests on Windows.
  3. Cut the debt entry's libs/<name>.dll sentence to whatever remains open.
<!-- greyfinch-sync:boykopovar/AnyPS5:review:5744626148 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/15245#pullrequestreview-5744626148). Originally posted by [XairRrR](https://github.com/XairRrR) on 2026-11-02T22:58:00Z. **Review:** CHANGES_REQUESTED --- # Reviewed — changes requested The change builds, the relinker tests it reaches pass, and the negative control fails as it should. One problem blocks it: the Windows stub checks for the file `libs/<name>`, but the loader opens `libs/<name>.dll`. So a `libs/<name>.dll` that is present but fails to load for any reason is silently replaced by the executable, and the debt entry and the test do not show this. ## What I ran Head `16b292dab4a936dc9737b79357e62f481a62baee`, `main` `5cb015caaaaf83f8ee431414ee6a457b5b307d49`, merged tree `df336d6a6cf8b23a2340d3104e49dad981fe4576`, on Debian 13 with GCC 14.2.0 (Release, Ninja). ``` git diff --check 5cb015caaaaf83f8ee431414ee6a457b5b307d49...16b292dab4a936dc9737b79357e62f481a62baee python3 tools/check_conventions.py --base 5cb015caaaaf83f8ee431414ee6a457b5b307d49 ctest --test-dir build -j8 --test-load 32 --output-on-failure -R "^(windows_executable_exports|executable_module_imports|linux_executable_exports|macos_executable_exports|guest_module_dir|guest_module_directories|guest_module_identity|guest_module_fini|guest_module_args|windows_import_modules|macos_output|windows_fixed_base|agc_driver_image_sample_lod_clamp_shader_lane|agc_driver_image_sample_lod_clamp)$" # negative control 1: production files of 4807af4ff254 back to 67d34af2df49 (#11432 only) ninja -C build -j32 -l32 relinker ctest --test-dir build --output-on-failure -R "^(executable_module_imports|windows_executable_exports)$" # negative control 2: also WindowsElfPatcher.hpp, WindowsPePatcher.cpp, Conversion.cpp from main ninja -C build -j32 -l32 relinker ctest --test-dir build --output-on-failure -R "^windows_executable_exports$" # restore the merged tree, rebuild, rerun both tests ninja -C build -j32 -l32 relinker ctest --test-dir build -R "^(executable_module_imports|windows_executable_exports)$" git status --porcelain ``` ## Results | Check | Result | |---|---| | `git diff --check` | clean | | `check_conventions.py` | All conventions checks passed | | Configure / build / `libs` (script) | ok | | `windows_executable_exports`, `executable_module_imports` | pass (0.12 s and 0.14 s) | | `linux_executable_exports`, `macos_executable_exports`, `guest_module_*`, `windows_import_modules`, `macos_output`, `windows_fixed_base` | pass | | `agc_driver_image_sample_lod_clamp_shader_lane` (new failure in build.json) | fails again; not caused by this PR, see below | | `unwrap_self_..._destination_directory_group` (new failure in build.json) | not caused by this PR, see below | | Worktree after restore | `git status --porcelain` empty | About the two failures build.json lists as new: - **`agc_driver_image_sample_lod_clamp_shader_lane`**: the failure baseline is from `096c45570f`, 227 commits behind `main`. Since then `main` has merged AGC changes to the same feature (#12980, `4e2a028e43 fix(agc): bind a T# minimum LOD through an S# that holds the LOD at 0`). This PR changes only files under `core/relinker`, its tests and a debt doc, and nothing of the AGC driver or the shader recompiler. The failure comes from `main`, not this PR. I did not rebuild the AGC test with the PR's files reverted. - **`unwrap_self_UnwrapTest_test_new_output_inherits_the_destination_directory_group`**: fails with `os.chown(...)` → `EINVAL` inside the sandbox. This PR does not touch `tools/`, so the failure comes from the test environment. <details><summary>Failing AGC test, last line</summary> ``` AGC graphics: image_sample_lz through the S# that holds the LOD at 0 with T# MIN_LOD 768 over BASE_LEVEL 0 with a second S# of words 1 0 and 2 5242880, and a second T# of MIN_LOD 0 and LAST_LEVEL 0: thread 0 component 1 is 0.000000, expected 0.062500 ``` </details> ## Negative control 1. I set the production files of commit `4807af4ff254` back to their state at `67d34af2df49`, which keeps only #11432's export table: `WindowsEntryStubBuilder.{hpp,cpp}`, `WindowsExportBuilder.{hpp,cpp}`, `WindowsPePatcher.cpp` and `GuestModuleBuilder.cpp`. After rebuilding `relinker`, `executable_module_imports` **fails** in `check_linux`, and `windows_executable_exports` still passes, as expected: <details><summary>output</summary> ``` AssertionError: ['$ORIGIN/app0/sce_module/consumer.prx.guest.prx', 'SyntheticMain', 'libkernel.prx'] ``` </details> 2. I then also restored `WindowsElfPatcher.hpp`, `WindowsPePatcher.cpp` and `Conversion.cpp` from `main`, which unhooks the executable export table. `windows_executable_exports` **fails** with `AssertionError: {}`. 3. I restored the merged files and rebuilt. Both tests pass again, and the worktree matches the merged tree. On Linux this control covers only the Linux and macOS dependency lists and the presence of the PE export. The Windows parts of `executable_module_imports` run only when `os.name == 'nt'`, so this machine does not run the new entry-stub code (see "Not verified"). ## Findings ### Blocking **The file probe checks a different file than the one `LoadLibraryExW` opens, so a broken `libs/<name>.dll` silently falls back to the executable** [`WindowsEntryStubBuilder.cpp#L656-L676`](https://github.com/boykopovar/AnyPS5/blob/16b292dab4a936dc9737b79357e62f481a62baee/core/relinker/elfpatcher/src/windows/WindowsEntryStubBuilder.cpp#L656-L676), [`#L705-L711`](https://github.com/boykopovar/AnyPS5/blob/16b292dab4a936dc9737b79357e62f481a62baee/core/relinker/elfpatcher/src/windows/WindowsEntryStubBuilder.cpp#L705-L711) - **What the code does:** the path in `rsi` is `path + libraries[index]` ([L150-L152](https://github.com/boykopovar/AnyPS5/blob/16b292dab4a936dc9737b79357e62f481a62baee/core/relinker/elfpatcher/src/windows/WindowsEntryStubBuilder.cpp#L150-L152)). An executable provider has no module suffix, so that path has no extension. `LoadLibraryExW` adds `.dll` to such a path. The PR's own `windows-library` case depends on that: it puts the provider at `libs/SyntheticMain.dll` and expects it to load ([test L90-L99](https://github.com/boykopovar/AnyPS5/blob/16b292dab4a936dc9737b79357e62f481a62baee/core/relinker/relinker/tests/test_executable_module_imports.py#L90-L99)). `GetFileAttributesW` does not add anything, so `probeMissingFile` checks `libs\SyntheticMain`. - **Result:** a `libs/<name>.dll` can be present and still fail to load: missing dependency, corrupt file, wrong architecture, failing `DllMain`. The probe then finds no `libs\<name>`, takes the `missingOptional` branch, and resolves every import against the executable. It prints a message only with `--windows-diagnostics`, and that message says the module was "not found". - **Why it blocks:** CONTRIBUTING says missing imports fail at startup with a clear error, and fallbacks that keep running are not allowed. The debt entry also understates the gap: it names only "a `libs/<name>.dll` whose own dependency is missing", and the gap covers every load failure. - **Test:** the "not a module" case in the test writes `libs/SyntheticMain` with no extension ([test L66-L69](https://github.com/boykopovar/AnyPS5/blob/16b292dab4a936dc9737b79357e62f481a62baee/core/relinker/relinker/tests/test_executable_module_imports.py#L66-L69)). The loader never opens that file, so the case fails for the wrong reason. A broken `.dll` is not tested at all. - **Suggested fix:** - For an executable provider, probe the name the loader opens, `<path>.dll`. A trailing `.` would also do if you prefer to keep the bare name: then add `.` to the `LoadLibraryExW` path for these names instead. - Change the test to write the invalid file as `libs/SyntheticMain.dll` and expect the load to fail. - Shorten the debt sentence about `libs/<name>.dll` to what is still open, or drop it once the probe matches. ### Non-blocking - **The bare-name file and the `.dll` file are not told apart.** The same mismatch affects the existing optional-library probe on `main` (the `!imported[index]` path). After the fix, a stray `libs/<name>` with no extension would still make the stub fail instead of falling back. That is safe, but worth keeping consistent with whatever fix you choose. - **Earlier commit:** the branch carries #11432's commit `67d34af2df49`, as the description says. Its executable export table is only checked here through `windows_executable_exports` and negative control 2, and I did not review it beyond its interaction with this change. ## Not verified - The Windows entry stub was not run. The test's `native` cases (`GetModuleHandleW(NULL)`, the diagnostics text, the partial, suffix and library cases) execute only on Windows, and this machine is Linux. The blocking finding rests on the code and on the PR's own `windows-library` case, which needs the `.dll` added; I did not reproduce it on Windows. - macOS: only the Linux-hosted `--macos` dependency-list check ran; nothing was executed on macOS. - Trackmania (PPSA02195): not converted or run. - I did not confirm the AGC failure on `main` by rebuilding the AGC test with this PR's relinker files reverted. My conclusion that it comes from `main` rests on the PR touching no AGC files and on recent `main` commits to the same feature. - Vulkan validation comparison: skipped by the script because no AGC driver, shader recompiler or VideoOut file changed. It does not apply to this PR. ## To get this to a good state 1. Make the executable-provider probe check the file `LoadLibraryExW` opens (`<name>.dll`), so a present but broken library stops startup with the load error. 2. Change the "not a module" case to `libs/SyntheticMain.dll`, and rerun the Windows tests on Windows. 3. Cut the debt entry's `libs/<name>.dll` sentence to whatever remains open. <!-- anyps5-bots job=2600 head=16b292dab4a936dc9737b79357e62f481a62baee -->
XairRrR commented 2026-11-03 06:46:31 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by XairRrR on 2026-11-03T06:46:31Z.

Review: APPROVED


Re-checked — approved

The new commit c547f5e845 adds .dll to the path of an executable-provider library. The GetFileAttributesW probe and LoadLibraryExW now check the same libs\<name>.dll, so a present but broken library stops startup with its load error. The commit also changes the test and the debt entry to match.

What changed since my last review

  • The first four commits are unchanged (delta: 1:1 through 4:4 are identical).
  • New commit c547f5e845 fix(relinker): probe the .dll file the loader opens for an executable module:
    • WindowsEntryStubBuilder.cpp: the executableProviders computation moves before the path table, and name += ".dll" is added for providers (L148-L166). The probe after a failed load (L671-L678) therefore checks the file the loader opened.
    • Test: the "not a module" case now writes libs/SyntheticMain.dll (test L66-L70).
    • Debt: the sentence about a libs/<name>.dll being passed over for the executable is removed.
  • There are no new comments by others. The description's Tested section is unchanged; the Windows runs it reports are accepted as author-reported.

What I ran

Head c547f5e8457d3b76619883caf2de85884dac1b98, main d1ae628bc2f62459cce1e9872ba5632c938c71f2, merged tree db181f9d5678bf0a557f330da16bff08c0678a21, on Debian 13 (GCC 14.2.0, Release, Ninja).

git diff --check d1ae628bc2f62459cce1e9872ba5632c938c71f2...c547f5e8457d3b76619883caf2de85884dac1b98
python3 tools/check_conventions.py --base d1ae628bc2f62459cce1e9872ba5632c938c71f2
ctest --test-dir build -j8 --test-load 32 --output-on-failure -R "^(windows_executable_exports|executable_module_imports|windows_import_modules|guest_module_identity|guest_module_directories|macos_output|windows_fixed_base)$"
# convert the test's windows-resolved and windows-absent fixtures with the built relinker and search the PE for the UTF-16 library path
python3 -c "...test_executable_module_imports.convert(...)..."
git status --porcelain
Check Result
git diff --check clean
check_conventions.py All conventions checks passed
Configure / build / libs (script) ok
Script test run (791 tests) no new failures, no timeouts; only unwrap_self_..._destination_directory_group fails, and it fails on main too (known failure)
7 focused relinker tests all pass (≤ 0.43 s each)
Embedded library path, provider case (windows-resolved) libs\SyntheticMain.dll present, bare libs\SyntheticMain absent
Embedded library path, non-provider case (windows-absent) bare libs\SyntheticMain, unchanged; the loader still appends .dll itself
Worktree afterwards git status --porcelain empty

The AGC failure I reported last time as coming from main no longer appears. The baseline is now current main.

Previous findings

  • Blocking: the probe checked libs/<name> while the loader opened libs/<name>.dll. Resolved.
    • Provider paths now end in .dll (L163-L164), and I confirmed the converted PE embeds libs\SyntheticMain.dll for the provider case.
    • After a failed LoadLibraryExW, the probe at L678 sees the existing file and branches to the failure path instead of missingOptional.
    • The test's invalid file is now libs/SyntheticMain.dll.
    • The debt sentence is removed.
  • Non-blocking: the bare name and .dll were not told apart. No longer applies to this PR's path: a stray extensionless libs/<name> is now ignored for providers. The same mismatch remains in the optional-library probe that is already on main (the !imported[index] path at L671), but this PR does not change it.
  • Non-blocking: #11432's commit 67d34af2df49 was reviewed only through its interaction with this change. Still open as a scope note. The commit is unchanged; windows_executable_exports passes.

New findings

Blocking

None.

Non-blocking

None.

Negative control

The only test line that changed runs only when os.name == 'nt'. Reverting the production change on this Linux machine would leave the test's result unchanged, so a ctest-based control would prove nothing. Instead, I checked the effect on the converted PE (table above): the provider path carries .dll and the non-provider path does not. The earlier negative controls for the Linux/macOS dependency lists and the export table still apply, because those files did not change.

Not verified

  • Windows execution: the entry stub was not run. The native cases (GetModuleHandleW(NULL) fallback, the broken libs/SyntheticMain.dll failing startup, diagnostics text) execute only on Windows. The author reports that they pass on Windows 11 with WinLibs GCC 15.2.0.
  • macOS: only the Linux-hosted --macos dependency-list check ran.
  • Trackmania (PPSA02195): not converted or run.
  • Vulkan validation: skipped by the script; no AGC driver, shader recompiler or VideoOut file changed.
<!-- greyfinch-sync:boykopovar/AnyPS5:review:5748171225 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/15245#pullrequestreview-5748171225). Originally posted by [XairRrR](https://github.com/XairRrR) on 2026-11-03T06:46:31Z. **Review:** APPROVED --- # Re-checked — approved The new commit `c547f5e845` adds `.dll` to the path of an executable-provider library. The `GetFileAttributesW` probe and `LoadLibraryExW` now check the same `libs\<name>.dll`, so a present but broken library stops startup with its load error. The commit also changes the test and the debt entry to match. ## What changed since my last review - The first four commits are unchanged (delta: `1:1` through `4:4` are identical). - New commit `c547f5e845 fix(relinker): probe the .dll file the loader opens for an executable module`: - `WindowsEntryStubBuilder.cpp`: the `executableProviders` computation moves before the path table, and `name += ".dll"` is added for providers ([L148-L166](https://github.com/boykopovar/AnyPS5/blob/c547f5e8457d3b76619883caf2de85884dac1b98/core/relinker/elfpatcher/src/windows/WindowsEntryStubBuilder.cpp#L148-L166)). The probe after a failed load ([L671-L678](https://github.com/boykopovar/AnyPS5/blob/c547f5e8457d3b76619883caf2de85884dac1b98/core/relinker/elfpatcher/src/windows/WindowsEntryStubBuilder.cpp#L671-L678)) therefore checks the file the loader opened. - Test: the "not a module" case now writes `libs/SyntheticMain.dll` ([test L66-L70](https://github.com/boykopovar/AnyPS5/blob/c547f5e8457d3b76619883caf2de85884dac1b98/core/relinker/relinker/tests/test_executable_module_imports.py#L66-L70)). - Debt: the sentence about a `libs/<name>.dll` being passed over for the executable is removed. - There are no new comments by others. The description's Tested section is unchanged; the Windows runs it reports are accepted as author-reported. ## What I ran Head `c547f5e8457d3b76619883caf2de85884dac1b98`, `main` `d1ae628bc2f62459cce1e9872ba5632c938c71f2`, merged tree `db181f9d5678bf0a557f330da16bff08c0678a21`, on Debian 13 (GCC 14.2.0, Release, Ninja). ``` git diff --check d1ae628bc2f62459cce1e9872ba5632c938c71f2...c547f5e8457d3b76619883caf2de85884dac1b98 python3 tools/check_conventions.py --base d1ae628bc2f62459cce1e9872ba5632c938c71f2 ctest --test-dir build -j8 --test-load 32 --output-on-failure -R "^(windows_executable_exports|executable_module_imports|windows_import_modules|guest_module_identity|guest_module_directories|macos_output|windows_fixed_base)$" # convert the test's windows-resolved and windows-absent fixtures with the built relinker and search the PE for the UTF-16 library path python3 -c "...test_executable_module_imports.convert(...)..." git status --porcelain ``` | Check | Result | |---|---| | `git diff --check` | clean | | `check_conventions.py` | All conventions checks passed | | Configure / build / `libs` (script) | ok | | Script test run (791 tests) | no new failures, no timeouts; only `unwrap_self_..._destination_directory_group` fails, and it fails on `main` too (known failure) | | 7 focused relinker tests | all pass (≤ 0.43 s each) | | Embedded library path, provider case (`windows-resolved`) | `libs\SyntheticMain.dll` present, bare `libs\SyntheticMain` absent | | Embedded library path, non-provider case (`windows-absent`) | bare `libs\SyntheticMain`, unchanged; the loader still appends `.dll` itself | | Worktree afterwards | `git status --porcelain` empty | The AGC failure I reported last time as coming from `main` no longer appears. The baseline is now current `main`. ## Previous findings - **Blocking: the probe checked `libs/<name>` while the loader opened `libs/<name>.dll`.** Resolved. - Provider paths now end in `.dll` (L163-L164), and I confirmed the converted PE embeds `libs\SyntheticMain.dll` for the provider case. - After a failed `LoadLibraryExW`, the probe at L678 sees the existing file and branches to the failure path instead of `missingOptional`. - The test's invalid file is now `libs/SyntheticMain.dll`. - The debt sentence is removed. - **Non-blocking: the bare name and `.dll` were not told apart.** No longer applies to this PR's path: a stray extensionless `libs/<name>` is now ignored for providers. The same mismatch remains in the optional-library probe that is already on `main` (the `!imported[index]` path at L671), but this PR does not change it. - **Non-blocking: #11432's commit `67d34af2df49` was reviewed only through its interaction with this change.** Still open as a scope note. The commit is unchanged; `windows_executable_exports` passes. ## New findings ### Blocking None. ### Non-blocking None. ## Negative control The only test line that changed runs only when `os.name == 'nt'`. Reverting the production change on this Linux machine would leave the test's result unchanged, so a ctest-based control would prove nothing. Instead, I checked the effect on the converted PE (table above): the provider path carries `.dll` and the non-provider path does not. The earlier negative controls for the Linux/macOS dependency lists and the export table still apply, because those files did not change. ## Not verified - **Windows execution:** the entry stub was not run. The `native` cases (`GetModuleHandleW(NULL)` fallback, the broken `libs/SyntheticMain.dll` failing startup, diagnostics text) execute only on Windows. The author reports that they pass on Windows 11 with WinLibs GCC 15.2.0. - **macOS:** only the Linux-hosted `--macos` dependency-list check ran. - **Trackmania (PPSA02195):** not converted or run. - **Vulkan validation:** skipped by the script; no AGC driver, shader recompiler or VideoOut file changed. <!-- anyps5-bots job=2995 head=c547f5e8457d3b76619883caf2de85884dac1b98 -->
XairRrR commented 2026-11-03 10:27:34 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by XairRrR on 2026-11-03T10:27:34Z.

Review: APPROVED


Re-checked — approved

The only new commit is ccb32747bb, a merge of main 4f41f4c375 into the branch. The PR's five commits are unchanged, the merged tree builds and passes the PR's tests, and the Windows-only cases I could not run now have an independent Windows report.

What changed since my last review

  • Commits: ccb32747bb merges main 4f41f4c375 into the branch. The range-diff shows the five PR commits as =, so the PR's own content is the same as in c547f5e845, which I reviewed last time.

  • Overlap with main: between d1ae628bc2 and 4f41f4c375, main changed two files this PR also changes.

    • GuestModuleBuilder.cpp gained unavailableUnused and --omit-unavailable-dependencies.
    • Conversion.cpp changed too.
    • Interaction: unavailableUnused returns false whenever a module imports a symbol from the dependency. A name the executable provides always has at least one import, so unavailableUnused never removes it. The two filters chain without conflict: unavailableUnused runs first, then loadsHost, at the addHost and neededLibraries call sites.
  • New comment by bunbeans2-arch (Windows 11, MSYS2 UCRT64 GCC 16.1.0):

    • Both tests pass 5 of 5 with the PR.
    • With the PR's production files reverted, executable_module_imports fails at expect_entry with error 126.
    • With only the .dll probe change reverted, it fails at expect_load_failure.

    This covers the Windows execution and the Windows negative control that I listed under "Not verified". I accept these results as reported by that reviewer; I did not reproduce them.

  • The description is unchanged.

What I ran

Head ccb32747bbae78d7d83363658dc9229133fc31a5, main 4f41f4c375f5abb487dbd184fbc150f31994d762, merged tree 3272c5e643371d626caef780118bd8d54b3557b7, on Debian 13 (GCC 14.2.0, Release, Ninja).

git diff --check 4f41f4c375f5abb487dbd184fbc150f31994d762...ccb32747bbae78d7d83363658dc9229133fc31a5
python3 tools/check_conventions.py --base 4f41f4c375f5abb487dbd184fbc150f31994d762
git diff --stat d1ae628bc2f62459cce1e9872ba5632c938c71f2 4f41f4c375f5abb487dbd184fbc150f31994d762 -- <the PR's production paths>
git diff d1ae628bc2f62459cce1e9872ba5632c938c71f2 4f41f4c375f5abb487dbd184fbc150f31994d762 -- core/relinker/relinker/src/guest/GuestModuleBuilder.cpp core/relinker/elfpatcher/src/windows/WindowsTlsBuilder.cpp core/relinker/elfpatcher/src/windows/WindowsGuestModuleWriter.cpp
ctest --test-dir build -j8 --test-load 32 --output-on-failure -R "^(windows_executable_exports|executable_module_imports|windows_import_modules|guest_module_identity|guest_module_directories|macos_output|windows_fixed_base)$"
git status --porcelain
Check Result
git diff --check clean
check_conventions.py All conventions checks passed
Configure / build / libs (script) ok
Script test run (822 tests) no new failures, no timeouts. Only unwrap_self_..._destination_directory_group fails, and it also fails on main (known failure).
7 focused relinker tests 7/7 pass, each ≤ 0.15 s
Worktree afterwards git status --porcelain empty

Previous findings

  • Non-blocking: #11432's commit 67d34af2df49 was reviewed only through its interaction with this change. Still open, as a scope note. The commit is unchanged, and windows_executable_exports passes here and in the new Windows report.

All other earlier findings were resolved or no longer applied in my last review, and nothing has changed them since.

New findings

Blocking

None.

Non-blocking

None.

Not verified

  • Windows execution: I did not run anything on Windows. The native cases and their Windows negative control are reported by the author and by bunbeans2-arch.
  • Negative control: I did not repeat it on this machine. Neither the tests nor the production files changed since my last review, and on Linux the changed test lines run only under os.name == 'nt'.
  • macOS: only the Linux-hosted --macos dependency-list check ran.
  • Trackmania (PPSA02195): not converted or run.
  • Vulkan validation: the script skipped it because no AGC driver, shader recompiler or VideoOut file changed.
<!-- greyfinch-sync:boykopovar/AnyPS5:review:5750547557 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/15245#pullrequestreview-5750547557). Originally posted by [XairRrR](https://github.com/XairRrR) on 2026-11-03T10:27:34Z. **Review:** APPROVED --- # Re-checked — approved The only new commit is `ccb32747bb`, a merge of `main` `4f41f4c375` into the branch. The PR's five commits are unchanged, the merged tree builds and passes the PR's tests, and the Windows-only cases I could not run now have an independent Windows report. ## What changed since my last review - **Commits:** `ccb32747bb` merges `main` `4f41f4c375` into the branch. The range-diff shows the five PR commits as `=`, so the PR's own content is the same as in `c547f5e845`, which I reviewed last time. - **Overlap with `main`:** between `d1ae628bc2` and `4f41f4c375`, `main` changed two files this PR also changes. - `GuestModuleBuilder.cpp` gained `unavailableUnused` and `--omit-unavailable-dependencies`. - `Conversion.cpp` changed too. - Interaction: `unavailableUnused` returns false whenever a module imports a symbol from the dependency. A name the executable provides always has at least one import, so `unavailableUnused` never removes it. The two filters chain without conflict: `unavailableUnused` runs first, then `loadsHost`, at the `addHost` and `neededLibraries` call sites. - **New comment by bunbeans2-arch (Windows 11, MSYS2 UCRT64 GCC 16.1.0):** - Both tests pass 5 of 5 with the PR. - With the PR's production files reverted, `executable_module_imports` fails at `expect_entry` with error 126. - With only the `.dll` probe change reverted, it fails at `expect_load_failure`. This covers the Windows execution and the Windows negative control that I listed under "Not verified". I accept these results as reported by that reviewer; I did not reproduce them. - The description is unchanged. ## What I ran Head `ccb32747bbae78d7d83363658dc9229133fc31a5`, `main` `4f41f4c375f5abb487dbd184fbc150f31994d762`, merged tree `3272c5e643371d626caef780118bd8d54b3557b7`, on Debian 13 (GCC 14.2.0, Release, Ninja). ``` git diff --check 4f41f4c375f5abb487dbd184fbc150f31994d762...ccb32747bbae78d7d83363658dc9229133fc31a5 python3 tools/check_conventions.py --base 4f41f4c375f5abb487dbd184fbc150f31994d762 git diff --stat d1ae628bc2f62459cce1e9872ba5632c938c71f2 4f41f4c375f5abb487dbd184fbc150f31994d762 -- <the PR's production paths> git diff d1ae628bc2f62459cce1e9872ba5632c938c71f2 4f41f4c375f5abb487dbd184fbc150f31994d762 -- core/relinker/relinker/src/guest/GuestModuleBuilder.cpp core/relinker/elfpatcher/src/windows/WindowsTlsBuilder.cpp core/relinker/elfpatcher/src/windows/WindowsGuestModuleWriter.cpp ctest --test-dir build -j8 --test-load 32 --output-on-failure -R "^(windows_executable_exports|executable_module_imports|windows_import_modules|guest_module_identity|guest_module_directories|macos_output|windows_fixed_base)$" git status --porcelain ``` | Check | Result | |---|---| | `git diff --check` | clean | | `check_conventions.py` | All conventions checks passed | | Configure / build / `libs` (script) | ok | | Script test run (822 tests) | no new failures, no timeouts. Only `unwrap_self_..._destination_directory_group` fails, and it also fails on `main` (known failure). | | 7 focused relinker tests | 7/7 pass, each ≤ 0.15 s | | Worktree afterwards | `git status --porcelain` empty | ## Previous findings - **Non-blocking: #11432's commit `67d34af2df49` was reviewed only through its interaction with this change.** Still open, as a scope note. The commit is unchanged, and `windows_executable_exports` passes here and in the new Windows report. All other earlier findings were resolved or no longer applied in my last review, and nothing has changed them since. ## New findings ### Blocking None. ### Non-blocking None. ## Not verified - **Windows execution:** I did not run anything on Windows. The native cases and their Windows negative control are reported by the author and by bunbeans2-arch. - **Negative control:** I did not repeat it on this machine. Neither the tests nor the production files changed since my last review, and on Linux the changed test lines run only under `os.name == 'nt'`. - **macOS:** only the Linux-hosted `--macos` dependency-list check ran. - **Trackmania (PPSA02195):** not converted or run. - **Vulkan validation:** the script skipped it because no AGC driver, shader recompiler or VideoOut file changed. <!-- anyps5-bots job=3277 head=ccb32747bbae78d7d83363658dc9229133fc31a5 -->
Superseabas commented 2026-11-06 10:35:30 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Superseabas on 2026-11-06T10:35:30Z.

Review: APPROVED


Windows run of the --executable-module head, 068fccf2bb, the first on Windows since the change @oneandonlydean asked for. The native Windows cases of executable_module_imports pass, and nothing else in the Windows relinker and entry-stub tests changes.

Head merged onto main e64c194c43 (clean merge, local only). Windows 11 Home 10.0.26200, WinLibs GCC 16.2.0 (x86_64-ucrt-posix-seh, r3), Python 3.13, Release, BUILD_TESTING=ON, run from PowerShell so that the WinLibs runtime DLLs come first on PATH.

Tests. ctest -R '^(windows_|entry_stub|guest_zero_finalizer|cli_|linux_executable_exports|macos_executable_exports|executable_module)' -j 4, 3 runs:

Tree Result, each run
main 54 of 55
this PR 55 of 56: the same plus executable_module_imports

The one failure on both trees is windows_crash_thread_name (#15578). guest_zero_finalizer, entry_stub, windows_entry_stub_bounds, windows_import_modules, windows_dependency_diagnostics, windows_executable_exports, cli_args and cli_help pass in every run. executable_module_imports runs its native cases here (os.name == 'nt'): the resolved entry, a broken libs/SyntheticMain.dll stopping startup with Failed to load module:, the diagnostics line, the unnamed load failure and the provider copied into place.

Red check. With executableProviders[index] = false; in WindowsEntryStubBuilder.cpp, executable_module_imports fails 3 of 3, at assert PROBED in output.read_bytes() (line 91).

The resolved line. WindowsPePatcher and GuestModuleBuilder both print it, so I checked whether a Windows conversion prints it twice. It doesn't. Converting the test's consumer.prx fixture with --executable-module SyntheticMain prints Needed module SyntheticMain is resolved on the executable (--executable-module) once with --windows, once for Linux and once with --macos.

Non-blocking. A name that matches no needed library is ignored without a word. The same fixture converted with --executable-module SyntheticMian exits 0 with no resolved line and nothing on stderr, so SyntheticMain is then loaded as an unnamed library and fails at startup. A warning for a name that matches no needed library would make a typo show up at conversion time.

check_conventions.py --base main passes. No title was converted.

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5798920665 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/15245#pullrequestreview-5798920665). Originally posted by [Superseabas](https://github.com/Superseabas) on 2026-11-06T10:35:30Z. **Review:** APPROVED --- Windows run of the `--executable-module` head, `068fccf2bb`, the first on Windows since the change @oneandonlydean asked for. The native Windows cases of `executable_module_imports` pass, and nothing else in the Windows relinker and entry-stub tests changes. Head merged onto `main` `e64c194c43` (clean merge, local only). Windows 11 Home 10.0.26200, WinLibs GCC 16.2.0 (`x86_64-ucrt-posix-seh`, r3), Python 3.13, Release, `BUILD_TESTING=ON`, run from PowerShell so that the WinLibs runtime DLLs come first on `PATH`. **Tests.** `ctest -R '^(windows_|entry_stub|guest_zero_finalizer|cli_|linux_executable_exports|macos_executable_exports|executable_module)' -j 4`, 3 runs: | Tree | Result, each run | |---|---| | `main` | 54 of 55 | | this PR | 55 of 56: the same plus `executable_module_imports` | The one failure on both trees is `windows_crash_thread_name` (#15578). `guest_zero_finalizer`, `entry_stub`, `windows_entry_stub_bounds`, `windows_import_modules`, `windows_dependency_diagnostics`, `windows_executable_exports`, `cli_args` and `cli_help` pass in every run. `executable_module_imports` runs its native cases here (`os.name == 'nt'`): the resolved entry, a broken `libs/SyntheticMain.dll` stopping startup with `Failed to load module:`, the diagnostics line, the unnamed load failure and the provider copied into place. **Red check.** With `executableProviders[index] = false;` in `WindowsEntryStubBuilder.cpp`, `executable_module_imports` fails 3 of 3, at `assert PROBED in output.read_bytes()` (line 91). **The resolved line.** `WindowsPePatcher` and `GuestModuleBuilder` both print it, so I checked whether a Windows conversion prints it twice. It doesn't. Converting the test's `consumer.prx` fixture with `--executable-module SyntheticMain` prints `Needed module SyntheticMain is resolved on the executable (--executable-module)` once with `--windows`, once for Linux and once with `--macos`. **Non-blocking.** A name that matches no needed library is ignored without a word. The same fixture converted with `--executable-module SyntheticMian` exits 0 with no resolved line and nothing on stderr, so `SyntheticMain` is then loaded as an unnamed library and fails at startup. A warning for a name that matches no needed library would make a typo show up at conversion time. `check_conventions.py --base main` passes. No title was converted. AI-assisted: yes (Claude Code)
gabichuuuuu commented 2026-11-07 23:30:20 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by gabichuuuuu on 2026-11-07T23:30:20Z.

Review: COMMENTED


Read 8675703f06 against main.

The changed files match main except for this PR's lines, so this is the code that would merge. The .dll probe and the explicit option asked for earlier are both in, and unnamed libraries keep the old findGuest check in loadsHost, so titles that load today aren't affected.

A named library can be dropped without a word. On Linux and macOS, the "is resolved on the executable" line comes only from noteHostImport (GuestModuleBuilder.cpp:222-227), which runs for a referenced import. loadsHost (:383-386, used at :421, :431 and :554) still removes a named library from DT_NEEDED/LC_LOAD_DYLIB when nothing imports from it, and prints nothing; on Windows WindowsPePatcher.cpp:108-110 prints the line for every named library. The debt entry and USAGE say a line is printed for each library resolved this way. Printing it wherever loadsHost drops a name, and warning for a name that matches no needed library (the typo case raised in the last review, still ignored on all three targets), would make the option say what it did.

Not covered. As the description says, PPSA02195 hasn't been converted with the option, and on Linux and macOS only the dependency lists are checked.

Not run here; this is from reading the code.

AI-assisted: yes.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5815565503 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/15245#pullrequestreview-5815565503). Originally posted by [gabichuuuuu](https://github.com/gabichuuuuu) on 2026-11-07T23:30:20Z. **Review:** COMMENTED --- Read `8675703f06` against `main`. The changed files match `main` except for this PR's lines, so this is the code that would merge. The `.dll` probe and the explicit option asked for earlier are both in, and unnamed libraries keep the old `findGuest` check in `loadsHost`, so titles that load today aren't affected. **A named library can be dropped without a word.** On Linux and macOS, the "is resolved on the executable" line comes only from `noteHostImport` (`GuestModuleBuilder.cpp:222-227`), which runs for a referenced import. `loadsHost` (`:383-386`, used at `:421`, `:431` and `:554`) still removes a named library from `DT_NEEDED`/`LC_LOAD_DYLIB` when nothing imports from it, and prints nothing; on Windows `WindowsPePatcher.cpp:108-110` prints the line for every named library. The debt entry and USAGE say a line is printed for each library resolved this way. Printing it wherever `loadsHost` drops a name, and warning for a name that matches no needed library (the typo case raised in the last review, still ignored on all three targets), would make the option say what it did. **Not covered.** As the description says, PPSA02195 hasn't been converted with the option, and on Linux and macOS only the dependency lists are checked. Not run here; this is from reading the code. AI-assisted: yes.
gabichuuuuu commented 2026-11-08 02:03:35 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by gabichuuuuu on 2026-11-08T02:03:35Z.

Review: COMMENTED


Follow-up to my read-only review: this time I ran 8675703f06, merged onto main 676fb61acc (clean merge).

Setup: Windows 11, WinLibs GCC 15.2, Release, relinker-only.

  • 13/13 related tests pass, including the native Windows cases of executable_module_imports (the broken libs/SyntheticMain.dll case fails to load as it should): executable_module_imports, windows_executable_exports, linux_executable_exports, macos_executable_exports, cli_args, entry_stub, windows_entry_stub_bounds, windows_import_modules, windows_guest_export_aliases, guest_needed_modules, guest_module_identity, guest_module_directories, needed_libraries.

The two points from my last review, now reproduced. I used the test's own fixtures (importer(), plus the same consumer without its relocation table, so its import of SyntheticMain is not referenced):

Case Linux output Windows output
named, import referenced SyntheticMain dropped from DT_NEEDED; line printed probed; line printed
named, import not referenced SyntheticMain dropped from both DT_NEEDED lists; nothing printed probed; line printed
--executable-module SyntheticMainX (typo) converts; SyntheticMain still needed; no warning converts; not probed; no warning

So on Linux, and on macOS, which uses the same loadsHost path (not run), a named library that nothing references leaves the dependency lists without the line that the debt entry and USAGE promise. A misspelled name is ignored on every target, and the mistake only shows when the program fails to load the library. Printing the line wherever loadsHost drops a name, and warning when a name matches no needed library, would close both gaps.

These are diagnostics only: everything that loads today still loads the same way.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5816041290 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/15245#pullrequestreview-5816041290). Originally posted by [gabichuuuuu](https://github.com/gabichuuuuu) on 2026-11-08T02:03:35Z. **Review:** COMMENTED --- Follow-up to my read-only review: this time I ran `8675703f06`, merged onto `main` `676fb61acc` (clean merge). **Setup:** Windows 11, WinLibs GCC 15.2, Release, relinker-only. - 13/13 related tests pass, including the native Windows cases of `executable_module_imports` (the broken `libs/SyntheticMain.dll` case fails to load as it should): `executable_module_imports`, `windows_executable_exports`, `linux_executable_exports`, `macos_executable_exports`, `cli_args`, `entry_stub`, `windows_entry_stub_bounds`, `windows_import_modules`, `windows_guest_export_aliases`, `guest_needed_modules`, `guest_module_identity`, `guest_module_directories`, `needed_libraries`. **The two points from my last review, now reproduced.** I used the test's own fixtures (`importer()`, plus the same consumer without its relocation table, so its import of `SyntheticMain` is not referenced): | Case | Linux output | Windows output | |---|---|---| | named, import referenced | `SyntheticMain` dropped from `DT_NEEDED`; line printed | probed; line printed | | named, import not referenced | `SyntheticMain` dropped from both `DT_NEEDED` lists; **nothing printed** | probed; line printed | | `--executable-module SyntheticMainX` (typo) | converts; `SyntheticMain` still needed; **no warning** | converts; not probed; **no warning** | So on Linux, and on macOS, which uses the same `loadsHost` path (not run), a named library that nothing references leaves the dependency lists without the line that the debt entry and USAGE promise. A misspelled name is ignored on every target, and the mistake only shows when the program fails to load the library. Printing the line wherever `loadsHost` drops a name, and warning when a name matches no needed library, would close both gaps. These are diagnostics only: everything that loads today still loads the same way.
MarcZX10 commented 2026-11-20 21:22:48 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-20T21:22:48Z.

Review: APPROVED


Reviewed — looks good

Nothing blocks this change; I reviewed all changed files, and the inspected code supports the documented behavior.

What I ran

  • Read the complete review diff and all 18 changed files at head 8a5e0a362f1bc5cb2edc3113d72fbe7f7cc350ca.
  • No commands were run; the review interface is read-only.

Results

Check Result Note
Changed files read passed 18 of 18
Automated checks not run No shell access
Platform execution not run Native Windows and macOS behavior unconfirmed

Findings

Blocking

None.

Non-blocking

None.

Not verified

  • Automated build and test results were not independently verified. The PR description reports Linux x86-64 test results; Windows execution cases run only on Windows, and Linux/macOS outputs are checked for dependency lists rather than executed.
  • Trackmania conversion and physical-console behavior were not verified.
  • Read: core/relinker/CMakeLists.txt, core/relinker/cli/include/Cli.hpp, core/relinker/cli/src/CliArgs.cpp, core/relinker/cli/tests/CliArgsTests.cpp, core/relinker/elfpatcher/include/elfpatcher/windows/WindowsElfPatcher.hpp, core/relinker/elfpatcher/include/elfpatcher/windows/WindowsEntryStubBuilder.hpp, core/relinker/elfpatcher/include/elfpatcher/windows/WindowsExportBuilder.hpp, core/relinker/elfpatcher/src/windows/WindowsEntryStubBuilder.cpp, core/relinker/elfpatcher/src/windows/WindowsExportBuilder.cpp, core/relinker/elfpatcher/src/windows/WindowsPePatcher.cpp, core/relinker/main.cpp, core/relinker/relinker/include/relinker/guest/GuestImage.hpp, core/relinker/relinker/include/relinker/pipeline/Conversion.hpp, core/relinker/relinker/src/guest/GuestModuleBuilder.cpp, core/relinker/relinker/src/pipeline/Conversion.cpp, core/relinker/relinker/tests/test_executable_module_imports.py, docs/dev/debt/relinker.md, and docs/user/USAGE.md.
  • Excluded changed files: none.

To get this to a good state

Nothing is required. Optional: run the described tests on the pinned head and exercise the native Windows startup cases on Windows.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5999597095 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/15245#pullrequestreview-5999597095). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-20T21:22:48Z. **Review:** APPROVED --- # Reviewed — looks good Nothing blocks this change; I reviewed all changed files, and the inspected code supports the documented behavior. ## What I ran - Read the complete review diff and all 18 changed files at head `8a5e0a362f1bc5cb2edc3113d72fbe7f7cc350ca`. - No commands were run; the review interface is read-only. ## Results | Check | Result | Note | |---|---|---| | Changed files read | passed | 18 of 18 | | Automated checks | not run | No shell access | | Platform execution | not run | Native Windows and macOS behavior unconfirmed | ## Findings ### Blocking None. ### Non-blocking None. ## Not verified - Automated build and test results were not independently verified. The PR description reports Linux x86-64 test results; Windows execution cases run only on Windows, and Linux/macOS outputs are checked for dependency lists rather than executed. - Trackmania conversion and physical-console behavior were not verified. - Read: `core/relinker/CMakeLists.txt`, `core/relinker/cli/include/Cli.hpp`, `core/relinker/cli/src/CliArgs.cpp`, `core/relinker/cli/tests/CliArgsTests.cpp`, `core/relinker/elfpatcher/include/elfpatcher/windows/WindowsElfPatcher.hpp`, `core/relinker/elfpatcher/include/elfpatcher/windows/WindowsEntryStubBuilder.hpp`, `core/relinker/elfpatcher/include/elfpatcher/windows/WindowsExportBuilder.hpp`, `core/relinker/elfpatcher/src/windows/WindowsEntryStubBuilder.cpp`, `core/relinker/elfpatcher/src/windows/WindowsExportBuilder.cpp`, `core/relinker/elfpatcher/src/windows/WindowsPePatcher.cpp`, `core/relinker/main.cpp`, `core/relinker/relinker/include/relinker/guest/GuestImage.hpp`, `core/relinker/relinker/include/relinker/pipeline/Conversion.hpp`, `core/relinker/relinker/src/guest/GuestModuleBuilder.cpp`, `core/relinker/relinker/src/pipeline/Conversion.cpp`, `core/relinker/relinker/tests/test_executable_module_imports.py`, `docs/dev/debt/relinker.md`, and `docs/user/USAGE.md`. - Excluded changed files: none. ## To get this to a good state Nothing is required. Optional: run the described tests on the pinned head and exercise the native Windows startup cases on Windows.

Pull request closed

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!15245
No description provided.