fix(relinker): accept section-relative guest module relocations #5138

Merged
veosett merged 2 commits from upstream-pr/5138 into main 2026-10-19 05:16:19 +00:00
veosett commented 2026-10-13 12:37:59 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by veosett on 2026-10-13T12:37:59Z.


What

The OpenOrbis using_library sample (homebrew ID BREW00089) stops at Unsupported symbol attributes when converting its sce_module/libExample.prx: the module dynamic table contains a local STT_SECTION marker. The concrete reproduction is recorded below. The executable path already accepts this layout after #4203; the guest-module reader still rejects it. This is a follow-up to the format support discussed in #3093, not a claim that PS4 titles run.

Accept local section symbols and allow R_X86_64_RELATIVE to name one only when its value is zero. Normalize that relocation to symbol index zero before the ELF, PE and Mach-O writers consume it. Preserve main's support for defined function and object symbols whose value matches the addend. Invalid symbol indices, undefined or mismatching ordinary symbols and nonzero section-marker values still fail.

OpenOrbis create-fself inserts a zero-valued local section marker and increments every copied relocation's symbol index. FreeBSD rtld computes RELATIVE as the relocation base plus addend.

Tested

Refreshed onto upstream main fd423f9b2; both hosts built and tested the exact updated PR head 269a59e23 with ANYPS5_RELINKER_ONLY=ON, Release, BUILD_TESTING=ON and two parallel jobs:

  • Windows 11, WinLibs MinGW-w64 GCC 15.2.0 r7: 205/205 CTests pass in 349.88 seconds. guest_relative_section_symbols passes in 2.55 seconds.
  • Ubuntu 24.04 WSL2, GCC 13.3.0: 210/210 CTests pass in 62.50 seconds. guest_relative_section_symbols passes in 0.50 seconds.
  • Neither suite has skipped tests. The full relinker-only CTest configuration includes guest_none_relocations, guest_tls and guest_absolute_symbols alongside the new regression.
  • The refresh preserves main's defined-function and defined-object RELATIVE handling. The regression also rejects a mapped, nonzero-valued section marker even when its value matches the addend, preventing an overly broad merge of the two acceptance rules.
  • Synthetic SysV and SCE dynamic tables, section markers at indices 1 and 3, mixed no-op/canonical/section-symbol relocations, and init/fini arrays convert to ELF, PE and Mach-O. Invalid markers and out-of-bounds symbol indices fail without writing artifacts; source modules stay unchanged.
  • Native Windows and Linux loads call the exported function directly and through the relocated pointer, both returning 42. Mach-O is inspected only; no macOS host or commercial title was run locally.
  • tools/check_test_registration.py, tools/check_conventions.py --base origin/main, and git diff --check pass on both hosts. No full system-library build or title-startup claim is made.

Historical negative controls, before the earlier main refresh: the new regression fails against unmodified upstream d1fd9372b on both hosts with Unsupported symbol attributes; six existing-format controls (SysV/SCE, ELF/PE/Mach-O) produce byte-identical executable and module output versus that upstream revision. These controls were not rerun for this merge.

Real homebrew reproduction

Get-fix reported this Windows reproduction. The official sample README identifies BREW00089; its main.cpp loads /app0/sce_module/libExample.prx.

On Windows 11 / WinLibs GCC 15.2, converting the sample with relinker --windows --windows-gui reaches the module and fails on main 84b01f9cd and e442f4c2e:

FAIL: …\using_library\sce_module\libExample.prx: Unsupported symbol attributes:

With this PR at 5f5641732, the module passes symbol validation and reaches a separate syscall-scan failure at offset 0xd016e. #5994 addresses that scan reaching module data. With this PR, #5994, and #5990, #5991, #5992 and #5993 for executable startup, the reporter converted and started the sample and called the library export:

test string: Hi I'm from the library! You passed: 13371338 | rv = 0x00000000

This combined startup run is attributed to Get-fix; no additional homebrew execution was performed for this description update. The relocation change itself builds independently of those other startup fixes.

Independent retail-module conversion

savvaniss reports a leave-one-out conversion check for Hasbro Family Fun Pack (CUSA03312), using a cumulative relinker stack on Windows 11 / WinLibs GCC 15.2.0 r7. Both Linux and Windows output conversions complete with the stack. Without this PR (and with its dependent TLS follow-up omitted), conversion first stops in libSceFace.prx with Unsupported symbol attributes.

This is independent conversion evidence, not a local run, a standalone test of this PR or a claim that the title starts. The complete stack and the separate stops caused by its other members are documented in the linked comment.

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 (Codex)
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4843332501 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5138). Originally posted by [veosett](https://github.com/veosett) on 2026-10-13T12:37:59Z. --- ### What The OpenOrbis [using_library sample](https://github.com/OpenOrbis/OpenOrbis-PS4-Toolchain/tree/master/samples/using_library) (homebrew ID `BREW00089`) stops at `Unsupported symbol attributes` when converting its `sce_module/libExample.prx`: the module dynamic table contains a local `STT_SECTION` marker. The concrete reproduction is recorded below. The executable path already accepts this layout after #4203; the guest-module reader still rejects it. This is a follow-up to the format support discussed in #3093, not a claim that PS4 titles run. Accept local section symbols and allow `R_X86_64_RELATIVE` to name one only when its value is zero. Normalize that relocation to symbol index zero before the ELF, PE and Mach-O writers consume it. Preserve main's support for defined function and object symbols whose value matches the addend. Invalid symbol indices, undefined or mismatching ordinary symbols and nonzero section-marker values still fail. [OpenOrbis create-fself](https://github.com/OpenOrbis/create-fself/blob/f2da6229684ce320f673c06fceac9c218f621788/pkg/oelf/OELFGenDynlibData.go) inserts a zero-valued local section marker and increments every copied relocation's symbol index. [FreeBSD rtld](https://github.com/freebsd/freebsd-src/blob/main/libexec/rtld-elf/amd64/reloc.c) computes RELATIVE as the relocation base plus addend. ### 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. --> Refreshed onto upstream `main` `fd423f9b2`; both hosts built and tested the exact updated PR head `269a59e23` with `ANYPS5_RELINKER_ONLY=ON`, Release, `BUILD_TESTING=ON` and two parallel jobs: - Windows 11, WinLibs MinGW-w64 GCC 15.2.0 r7: 205/205 CTests pass in 349.88 seconds. `guest_relative_section_symbols` passes in 2.55 seconds. - Ubuntu 24.04 WSL2, GCC 13.3.0: 210/210 CTests pass in 62.50 seconds. `guest_relative_section_symbols` passes in 0.50 seconds. - Neither suite has skipped tests. The full relinker-only CTest configuration includes `guest_none_relocations`, `guest_tls` and `guest_absolute_symbols` alongside the new regression. - The refresh preserves main's defined-function and defined-object RELATIVE handling. The regression also rejects a mapped, nonzero-valued section marker even when its value matches the addend, preventing an overly broad merge of the two acceptance rules. - Synthetic SysV and SCE dynamic tables, section markers at indices 1 and 3, mixed no-op/canonical/section-symbol relocations, and init/fini arrays convert to ELF, PE and Mach-O. Invalid markers and out-of-bounds symbol indices fail without writing artifacts; source modules stay unchanged. - Native Windows and Linux loads call the exported function directly and through the relocated pointer, both returning 42. Mach-O is inspected only; no macOS host or commercial title was run locally. - `tools/check_test_registration.py`, `tools/check_conventions.py --base origin/main`, and `git diff --check` pass on both hosts. No full system-library build or title-startup claim is made. Historical negative controls, before the earlier main refresh: the new regression fails against unmodified upstream `d1fd9372b` on both hosts with `Unsupported symbol attributes`; six existing-format controls (SysV/SCE, ELF/PE/Mach-O) produce byte-identical executable and module output versus that upstream revision. These controls were not rerun for this merge. #### Real homebrew reproduction [Get-fix reported this Windows reproduction](https://github.com/boykopovar/AnyPS5/pull/5138#issuecomment-6175616722). The [official sample README](https://github.com/OpenOrbis/OpenOrbis-PS4-Toolchain/blob/master/samples/using_library/README.md) identifies `BREW00089`; its [main.cpp](https://github.com/OpenOrbis/OpenOrbis-PS4-Toolchain/blob/master/samples/using_library/using_library/main.cpp#L21) loads `/app0/sce_module/libExample.prx`. On Windows 11 / WinLibs GCC 15.2, converting the sample with `relinker --windows --windows-gui` reaches the module and fails on main `84b01f9cd` and `e442f4c2e`: ```text FAIL: …\using_library\sce_module\libExample.prx: Unsupported symbol attributes: ``` With this PR at `5f5641732`, the module passes symbol validation and reaches a separate syscall-scan failure at offset `0xd016e`. #5994 addresses that scan reaching module data. With this PR, #5994, and #5990, #5991, #5992 and #5993 for executable startup, the reporter converted and started the sample and called the library export: ```text test string: Hi I'm from the library! You passed: 13371338 | rv = 0x00000000 ``` This combined startup run is attributed to Get-fix; no additional homebrew execution was performed for this description update. The relocation change itself builds independently of those other startup fixes. #### Independent retail-module conversion [savvaniss reports a leave-one-out conversion check](https://github.com/boykopovar/AnyPS5/pull/5138#issuecomment-6255079081) for Hasbro Family Fun Pack (`CUSA03312`), using a cumulative relinker stack on Windows 11 / WinLibs GCC 15.2.0 r7. Both Linux and Windows output conversions complete with the stack. Without this PR (and with its dependent TLS follow-up omitted), conversion first stops in `libSceFace.prx` with `Unsupported symbol attributes`. This is independent conversion evidence, not a local run, a standalone test of this PR or a claim that the title starts. The complete stack and the separate stops caused by its other members are documented in the linked comment. ### 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: none <!-- #PR, or none --> - [x] Fixes: none <!-- issue it closes as Fixes #N, or none --> - [x] Unblocks: none <!-- title ID and Game bring-up discussion, e.g. PPSA01325 #3232, or none --> - [x] GPUs tested: n/a <!-- for AGC, shader recompiler or VideoOut changes: vendor, model, driver and OS of each GPU the GPU tests ran on; otherwise n/a --> - [x] AI-assisted: yes (Codex) <!-- yes / no -->
xXPBSXx commented 2026-10-13 15:35:35 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-13T15:35:35Z.


Windows test: head 5f5641732 merged onto current main 60fb61870, together with 9 other open pull requests in one build (the merges were conflict-free); a failure would have been bisected per PR. Windows 10, MinGW GCC (WinLibs), Ninja Release, -j2: full build 0 errors; ctest for the tests this change adds or touches: guest_relative_section_symbols passed; python tools/check_conventions.py --base upstream/main passed for the combined tree. I did not run the new tests against main without the change.

AI-assisted (Claude Code).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6149217911 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5138#issuecomment-6149217911). Originally posted by [xXPBSXx](https://github.com/xXPBSXx) on 2026-10-13T15:35:35Z. --- Windows test: head `5f5641732` merged onto current `main` `60fb61870`, together with 9 other open pull requests in one build (the merges were conflict-free); a failure would have been bisected per PR. Windows 10, MinGW GCC (WinLibs), Ninja Release, `-j2`: full build 0 errors; ctest for the tests this change adds or touches: guest_relative_section_symbols passed; `python tools/check_conventions.py --base upstream/main` passed for the combined tree. I did not run the new tests against `main` without the change. AI-assisted (Claude Code).
oneandonlydean commented 2026-10-14 03:05:29 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-14T03:05:29Z.


Which homebrew or sample ships an OpenOrbis module that stops at Unsupported symbol attributes on main? With its name and the log line this can go in, as #4203 did for the executable side; the synthetic test alone doesn't show a need.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6159957881 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5138#issuecomment-6159957881). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-14T03:05:29Z. --- Which homebrew or sample ships an OpenOrbis module that stops at `Unsupported symbol attributes` on main? With its name and the log line this can go in, as #4203 did for the executable side; the synthetic test alone doesn't show a need.
jotitadev commented 2026-10-14 15:46:22 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by jotitadev on 2026-10-14T15:46:22Z.


macOS data point, since the description inspects the Mach-O output only.

Apple M2 Max, macOS 27.2 (26B5091g), AppleClang, Ninja Release, relinker-only. Head 5f5641732 merged without conflicts into main 84b01f9cd.

  • arm64: ctest --parallel 8 --timeout 30 157/157 pass, including guest_relative_section_symbols.
  • x86_64 under Rosetta 2 (-DCMAKE_OSX_ARCHITECTURES=x86_64, x86_64 Python): guest_relative_section_symbols passes. 6 tests fail (pr_overlap_encoding, progress_history, stubgen_stdout_newlines, release_package, linux_fixed_base, guest_module_args), the same 6 that fail on unmodified main on this machine (five are Python 3.9 incompatibilities of the only x86_64 Python here; guest_module_args is the fixture #5362 fixes). conventions_function_bodies and check_skips timed out once under parallel load and passed when rerun alone.
  • The test run against a main relinker fails at the first conversion, as described.

Native Mach-O load under Rosetta 2: I ran a copy of test_guest_relative_section_symbols.py whose --load branch also covers system == "macos" on Darwin, with an x86_64 /usr/bin/python3. I put empty stand-in x86_64 libs/libc.prx and libs/libkernel.prx next to the output so dyld resolves the module's load commands. For SysV and SCE tables and section markers at index 1 and 3 (the four non-lifecycle cases), dyld loads module.prx.guest.prx, shared#guest returns 42, the relocated slot holds the function's own address, and a call through it returns 42. The lifecycle cases were not loaded, as on Linux and Windows.

Written with AI assistance (Claude Code). I ran the builds and tests above on my machine.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6172298205 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5138#issuecomment-6172298205). Originally posted by [jotitadev](https://github.com/jotitadev) on 2026-10-14T15:46:22Z. --- macOS data point, since the description inspects the Mach-O output only. Apple M2 Max, macOS 27.2 (26B5091g), AppleClang, Ninja Release, relinker-only. Head `5f5641732` merged without conflicts into `main` `84b01f9cd`. - arm64: `ctest --parallel 8 --timeout 30` 157/157 pass, including `guest_relative_section_symbols`. - x86_64 under Rosetta 2 (`-DCMAKE_OSX_ARCHITECTURES=x86_64`, x86_64 Python): `guest_relative_section_symbols` passes. 6 tests fail (`pr_overlap_encoding`, `progress_history`, `stubgen_stdout_newlines`, `release_package`, `linux_fixed_base`, `guest_module_args`), the same 6 that fail on unmodified `main` on this machine (five are Python 3.9 incompatibilities of the only x86_64 Python here; `guest_module_args` is the fixture #5362 fixes). `conventions_function_bodies` and `check_skips` timed out once under parallel load and passed when rerun alone. - The test run against a `main` relinker fails at the first conversion, as described. Native Mach-O load under Rosetta 2: I ran a copy of `test_guest_relative_section_symbols.py` whose `--load` branch also covers `system == "macos"` on Darwin, with an x86_64 `/usr/bin/python3`. I put empty stand-in x86_64 `libs/libc.prx` and `libs/libkernel.prx` next to the output so dyld resolves the module's load commands. For SysV and SCE tables and section markers at index 1 and 3 (the four non-lifecycle cases), dyld loads `module.prx.guest.prx`, `shared#guest` returns 42, the relocated slot holds the function's own address, and a call through it returns 42. The lifecycle cases were not loaded, as on Linux and Windows. Written with AI assistance (Claude Code). I ran the builds and tests above on my machine.
adriadam10 commented 2026-10-14 17:44:42 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-14T17:44:42Z.

Review: CHANGES_REQUESTED


The change itself checks out: the local STT_SECTION / zero-value RELATIVE handling matches FreeBSD rtld (relocbase + r_addend), build and the relinker ctest scope pass here, and the new test fails without the GuestImageReader.cpp change.

One thing is still open, the question @oneandonlydean asked above: please name the OpenOrbis module (sample or homebrew .prx) that stops at Unsupported symbol attributes on main, with the log line, as #4203 did for the executable side. The synthetic test alone doesn't show the need. Once that is in the PR body this is ready to merge.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5522154615 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5138#pullrequestreview-5522154615). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-14T17:44:42Z. **Review:** CHANGES_REQUESTED --- The change itself checks out: the local `STT_SECTION` / zero-value RELATIVE handling matches FreeBSD rtld (`relocbase + r_addend`), build and the relinker ctest scope pass here, and the new test fails without the `GuestImageReader.cpp` change. One thing is still open, the question @oneandonlydean asked above: please name the OpenOrbis module (sample or homebrew `.prx`) that stops at `Unsupported symbol attributes` on main, with the log line, as #4203 did for the executable side. The synthetic test alone doesn't show the need. Once that is in the PR body this is ready to merge.
Get-fix commented 2026-10-14 18:38:40 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Get-fix on 2026-10-14T18:38:40Z.


@oneandonlydean The OpenOrbis PS4 toolchain sample using_library does. Its module sce_module/libExample.prx is linked by the toolchain's create-fself, which adds the section symbol 1 that the module's R_X86_64_RELATIVE relocations name. On main (84b01f9cd, and again on e442f4c2e) the conversion stops at:

FAIL: …\using_library\sce_module\libExample.prx: Unsupported symbol attributes:

This was on Windows 11 with WinLibs GCC 15.2, running relinker --windows --windows-gui using_library-eboot.elf …. The executable itself converts; the module does not.

With this PR (head 5f5641732) merged, the module passes that check and the conversion stops one step later, in the module's syscall scan:

FAIL: Forbidden syscall instruction at code offset 0xd016e

That second stop is a separate relinker issue: module syscall scans run past the end of the module's code into its data. #5994 fixes it. With both, the program converts, starts on Windows and calls into the module:

Opened exampleLib: 536870912 | Jumping to 0x7ff804810020
test string: Hi I'm from the library! You passed: 13371338 | rv = 0x00000000

That run also uses #5990 to #5993, which the executable needs to start (overview in #3093).

AI-assisted: yes (Claude Code). I ran the conversions and the program myself on Windows 11.

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6175616722 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5138#issuecomment-6175616722). Originally posted by [Get-fix](https://github.com/Get-fix) on 2026-10-14T18:38:40Z. --- @oneandonlydean The OpenOrbis PS4 toolchain sample `using_library` does. Its module `sce_module/libExample.prx` is linked by the toolchain's `create-fself`, which adds the section symbol 1 that the module's `R_X86_64_RELATIVE` relocations name. On `main` (`84b01f9cd`, and again on `e442f4c2e`) the conversion stops at: ``` FAIL: …\using_library\sce_module\libExample.prx: Unsupported symbol attributes: ``` This was on Windows 11 with WinLibs GCC 15.2, running `relinker --windows --windows-gui using_library-eboot.elf …`. The executable itself converts; the module does not. With this PR (head `5f5641732`) merged, the module passes that check and the conversion stops one step later, in the module's syscall scan: ``` FAIL: Forbidden syscall instruction at code offset 0xd016e ``` That second stop is a separate relinker issue: module syscall scans run past the end of the module's code into its data. #5994 fixes it. With both, the program converts, starts on Windows and calls into the module: ``` Opened exampleLib: 536870912 | Jumping to 0x7ff804810020 test string: Hi I'm from the library! You passed: 13371338 | rv = 0x00000000 ``` That run also uses #5990 to #5993, which the executable needs to start (overview in #3093). AI-assisted: yes (Claude Code). I ran the conversions and the program myself on Windows 11. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
MarcZX10 commented 2026-10-15 11:56:39 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-15T11:56:39Z.


I found a separate PS4 relocation case in #3093: libc.prx has defined FUNC/OBJECT symbols on R_X86_64_RELATIVE entries where st_value equals the nonnegative addend. #5138 handles the zero-valued STT_SECTION marker case; it does not cover these entries. I have an independent local patch and SysV/SCE Linux/Windows/macOS regression coverage for the equality case. It touches the same RELATIVE validation block, so it would need integration with this PR. Would you prefer to extend #5138 with this follow-up, or should I open a dependent PR after yours? I have not copied or used this PR’s branch.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6191470152 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5138#issuecomment-6191470152). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-15T11:56:39Z. --- I found a separate PS4 relocation case in #3093: libc.prx has defined FUNC/OBJECT symbols on R_X86_64_RELATIVE entries where st_value equals the nonnegative addend. #5138 handles the zero-valued STT_SECTION marker case; it does not cover these entries. I have an independent local patch and SysV/SCE Linux/Windows/macOS regression coverage for the equality case. It touches the same RELATIVE validation block, so it would need integration with this PR. Would you prefer to extend #5138 with this follow-up, or should I open a dependent PR after yours? I have not copied or used this PR’s branch.
github-actions[bot] commented 2026-10-15 12:07:26 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-15T12:07:26Z.


Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.

Pull request Conflicting files (lines on main) Same exports Same new files
PR 6607 core/relinker/CMakeLists.txt L432

Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.

Pull request Shared files not compared
PR 2780 core/relinker/CMakeLists.txt
PR 5021 core/relinker/CMakeLists.txt
PR 6044 core/relinker/CMakeLists.txt
PR 6802 core/relinker/CMakeLists.txt
PR 6879 core/relinker/CMakeLists.txt
PR 7173 core/relinker/CMakeLists.txt
PR 7332 core/relinker/CMakeLists.txt
PR 7594 core/relinker/CMakeLists.txt
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6191664902 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5138#issuecomment-6191664902). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-15T12:07:26Z. --- <!-- pr-overlap --> Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in **Depends on**. | Pull request | Conflicting files (lines on `main`) | Same exports | Same new files | |---|---|---|---| | [PR 6607](https://www.github.com/boykopovar/AnyPS5/pull/6607) | `core/relinker/CMakeLists.txt` [L432](https://github.com/boykopovar/AnyPS5/blob/676d423968a1a8fcc79c6247020ce22090a8e0d4/core/relinker/CMakeLists.txt#L432) | | | Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap. | Pull request | Shared files not compared | |---|---| | [PR 2780](https://www.github.com/boykopovar/AnyPS5/pull/2780) | `core/relinker/CMakeLists.txt` | | [PR 5021](https://www.github.com/boykopovar/AnyPS5/pull/5021) | `core/relinker/CMakeLists.txt` | | [PR 6044](https://www.github.com/boykopovar/AnyPS5/pull/6044) | `core/relinker/CMakeLists.txt` | | [PR 6802](https://www.github.com/boykopovar/AnyPS5/pull/6802) | `core/relinker/CMakeLists.txt` | | [PR 6879](https://www.github.com/boykopovar/AnyPS5/pull/6879) | `core/relinker/CMakeLists.txt` | | [PR 7173](https://www.github.com/boykopovar/AnyPS5/pull/7173) | `core/relinker/CMakeLists.txt` | | [PR 7332](https://www.github.com/boykopovar/AnyPS5/pull/7332) | `core/relinker/CMakeLists.txt` | | [PR 7594](https://www.github.com/boykopovar/AnyPS5/pull/7594) | `core/relinker/CMakeLists.txt` |
SandstromPL commented 2026-10-16 04:49:15 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by SandstromPL on 2026-10-16T04:49:15Z.


@veosett Here is a retail-module data point for this PR, and a follow-up it exposes.

PS4 Until Dawn (CUSA02636) bundles Sony's libSceFios2.prx and libc.prx. Both have the same unnamed STT_SECTION at symbol index 1 (st_info 0x03, st_shndx 0, st_value 0). On d92a8da, with scratch fixes for the eboot's earlier stops, the conversion stops at:

libSceFios2.prx: Unsupported symbol attributes: 

SuperCatElvis ran these files on #3093 (stop 4 in https://github.com/boykopovar/AnyPS5/issues/3093#issuecomment-6190626823).

In these modules no RELATIVE relocation uses the index-1 marker. Only R_X86_64_DTPMOD64 with addend 0 does: 13 times in libc.prx and 3 times in libSceFios2.prx. With this PR applied, the next stop is:

libSceFios2.prx: Invalid guest TLS relocation

That is because the TLS branch (GuestImageReader.cpp:317 at 5f5641732) requires an STT_TLS symbol whenever the index is nonzero. A DTPMOD64 against the module's own local marker refers to the module's own TLS block, just as symbol 0 does. Rewriting those entries to symbol 0, as this PR does for RELATIVE, gets past this stop (stop 5 in the same comment).

@adriadam10's remaining request was a named module with its log line in the body, which it now has (using_library, BREW00089), so I'd keep this PR as it is rather than widen it. Unless you'd rather fold the DTPMOD64 case in, I'll open it as a follow-up that depends on #5138, the way #6357 does for the RELATIVE case. Does that work for you?

AI Assisted

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6208322399 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5138#issuecomment-6208322399). Originally posted by [SandstromPL](https://github.com/SandstromPL) on 2026-10-16T04:49:15Z. --- @veosett Here is a retail-module data point for this PR, and a follow-up it exposes. PS4 Until Dawn (CUSA02636) bundles Sony's `libSceFios2.prx` and `libc.prx`. Both have the same unnamed `STT_SECTION` at symbol index 1 (`st_info` 0x03, `st_shndx` 0, `st_value` 0). On `d92a8da`, with scratch fixes for the eboot's earlier stops, the conversion stops at: ``` libSceFios2.prx: Unsupported symbol attributes: ``` SuperCatElvis ran these files on #3093 (stop 4 in https://github.com/boykopovar/AnyPS5/issues/3093#issuecomment-6190626823). In these modules no RELATIVE relocation uses the index-1 marker. Only `R_X86_64_DTPMOD64` with addend 0 does: 13 times in `libc.prx` and 3 times in `libSceFios2.prx`. With this PR applied, the next stop is: ``` libSceFios2.prx: Invalid guest TLS relocation ``` That is because the TLS branch (`GuestImageReader.cpp:317` at `5f5641732`) requires an `STT_TLS` symbol whenever the index is nonzero. A DTPMOD64 against the module's own local marker refers to the module's own TLS block, just as symbol 0 does. Rewriting those entries to symbol 0, as this PR does for RELATIVE, gets past this stop (stop 5 in the same comment). @adriadam10's remaining request was a named module with its log line in the body, which it now has (`using_library`, BREW00089), so I'd keep this PR as it is rather than widen it. Unless you'd rather fold the DTPMOD64 case in, I'll open it as a follow-up that depends on #5138, the way #6357 does for the RELATIVE case. Does that work for you? AI Assisted
MarcZX10 commented 2026-10-16 04:51:03 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-16T04:51:03Z.


From my side, keeping the DTPMOD64 marker case in a separate follow-up that depends on #5138 is the clearest split. #6357 already tracks the distinct defined-symbol R_X86_64_RELATIVE case as a dependent PR; the TLS relocation has its own semantics and evidence in the Until Dawn modules. That keeps this PR focused on the section-symbol RELATIVE case while the follow-up can carry its own regression coverage. Maintainers can decide the final sequencing.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6208342022 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5138#issuecomment-6208342022). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-16T04:51:03Z. --- From my side, keeping the `DTPMOD64` marker case in a separate follow-up that depends on #5138 is the clearest split. #6357 already tracks the distinct defined-symbol `R_X86_64_RELATIVE` case as a dependent PR; the TLS relocation has its own semantics and evidence in the Until Dawn modules. That keeps this PR focused on the section-symbol RELATIVE case while the follow-up can carry its own regression coverage. Maintainers can decide the final sequencing.
MarcZX10 commented 2026-10-16 04:51:29 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-16T04:51:29Z.


For the review thread: the PR description now includes the requested real OpenOrbis using_library / BREW00089 module reproduction, the exact Unsupported symbol attributes log on main, and the follow-on stop after this fix. This appears to address the evidence request; the PR remains marked changes requested pending review.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6208346691 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5138#issuecomment-6208346691). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-16T04:51:29Z. --- For the review thread: the PR description now includes the requested real OpenOrbis `using_library` / BREW00089 module reproduction, the exact `Unsupported symbol attributes` log on main, and the follow-on stop after this fix. This appears to address the evidence request; the PR remains marked changes requested pending review.
savvaniss commented 2026-10-18 20:59:44 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by savvaniss on 2026-10-18T20:59:44Z.


Second-title data point: Hasbro Family Fun Pack (CUSA03312, my own dump) needs this PR, on Linux and Windows.

Relinker-only Release build, Windows 11 Pro 26300, WinLibs GCC 15.2.0 r7. Starting from main f3059421f, I merged, in this order: #7660, #6619 (a9fa0e8b0), #5138 (5f5641732), #6381 (6f8d9a09d), 3b158c1e4 from #6977, #6354 (81561867f), #6357 (32fe3aa8b), #6684 (ab9d21afc) and #6618 (bf06a8e5c). With that stack, the Linux and --windows conversions of the eboot and its 9 bundled modules complete. I then rebuilt the relinker once per member with only that member left out. Without this PR, both targets stop in libSceFace.prx:

FAIL: ...\sce_module\libSceFace.prx: Unsupported symbol attributes:

3b158c1e4 from #6977 was left out of this build too, because it applies only on top of this PR; libSceFace.prx converts before libSceFios2.prx, so this is the first stop either way.

The other members each stop at their own step, so every one of them is needed for this title; the whole table is on #6977.

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6255079081 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5138#issuecomment-6255079081). Originally posted by [savvaniss](https://github.com/savvaniss) on 2026-10-18T20:59:44Z. --- Second-title data point: Hasbro Family Fun Pack (CUSA03312, my own dump) needs this PR, on Linux and Windows. Relinker-only Release build, Windows 11 Pro 26300, WinLibs GCC 15.2.0 r7. Starting from `main` `f3059421f`, I merged, in this order: #7660, #6619 (`a9fa0e8b0`), #5138 (`5f5641732`), #6381 (`6f8d9a09d`), 3b158c1e4 from #6977, #6354 (`81561867f`), #6357 (`32fe3aa8b`), #6684 (`ab9d21afc`) and #6618 (`bf06a8e5c`). With that stack, the Linux and `--windows` conversions of the eboot and its 9 bundled modules complete. I then rebuilt the relinker once per member with only that member left out. Without this PR, both targets stop in `libSceFace.prx`: ``` FAIL: ...\sce_module\libSceFace.prx: Unsupported symbol attributes: ``` 3b158c1e4 from #6977 was left out of this build too, because it applies only on top of this PR; `libSceFace.prx` converts before `libSceFios2.prx`, so this is the first stop either way. The other members each stop at their own step, so every one of them is needed for this title; the whole table is on #6977. AI-assisted: yes (Claude Code)
MarcZX10 commented 2026-10-18 21:22:49 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-18T21:22:49Z.


Thanks for the detailed leave-one-out run. It isolates this PR as necessary for Hasbro Family Fun Pack (CUSA03312) in the cumulative Linux/Windows conversion stack. Without #5138, the leave-one-out run stops in libSceFace.prx with “Unsupported symbol attributes.” I tried to add the setup and result to the PR's Tested section, but GitHub denied the body edit with an admin-rights error; the full evidence remains here in your comment.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6255309360 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5138#issuecomment-6255309360). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-18T21:22:49Z. --- Thanks for the detailed leave-one-out run. It isolates this PR as necessary for Hasbro Family Fun Pack (CUSA03312) in the cumulative Linux/Windows conversion stack. Without #5138, the leave-one-out run stops in libSceFace.prx with “Unsupported symbol attributes.” I tried to add the setup and result to the PR's Tested section, but GitHub denied the body edit with an admin-rights error; the full evidence remains here in your comment.
SandstromPL commented 2026-10-19 04:11:50 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by SandstromPL on 2026-10-19T04:11:50Z.


@veosett the main merge (269a59e23) looks right to me: a section marker still takes the RELATIVE path with symbol 0, and a defined symbol takes #6357's path. Two things that follow from it:

  1. The 04:00 body edit sets Unblocks: none, so the bot dropped the unblocks title label. savvaniss's Hasbro Family Fun Pack bring-up (#7198) lists this PR in its stack, and the leave-one-out run now in the body shows the title needs it, so Unblocks: CUSA03312 #7198 would fit the template's title-plus-discussion form if you want the label back. Limbo's bring-up (#6978) lists it too, through #6977.

  2. @Get-fix the merge conflicts with 3b158c1e4 from #6977 (DTPMOD64 against the module's own section symbol). It removed const auto position = output.size(); and the if (relocation == 8) Io::WriteU64(...) line, because a RELATIVE entry with a symbol is now appended and skipped earlier. Keeping only this side compiles, but it leaves the symbol index in the TLS entry, and guest_own_tls_relocations fails (AssertionError: (False, 16)). With this resolution, all 211 relinker tests pass here, including guest_own_tls_relocations and guest_relative_section_symbols (relinker-only Release, Ubuntu 24.04, GCC 13.3; Linux only):

            const auto position = output.size();
            output.insert(output.end(), bytes.begin() + offset + index, bytes.begin() + offset + index + 24);
            if (ownTlsBlock) Io::WriteU64(output, position + 8, relocation);

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6259472015 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5138#issuecomment-6259472015). Originally posted by [SandstromPL](https://github.com/SandstromPL) on 2026-10-19T04:11:50Z. --- @veosett the `main` merge (269a59e23) looks right to me: a section marker still takes the RELATIVE path with symbol 0, and a defined symbol takes #6357's path. Two things that follow from it: 1. The 04:00 body edit sets `Unblocks: none`, so the bot dropped the `unblocks title` label. savvaniss's Hasbro Family Fun Pack bring-up (#7198) lists this PR in its stack, and the leave-one-out run now in the body shows the title needs it, so `Unblocks: CUSA03312 #7198` would fit the template's title-plus-discussion form if you want the label back. Limbo's bring-up (#6978) lists it too, through #6977. 2. @Get-fix the merge conflicts with 3b158c1e4 from #6977 (DTPMOD64 against the module's own section symbol). It removed `const auto position = output.size();` and the `if (relocation == 8) Io::WriteU64(...)` line, because a RELATIVE entry with a symbol is now appended and skipped earlier. Keeping only this side compiles, but it leaves the symbol index in the TLS entry, and `guest_own_tls_relocations` fails (`AssertionError: (False, 16)`). With this resolution, all 211 relinker tests pass here, including `guest_own_tls_relocations` and `guest_relative_section_symbols` (relinker-only Release, Ubuntu 24.04, GCC 13.3; Linux only): ```cpp const auto position = output.size(); output.insert(output.end(), bytes.begin() + offset + index, bytes.begin() + offset + index + 24); if (ownTlsBlock) Io::WriteU64(output, position + 8, relocation); ``` AI-assisted: yes (Claude Code)
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!5138
No description provided.