Relinker rejects PS4 executables: SCE dynamic tables and data in the code segment (two ready branches) + remaining PS4 work #3093

Open
opened 2026-10-10 22:00:12 +00:00 by Get-fix · 19 comments
Get-fix commented 2026-10-10 22:00:12 +00:00 (Migrated from github.com)
Contributor

Imported from boykopovar/AnyPS5. Originally posted by Get-fix on 2026-10-10T22:00:12Z.


In #159 the question of running PS4 games was answered as "theoretical; no one has tried it yet". I tried it on two PS4 executables:

  • Bloodborne (CUSA00900 v1.09), from my own disc dump; only measurements here, no game files;
  • the OpenOrbis graphics sample.

Current main rejects both in the relinker, before any library code runs. This issue covers two fixes that are ready as branches, and the remaining work for PS4 titles. The full write-up, with the answer to #159, is in #3094.

1. DT_SCE_* table values are offsets into PT_SCE_DYNLIBDATA

PS4 executables give the DT_SCE_* values (STRTAB, SYMTAB, RELA, JMPREL and the others) as offsets into the PT_SCE_DYNLIBDATA segment. The relinker reads them as file offsets:

  • Bloodborne: Dynamic string offset is outside DT_STRSZ (offset 0x4c207500)
  • OpenOrbis sample: Symbol table entry out of bounds (offset 0x744ee8c60)

Branch: fix/relinker-sce-dynamic-tables, commit Get-fix/AnyPS5@5dbf89a57e. When PT_SCE_DYNLIBDATA is present, the DT_SCE_* values are read relative to it, and a value past the end of the file is rejected.

The relinker has two other readers of these tables, the unused-filter=1 and unused-filter=2 readers. They still read them the old way; this is recorded in TechnicalDebt.

2. Read-only data after the code is decoded as code

The executable segment of a PS4 executable keeps read-only data after the code; Bloodborne has 37 MiB there. The syscall scan and the call-site resolution decode the whole segment and fail:

  • Unsupported 0F 79 opcode without SSE4A prefix (offset 0x2f6e3d9)

For executables with PT_SCE_DYNLIBDATA, both scans now stop at the end of the PLT that follows the last function of the unwind table. The PLT is found by searching forward for its first entry. The search can't stop next to the last function, because code without unwind entries can sit in between; the OpenOrbis sample has 680 bytes of start-up code there. If the executable has PLT relocations and no PLT is found, the relinker fails instead of guessing.

Branch: fix/relinker-scan-code-extent, commit Get-fix/AnyPS5@a21e8fe4c0.

Checks

Both branches are rebased on 262c0316 and merge with each other without conflicts.

  • ctest (relinker-only build):

    build result
    main 96/96
    branch 1 96/96
    branch 2 97/97 (adds sce_code_extent)
    both merged 97/97
  • New tests: each fails on main with the original error and passes with its fix.

  • Mutation checks: each change below makes a test fail.

    • Branch 1: ignoring the block offset; removing the overflow check.
    • Branch 2: restoring the original bug; trimming every executable; leaving the import stubs out of the code; searching for the PLT only next to the last function.
  • PS5 executables: ps5-doom, VLC and Jelly5 convert byte-identically with main, branch 1, branch 2 and both merged. The new code only runs when PT_SCE_DYNLIBDATA is present.

  • Repository checks: check_conventions.py --base origin/main and check_test_registration.py pass.

Where the executables stop (relinker only, --windows --windows-gui --skip-sce-module):

Bloodborne OpenOrbis sample
main Dynamic string offset is outside DT_STRSZ Symbol table entry out of bounds
branch 1 Unsupported 0F 79 opcode without SSE4A prefix RELATIVE relocation has a nonzero symbol index
both scans pass (3,522 references); Code analysis: overlapping instruction boundaries (offset 0x3457cf) same as branch 1

Remaining work for PS4 titles

These come from an experimental run in which the OpenOrbis sample started, opened a window and presented correct frames. That code is not submitted; details are in #3094.

Relinker

  • SCE dynamic tables (branch 1)
  • Code scans stop at the PLT (branch 2)
  • R_X86_64_RELATIVE with symbol index 1, a value-0 STT_SECTION symbol written by OpenOrbis create-fself
  • Load PT_SCE_RELRO and keep it writable while relocating
  • Keep code analysis inside the code extent and out of PT_INTERP. The CFG followed pointers into /libexec/ld-elf.so.1.
  • Inline jump tables (Bloodborne: overlapping instruction boundaries)

Loader

  • __error is imported from libkernel but exported by libc.prx. libc.prx is only added when libSceLibcInternal.prx is needed, and this sample doesn't need it.
  • PS4 titles ship sce_sys/param.sfo, not param.json

Libraries

  • sceVideoOutSetBufferAttribute and sceVideoOutRegisterBuffers, the PS4 names. They map onto the ...2 functions with pixel format ((f & 0xFFFF0000) << 32) | ((f & 0xFFFF) << 16).
  • sceVideoOutGetFlipStatus writes the 0x80-byte PS5 struct, but the PS4 struct is 0x40 bytes. The extra bytes overwrote the PS4 caller's saved rbp. This needs a way to tell PS4 callers apart.
  • Linear display buffers that are only 4 KiB aligned: the sample's second 1920x1080 buffer starts 8,294,400 bytes in.
  • _readv, _writev, _fcntl, _ioctl
  • Bloodborne's other absent imports: 91 online (Np), 6 SaveData, 3 Ajm

Graphics

  • libSceGnmDriver: 50 of Bloodborne's imports, and the PS4 GPU path behind it. This is the large one.

Side finding: APS5_DUMP_FRAMES writes nothing for linear display buffers, because VulkanDevice::PresentDisplayBuffer returns from the linear path before the dump code. This also affects PS5 titles.

AI-assisted: yes (Claude Code). I ran every result above locally; no PS4 hardware was used.

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5795655167 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/3093). Originally posted by [Get-fix](https://github.com/Get-fix) on 2026-10-10T22:00:12Z. --- In #159 the question of running PS4 games was answered as "theoretical; no one has tried it yet". I tried it on two PS4 executables: - Bloodborne (CUSA00900 v1.09), from my own disc dump; only measurements here, no game files; - the OpenOrbis `graphics` sample. Current `main` rejects both in the relinker, before any library code runs. This issue covers two fixes that are ready as branches, and the remaining work for PS4 titles. The full write-up, with the answer to #159, is in #3094. ### 1. DT_SCE_* table values are offsets into PT_SCE_DYNLIBDATA PS4 executables give the DT_SCE_* values (STRTAB, SYMTAB, RELA, JMPREL and the others) as offsets into the PT_SCE_DYNLIBDATA segment. The relinker reads them as file offsets: - Bloodborne: `Dynamic string offset is outside DT_STRSZ (offset 0x4c207500)` - OpenOrbis sample: `Symbol table entry out of bounds (offset 0x744ee8c60)` Branch: [`fix/relinker-sce-dynamic-tables`](https://github.com/Get-fix/AnyPS5/tree/fix/relinker-sce-dynamic-tables), commit Get-fix/AnyPS5@5dbf89a57e096f2891ae786f44c3f57935af2285. When PT_SCE_DYNLIBDATA is present, the DT_SCE_* values are read relative to it, and a value past the end of the file is rejected. The relinker has two other readers of these tables, the unused-filter=1 and unused-filter=2 readers. They still read them the old way; this is recorded in TechnicalDebt. ### 2. Read-only data after the code is decoded as code The executable segment of a PS4 executable keeps read-only data after the code; Bloodborne has 37 MiB there. The syscall scan and the call-site resolution decode the whole segment and fail: - `Unsupported 0F 79 opcode without SSE4A prefix (offset 0x2f6e3d9)` For executables with PT_SCE_DYNLIBDATA, both scans now stop at the end of the PLT that follows the last function of the unwind table. The PLT is found by searching forward for its first entry. The search can't stop next to the last function, because code without unwind entries can sit in between; the OpenOrbis sample has 680 bytes of start-up code there. If the executable has PLT relocations and no PLT is found, the relinker fails instead of guessing. Branch: [`fix/relinker-scan-code-extent`](https://github.com/Get-fix/AnyPS5/tree/fix/relinker-scan-code-extent), commit Get-fix/AnyPS5@a21e8fe4c0e6c03189d559e992c0f037c076700d. ### Checks Both branches are rebased on 262c0316 and merge with each other without conflicts. - **ctest (relinker-only build):** | build | result | |---|---| | `main` | 96/96 | | branch 1 | 96/96 | | branch 2 | 97/97 (adds `sce_code_extent`) | | both merged | 97/97 | - **New tests:** each fails on `main` with the original error and passes with its fix. - **Mutation checks:** each change below makes a test fail. - Branch 1: ignoring the block offset; removing the overflow check. - Branch 2: restoring the original bug; trimming every executable; leaving the import stubs out of the code; searching for the PLT only next to the last function. - **PS5 executables:** ps5-doom, VLC and Jelly5 convert byte-identically with `main`, branch 1, branch 2 and both merged. The new code only runs when PT_SCE_DYNLIBDATA is present. - **Repository checks:** `check_conventions.py --base origin/main` and `check_test_registration.py` pass. Where the executables stop (relinker only, `--windows --windows-gui --skip-sce-module`): | | Bloodborne | OpenOrbis sample | |---|---|---| | `main` | `Dynamic string offset is outside DT_STRSZ` | `Symbol table entry out of bounds` | | branch 1 | `Unsupported 0F 79 opcode without SSE4A prefix` | `RELATIVE relocation has a nonzero symbol index` | | both | scans pass (3,522 references); `Code analysis: overlapping instruction boundaries (offset 0x3457cf)` | same as branch 1 | ### Remaining work for PS4 titles These come from an experimental run in which the OpenOrbis sample started, opened a window and presented correct frames. That code is not submitted; details are in #3094. **Relinker** - [ ] SCE dynamic tables (branch 1) - [ ] Code scans stop at the PLT (branch 2) - [ ] R_X86_64_RELATIVE with symbol index 1, a value-0 STT_SECTION symbol written by OpenOrbis create-fself - [ ] Load PT_SCE_RELRO and keep it writable while relocating - [ ] Keep code analysis inside the code extent and out of PT_INTERP. The CFG followed pointers into `/libexec/ld-elf.so.1`. - [ ] Inline jump tables (Bloodborne: overlapping instruction boundaries) **Loader** - [ ] `__error` is imported from libkernel but exported by libc.prx. libc.prx is only added when libSceLibcInternal.prx is needed, and this sample doesn't need it. - [ ] PS4 titles ship `sce_sys/param.sfo`, not `param.json` **Libraries** - [ ] `sceVideoOutSetBufferAttribute` and `sceVideoOutRegisterBuffers`, the PS4 names. They map onto the `...2` functions with pixel format `((f & 0xFFFF0000) << 32) | ((f & 0xFFFF) << 16)`. - [ ] `sceVideoOutGetFlipStatus` writes the 0x80-byte PS5 struct, but the PS4 struct is 0x40 bytes. The extra bytes overwrote the PS4 caller's saved rbp. This needs a way to tell PS4 callers apart. - [ ] Linear display buffers that are only 4 KiB aligned: the sample's second 1920x1080 buffer starts 8,294,400 bytes in. - [ ] `_readv`, `_writev`, `_fcntl`, `_ioctl` - [ ] Bloodborne's other absent imports: 91 online (Np), 6 SaveData, 3 Ajm **Graphics** - [ ] `libSceGnmDriver`: 50 of Bloodborne's imports, and the PS4 GPU path behind it. This is the large one. Side finding: `APS5_DUMP_FRAMES` writes nothing for linear display buffers, because `VulkanDevice::PresentDisplayBuffer` returns from the linear path before the dump code. This also affects PS5 titles. AI-assisted: yes (Claude Code). I ran every result above locally; no PS4 hardware was used. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
adriadam10 commented 2026-10-11 07:12:33 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-11T07:12:33Z.


#3142 fixes the code-scan extent for PS4 executables (syscall/call-site scans stop at the PLT); the DT_SCE_* table offsets (#3141) and the remaining PS4 work are still open.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6106558826 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/3093#issuecomment-6106558826). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-11T07:12:33Z. --- #3142 fixes the code-scan extent for PS4 executables (syscall/call-site scans stop at the PLT); the DT_SCE_* table offsets (#3141) and the remaining PS4 work are still open.
saxopa commented 2026-10-12 01:13:57 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by saxopa on 2026-10-12T01:13:57Z.


#4203 covers "R_X86_64_RELATIVE with symbol index 1": the pipeline, code analysis and strict filter accept a zero-value STT_SECTION symbol (create-fself adds one to every symbol index). The OpenOrbis graphics sample then converts to Linux; Windows and macOS stop at PT_SCE_RELRO (PLTGOT at 0x130000).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6116008135 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/3093#issuecomment-6116008135). Originally posted by [saxopa](https://github.com/saxopa) on 2026-10-12T01:13:57Z. --- #4203 covers "R_X86_64_RELATIVE with symbol index 1": the pipeline, code analysis and strict filter accept a zero-value STT_SECTION symbol (create-fself adds one to every symbol index). The OpenOrbis graphics sample then converts to Linux; Windows and macOS stop at PT_SCE_RELRO (PLTGOT at 0x130000).
saxopa commented 2026-10-12 15:11:48 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by saxopa on 2026-10-12T15:11:48Z.


#4542 covers "Load PT_SCE_RELRO and keep it writable while relocating": a PT_SCE_RELRO that no PT_LOAD covers is loaded as a read-write PT_LOAD. The OpenOrbis graphics sample then stops on Windows and macOS at code analysis (overlapping instruction boundaries, offset 0xde39f), and on Linux at the program header slot limit.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6127065347 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/3093#issuecomment-6127065347). Originally posted by [saxopa](https://github.com/saxopa) on 2026-10-12T15:11:48Z. --- #4542 covers "Load PT_SCE_RELRO and keep it writable while relocating": a PT_SCE_RELRO that no PT_LOAD covers is loaded as a read-write PT_LOAD. The OpenOrbis graphics sample then stops on Windows and macOS at code analysis (overlapping instruction boundaries, offset 0xde39f), and on Linux at the program header slot limit.
Get-fix commented 2026-10-14 18:38:36 +00:00 (Migrated from github.com)
Author
Contributor

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


Update: the OpenOrbis PS4 samples start on Windows

Thanks to @saxopa (#4203, #4542), @SandstromPL (#5195), @MarcZX100 (#4930, and for carrying #3141 and #3142) and @veosett (#5138). With their work, current main converts all 15 OpenOrbis toolchain samples. Five more changes let them start. Each is a pull request with one commit on main e442f4c2e:

PR change
#5990 libc.prx is also loaded when only libkernel.prx is imported (__error lives in libc.prx)
#5991 PS4 sceVideoOutSetBufferAttribute and sceVideoOutRegisterBuffers; linear PS4 buffers may be 4 KiB aligned; a handle with PS4 buffers gets the PS4 flip status (64 bytes) and vblank status (32 bytes)
#5992 _readv, _writev, _fcntl, _fstat, __sys_socketex
#5993 sce_sys/param.sfo is read when param.json is absent (title, title ID, download data size, user parameters), and /data and /download0 are mounted for it
#5994 a module's syscall scan stops at the end of the module's code; /libexec/ld-elf.so.1 at the start of the text is skipped when no PT_INTERP names it (OpenOrbis modules)

Samples

Windows 11, WinLibs GCC 15.2. main e442f4c2e with the five PRs and #5138 merged. Each sample is unmodified with its own param.sfo, converted with --windows --windows-gui and run for 12 s.

sample result
graphics window OpenOrbis graphics sample | FPS: 2.02, draws the Mandelbrot set (on the CPU)
input window at 59.9 FPS, main: Initializing controller, draws its square
pngdec window at 59.9 FPS, draws its decoded logo.png
exceptions main: Testcase PASS
hello_world main: Hello world! Waiting 2 seconds!, main: Done.
using_library loads libExample.prx and calls it: test string: Hi I'm from the library! You passed: 13371338 | rv = 0x00000000
dialogs, audio-wav start and keep running; they print nothing to check
net_http stops at ioctl: request 0x00005413 on a file is not implemented, fd=1; with #5569 it runs to its own report of the offline HTTP backend's error (details in #5564)
font, keyboard, threading, system, SDL2 unresolved libSceFreeType imports (FT_Init_FreeType, FT_New_Face, FT_Set_Pixel_Sizes, FT_Get_Char_Index, FT_Load_Glyph, FT_Render_Glyph)
piglet 48 unresolved Piglet imports (OpenGL ES and EGL: eglInitialize, glShaderBinary, scePigletSetConfigurationVSH, …)
networking not run here: it listens on a TCP port

Why each change is needed

The same build with one change left out (measured on main 84b01f9cd):

left out stops
#5990 all 9 that start: FAIL: unresolved ELF import 9BcDykPmo1I (__error)
#5991 graphics, input, pngdec, exceptions: unresolved i6-sR91Wt-4 and w3BY+tAEiQY (sceVideoOutSetBufferAttribute, sceVideoOutRegisterBuffers)
#5992 all 9: unresolved YSHRBRLn2pI (_writev), and +WRlkKjZvag (_readv), t0fXUzq61Z4 (_fcntl) or A0O5kF5x4LQ (_fstat, in libExample.prx); __sys_socketex is imported by networking
#5993 graphics, input, pngdec: what(): param.json not found after main: Creating a scene
#5994 using_library, converting libExample.prx: FAIL: Forbidden syscall instruction at code offset 0xd016e
#5138 using_library: libExample.prx: Unsupported symbol attributes:

Checks

  • Tests:
    • Full ctest on e442f4c2e with the five PRs and #5138 merged: 1212/1212.
    • The 12 video_out_flip_* modes, which ctest skips under the offscreen driver, pass in a window, including the new ps4 mode.
    • Each PR alone on e442f4c2e: relinker-only ctest 164/164 (#5990) and 165/165 (#5994); the tests for its area 23/23 (#5991), 6/6 (#5992) and 9/9 (#5993).
  • Mutations: each change below makes a test fail:
    • #5990: 2 of 2
    • #5991: 12 of 12, including a PS4 flip from a 4 KiB-aligned buffer
    • #5992: 6 of 6, including _fcntl narrowing its argument to int
    • #5993: 10 of 10
    • #5994: 2 of 2
  • PS5 executables: ps5-doom, VLC and Jelly5 convert byte-identically with main and with each relinker PR.
  • Repository checks: check_conventions.py passes for each PR, title and description included.

Checklist

Relinker

  • SCE dynamic tables (#3141)
  • Code scans stop at the PLT (#3142)
  • R_X86_64_RELATIVE with symbol index 1 (#4203)
  • Load PT_SCE_RELRO (#4542)
  • Code analysis inside the code extent and out of PT_INTERP (#5195)
  • Module relocations against section symbols (#5138)
  • Module syscall scans and the loader path without PT_INTERP (#5994)
  • Inline jump tables (Bloodborne; not re-measured on current main)

Loader

  • libc.prx for libkernel-only imports (#5990)
  • param.sfo (#5993)

Libraries

  • PS4 VideoOut names, 4 KiB linear buffers, PS4 flip and vblank status (#5991)
  • _readv, _writev, _fcntl, _fstat, __sys_socketex (#5992; _ioctl was already in main)
  • Linux terminal ioctl 0x5413 (#5564, #5569)
  • libSceFreeType, 6 functions (5 samples). I am looking at this next.
  • Bloodborne's other absent imports; libSceGnmDriver

Side finding: linear display buffers in APS5_DUMP_FRAMES (#4930)

AI-assisted: yes (Claude Code). I ran every build, test and sample above locally on Windows 11; no PS4 hardware was used.

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6175615457 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/3093#issuecomment-6175615457). Originally posted by [Get-fix](https://github.com/Get-fix) on 2026-10-14T18:38:36Z. --- Update: the OpenOrbis PS4 samples start on Windows Thanks to @saxopa (#4203, #4542), @SandstromPL (#5195), @MarcZX100 (#4930, and for carrying #3141 and #3142) and @veosett (#5138). With their work, current `main` converts all 15 OpenOrbis toolchain samples. Five more changes let them start. Each is a pull request with one commit on `main` `e442f4c2e`: | PR | change | |---|---| | #5990 | libc.prx is also loaded when only libkernel.prx is imported (`__error` lives in libc.prx) | | #5991 | PS4 `sceVideoOutSetBufferAttribute` and `sceVideoOutRegisterBuffers`; linear PS4 buffers may be 4 KiB aligned; a handle with PS4 buffers gets the PS4 flip status (64 bytes) and vblank status (32 bytes) | | #5992 | `_readv`, `_writev`, `_fcntl`, `_fstat`, `__sys_socketex` | | #5993 | `sce_sys/param.sfo` is read when `param.json` is absent (title, title ID, download data size, user parameters), and `/data` and `/download0` are mounted for it | | #5994 | a module's syscall scan stops at the end of the module's code; `/libexec/ld-elf.so.1` at the start of the text is skipped when no PT_INTERP names it (OpenOrbis modules) | ### Samples Windows 11, WinLibs GCC 15.2. `main` `e442f4c2e` with the five PRs and #5138 merged. Each sample is unmodified with its own `param.sfo`, converted with `--windows --windows-gui` and run for 12 s. | sample | result | |---|---| | graphics | window `OpenOrbis graphics sample \| FPS: 2.02`, draws the Mandelbrot set (on the CPU) | | input | window at 59.9 FPS, `main: Initializing controller`, draws its square | | pngdec | window at 59.9 FPS, draws its decoded `logo.png` | | exceptions | `main: Testcase PASS` | | hello_world | `main: Hello world! Waiting 2 seconds!`, `main: Done.` | | using_library | loads `libExample.prx` and calls it: `test string: Hi I'm from the library! You passed: 13371338 \| rv = 0x00000000` | | dialogs, audio-wav | start and keep running; they print nothing to check | | net_http | stops at `ioctl: request 0x00005413 on a file is not implemented, fd=1`; with #5569 it runs to its own report of the offline HTTP backend's error (details in #5564) | | font, keyboard, threading, system, SDL2 | unresolved `libSceFreeType` imports (`FT_Init_FreeType`, `FT_New_Face`, `FT_Set_Pixel_Sizes`, `FT_Get_Char_Index`, `FT_Load_Glyph`, `FT_Render_Glyph`) | | piglet | 48 unresolved Piglet imports (OpenGL ES and EGL: `eglInitialize`, `glShaderBinary`, `scePigletSetConfigurationVSH`, …) | | networking | not run here: it listens on a TCP port | ### Why each change is needed The same build with one change left out (measured on `main` `84b01f9cd`): | left out | stops | |---|---| | #5990 | all 9 that start: `FAIL: unresolved ELF import 9BcDykPmo1I` (`__error`) | | #5991 | graphics, input, pngdec, exceptions: unresolved `i6-sR91Wt-4` and `w3BY+tAEiQY` (`sceVideoOutSetBufferAttribute`, `sceVideoOutRegisterBuffers`) | | #5992 | all 9: unresolved `YSHRBRLn2pI` (`_writev`), and `+WRlkKjZvag` (`_readv`), `t0fXUzq61Z4` (`_fcntl`) or `A0O5kF5x4LQ` (`_fstat`, in `libExample.prx`); `__sys_socketex` is imported by `networking` | | #5993 | graphics, input, pngdec: `what(): param.json not found` after `main: Creating a scene` | | #5994 | using_library, converting `libExample.prx`: `FAIL: Forbidden syscall instruction at code offset 0xd016e` | | #5138 | using_library: `libExample.prx: Unsupported symbol attributes:` | ### Checks - **Tests:** - Full ctest on `e442f4c2e` with the five PRs and #5138 merged: 1212/1212. - The 12 `video_out_flip_*` modes, which ctest skips under the offscreen driver, pass in a window, including the new `ps4` mode. - Each PR alone on `e442f4c2e`: relinker-only ctest 164/164 (#5990) and 165/165 (#5994); the tests for its area 23/23 (#5991), 6/6 (#5992) and 9/9 (#5993). - **Mutations:** each change below makes a test fail: - #5990: 2 of 2 - #5991: 12 of 12, including a PS4 flip from a 4 KiB-aligned buffer - #5992: 6 of 6, including `_fcntl` narrowing its argument to `int` - #5993: 10 of 10 - #5994: 2 of 2 - **PS5 executables:** ps5-doom, VLC and Jelly5 convert byte-identically with `main` and with each relinker PR. - **Repository checks:** `check_conventions.py` passes for each PR, title and description included. ### Checklist **Relinker** - [x] SCE dynamic tables (#3141) - [x] Code scans stop at the PLT (#3142) - [x] R_X86_64_RELATIVE with symbol index 1 (#4203) - [x] Load PT_SCE_RELRO (#4542) - [x] Code analysis inside the code extent and out of PT_INTERP (#5195) - [ ] Module relocations against section symbols (#5138) - [ ] Module syscall scans and the loader path without PT_INTERP (#5994) - [ ] Inline jump tables (Bloodborne; not re-measured on current `main`) **Loader** - [ ] libc.prx for libkernel-only imports (#5990) - [ ] `param.sfo` (#5993) **Libraries** - [ ] PS4 VideoOut names, 4 KiB linear buffers, PS4 flip and vblank status (#5991) - [ ] `_readv`, `_writev`, `_fcntl`, `_fstat`, `__sys_socketex` (#5992; `_ioctl` was already in `main`) - [ ] Linux terminal ioctl 0x5413 (#5564, #5569) - [ ] `libSceFreeType`, 6 functions (5 samples). I am looking at this next. - [ ] Bloodborne's other absent imports; `libSceGnmDriver` **Side finding:** linear display buffers in `APS5_DUMP_FRAMES` (#4930) AI-assisted: yes (Claude Code). I ran every build, test and sample above locally on Windows 11; no PS4 hardware was used. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
SuperCatElvis commented 2026-10-15 03:32:13 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by SuperCatElvis on 2026-10-15T03:32:13Z.


PS4 Until Dawn (eboot.elf plus bundled libc.prx and libSceFios2.prx), on a checkout that includes #3141 and #3142. Checked against the remaining-work list:

“inline jump tables causing overlapping instructions”: the same Code analysis: overlapping instruction boundaries error stops the --windows relink of the eboot at offsets 0x37d73f, 0x3833fb, 0x76fdbc and 0x180d805, and libSceFios2.prx at 0x3d1fe. The tables sit at the end of an unwind range or in the gap after it, a noreturn call falls through into one, lea targets point into them, and the data after the PLT (about 7.4 MiB of read-only data in the executable segment) is decoded as code. #3142 bounds the syscall and call-site scans at the PLT; the code collector (TLS/FS analysis) needs the same limit. A local change finds trailing relative jump tables in both the syscall scan and the code collector, and keeps them and the data after the PLT out of the control-flow pass. With it the eboot and both bundled modules relink without errors.

“R_X86_64_RELATIVE with symbol index 1”: create-fself output has an unnamed STT_SECTION symbol at index 1, which the guest reader rejects, and libc.prx has a RELATIVE relocation at slot 0xbc880 against a defined function symbol whose value equals the addend, which the code collector rejects with invalid relative relocation. Both are accepted locally.

The EXE then starts and stops at load on libSceDiscMap.prx, imported by the bundled libSceFios2.prx (NIDs ioKMruft1ek, lbQKqsERhtE); there is no libSceDiscMap in the tree. import_audit.py on the executable’s registry: 748 imports, 512 implemented, 6 stubs, 230 absent, led by libSceGnmDriver (57), libc (21), libSceNpWebApi (21), libSceRudp (14) and libSceNpUtility (12). The title has not been run past the loader.

AI-assisted: yes (Claude Code). I ran every build and relink above locally on Windows 11; I did not run the test suite, and no PS4 hardware was used.

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6183770513 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/3093#issuecomment-6183770513). Originally posted by [SuperCatElvis](https://github.com/SuperCatElvis) on 2026-10-15T03:32:13Z. --- PS4 Until Dawn (`eboot.elf` plus bundled `libc.prx` and `libSceFios2.prx`), on a checkout that includes [#3141](https://github.com/boykopovar/AnyPS5/pull/3141) and [#3142](https://github.com/boykopovar/AnyPS5/pull/3142). Checked against the remaining-work list: “inline jump tables causing overlapping instructions”: the same Code analysis: overlapping instruction boundaries error stops the --windows relink of the `eboot` at offsets 0x37d73f, 0x3833fb, 0x76fdbc and 0x180d805, and `libSceFios2.prx` at 0x3d1fe. The tables sit at the end of an unwind range or in the gap after it, a `noreturn` call falls through into one, `lea` targets point into them, and the data after the PLT (about 7.4 MiB of read-only data in the executable segment) is decoded as code. [#3142](https://github.com/boykopovar/AnyPS5/pull/3142) bounds the syscall and call-site scans at the PLT; the code collector (TLS/FS analysis) needs the same limit. A local change finds trailing relative jump tables in both the syscall scan and the code collector, and keeps them and the data after the PLT out of the control-flow pass. With it the eboot and both bundled modules relink without errors. “`R_X86_64_RELATIVE` with symbol index 1”: `create-fself` output has an unnamed `STT_SECTION` symbol at index 1, which the guest reader rejects, and `libc.prx` has a RELATIVE relocation at slot 0xbc880 against a defined function symbol whose value equals the addend, which the code collector rejects with `invalid relative relocation`. Both are accepted locally. The EXE then starts and stops at load on `libSceDiscMap.prx`, imported by the bundled `libSceFios2.prx` (NIDs ioKMruft1ek, lbQKqsERhtE); there is no `libSceDiscMap` in the tree. `import_audit.py` on the executable’s registry: 748 imports, 512 implemented, 6 stubs, 230 absent, led by `libSceGnmDriver` (57), `libc` (21), `libSceNpWebApi` (21), `libSceRudp` (14) and `libSceNpUtility` (12). The title has not been run past the loader. AI-assisted: yes (Claude Code). I ran every build and relink above locally on Windows 11; I did not run the test suite, and no PS4 hardware was used. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
SandstromPL commented 2026-10-15 05:57:19 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by SandstromPL on 2026-10-15T05:57:19Z.


@SuperCatElvis Thanks for the detailed run! Some pointers for current main (d92a8dad3):

  • Data after the PLT: #5195 (merged 2026-10-14) already limits the code collector to the code extent. With PT_SCE_DYNLIBDATA, it trims the executable segment to the range from the end of PT_INTERP to the end of the PLT (CodeInstructionCollector.cpp L96-L110). Your checkout mentions only #3141 and #3142. Could you re-run on current main and say which of 0x37d73f, 0x3833fb, 0x76fdbc, 0x180d805 and Fios2's 0x3d1fe still stop? The collector still has no jump-table handling, so the inline tables are probably still there.
  • STT_SECTION at index 1 in a module: #5138 (veosett) accepts it in the guest reader and is waiting for a real module. Your log line from libc.prx or libSceFios2.prx would help there.
  • RELATIVE against a defined symbol with value == addend (libc.prx slot 0xbc880): nothing on main or in an open PR accepts it yet. On main the first stop for it is the guest reader (RELATIVE relocation has a symbol), then the collector's invalid relative relocation.
  • libSceDiscMap: lbQKqsERhtE is sceDiscMapIsRequestOnHDD. ioKMruft1ek has no known name; it is shadPS4's Func_8A828CAEE7EDD5E9. shadPS4 (shadps4-emu/shadPS4#2686) and fpPS4 return SCE_DISC_MAP_ERROR_NO_BITMAP_INFO (0x81100004) from both and write nothing. Bloodborne's bundled Fios2 imports the same two.

Do you plan to open PRs from your local changes? If you'd rather not for the RELATIVE case or libSceDiscMap, I'd be glad to take those, with the relocation stacked on #5138. For that it would help to have:

  • the CUSA title ID;
  • the symbol entry at that index (st_info, st_shndx, st_value);
  • whether every RELATIVE with a nonzero symbol index in libc.prx, the eboot and libSceFios2.prx has value == addend.
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6185543187 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/3093#issuecomment-6185543187). Originally posted by [SandstromPL](https://github.com/SandstromPL) on 2026-10-15T05:57:19Z. --- @SuperCatElvis Thanks for the detailed run! Some pointers for current `main` (d92a8dad3): - **Data after the PLT:** #5195 (merged 2026-10-14) already limits the code collector to the code extent. With `PT_SCE_DYNLIBDATA`, it trims the executable segment to the range from the end of `PT_INTERP` to the end of the PLT ([CodeInstructionCollector.cpp L96-L110](https://github.com/boykopovar/AnyPS5/blob/a077a88df/core/relinker/relinker/src/analysis/CodeInstructionCollector.cpp#L96-L110)). Your checkout mentions only #3141 and #3142. Could you re-run on current `main` and say which of 0x37d73f, 0x3833fb, 0x76fdbc, 0x180d805 and Fios2's 0x3d1fe still stop? The collector still has no jump-table handling, so the inline tables are probably still there. - **`STT_SECTION` at index 1 in a module:** #5138 (veosett) accepts it in the guest reader and is waiting for a real module. Your log line from `libc.prx` or `libSceFios2.prx` would help there. - **RELATIVE against a defined symbol with value == addend (`libc.prx` slot 0xbc880):** nothing on `main` or in an open PR accepts it yet. On `main` the first stop for it is the guest reader (`RELATIVE relocation has a symbol`), then the collector's `invalid relative relocation`. - **`libSceDiscMap`:** `lbQKqsERhtE` is `sceDiscMapIsRequestOnHDD`. `ioKMruft1ek` has no known name; it is shadPS4's `Func_8A828CAEE7EDD5E9`. shadPS4 (shadps4-emu/shadPS4#2686) and fpPS4 return `SCE_DISC_MAP_ERROR_NO_BITMAP_INFO` (0x81100004) from both and write nothing. Bloodborne's bundled Fios2 imports the same two. Do you plan to open PRs from your local changes? If you'd rather not for the RELATIVE case or `libSceDiscMap`, I'd be glad to take those, with the relocation stacked on #5138. For that it would help to have: - the CUSA title ID; - the symbol entry at that index (`st_info`, `st_shndx`, `st_value`); - whether every RELATIVE with a nonzero symbol index in `libc.prx`, the eboot and `libSceFios2.prx` has value == addend.
SuperCatElvis commented 2026-10-15 11:08:28 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by SuperCatElvis on 2026-10-15T11:08:28Z.


@SandstromPL Thanks! Re-ran on d92a8da (relinker-only build on Linux, same files). Title is CUSA02636: eboot from the 01.03 patch, libc.prx and libSceFios2.prx from 01.00 (the patch ships no sce_module).

Stops on d92a8da, in order. Each one is the next stop after getting past the previous one in a scratch branch:

Eboot (--skip-sce-module)

  1. Cannot decode instruction: Instruction exceeds 15 bytes (offset 0x3ee2d0): the syscall scan decodes a relative jump table (99 fc ff ff) as code and lands mid-instruction, so none of the later offsets is reached.
  2. With jump tables masked in the syscall and call-site scans: Imported TLS relocation 16 is not supported for this target (offset 0x20e5ab8). The eboot imports one thread-local variable from libc, JHvEnCQLPQI#x#w (DTPMOD64 at 0x20e5ab8, DTPOFF64 at 0x20e5ac0). My earlier checkout passed these through as imports, which is why that EXE reached the loader.
  3. With those passed through: the collector stops at 0x37d73f. With jump-table handling in the collector (trim the unwind range at the table, no roots inside tables, the CFG does not enter them, including fall-through after a noreturn call) the eboot converts. 0x180d805 no longer appears, so #5195 covers it. 0x3833fb and 0x76fdbc are tables handled the same way; 0x76fdbc's table sits in the gap after the unwind range, before the next function. Without the CFG part the collector still stops at 0x37d73f.

Bundled modules
4. libSceFios2.prx: Unsupported symbol attributes: (empty name): the STT_SECTION at index 1 (st_info 0x03, st_shndx 0, st_value 0, unnamed; the same in libc.prx and the eboot).
5. With #5138 merged: libSceFios2.prx: Invalid guest TLS relocation. In these modules the index-1 symbol is referenced only by R_X86_64_DTPMOD64 with addend 0 (13 in libc.prx, 3 in libSceFios2.prx, e.g. slot 0x503b0), never by RELATIVE. Rewriting those to symbol 0, as #5138 does for RELATIVE, gets past it.
6. libc.prx: RELATIVE relocation has a symbol (slot 0xbc880).
7. libc.prx: Guest PREINIT_ARRAY has no module initializer.
8. Cyclic guest initialization dependency: libSceFios2.prx: these modules list their dependencies in 0x6100000f, not 0x61000045; falling back to it fixes the order.
9. PLT not found after the last unwind function (offset 0x3d033): both modules have their PLT at 0xc8, at the start of the text segment. In libSceFios2.prx the 0x115d1 bytes after 0x3d033 are a 0x7d-byte start routine with no unwind entry (0x3d040; calls through the PLT, walks an init list, no fs: accesses), then read-only data including the zlib CRC-32 table.
10. Without trimming: overlapping instruction boundaries (offset 0x3d1fe), inside that CRC-32 table. Trimming at the last unwind function (what my local build effectively did, so "data after the PLT" in my earlier comment was only true for the eboot) gets past it, but also drops the start routine from code analysis. Harmless here, not a general rule.
11. Code analysis: invalid relative relocation (offset 0xbc880). Accepting it there too, the full conversion completes.

RELATIVE with a nonzero symbol index: eboot 0 of 173,750; libSceFios2.prx 0 of 207; libc.prx 6 of 660, all with st_value == addend and st_other 0:

slot symbol st_info st_shndx st_value = addend st_size
0xbc880 1411 0x12 (GLOBAL FUNC) 3 0x2fa50 596
0xbc940 240 0x11 (GLOBAL OBJECT) 15 0xc1040 456
0xbc948 241 0x11 (GLOBAL OBJECT) 15 0xc0cb0 456
0xbc970 242 0x11 (GLOBAL OBJECT) 15 0xc0e78 456
0xbc978 1552 0x12 (GLOBAL FUNC) 3 0x5f5c0 239
0xbc998 707 0x21 (WEAK OBJECT) 21 0xd6ff8 8

Everything except the jump-table handling was a scratch change to reach the next stop, not a proposed fix. Happy for you to take the RELATIVE case and libSceDiscMap.
The jump-table handling was also necessary to get the conversion working. I haven't prepared a PR for it, but hopefully these findings help with addressing it upstream.

AI-assisted (Claude Code); every run above was done locally on these files.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6190626823 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/3093#issuecomment-6190626823). Originally posted by [SuperCatElvis](https://github.com/SuperCatElvis) on 2026-10-15T11:08:28Z. --- @SandstromPL Thanks! Re-ran on `d92a8da` (relinker-only build on Linux, same files). Title is CUSA02636: eboot from the 01.03 patch, `libc.prx` and `libSceFios2.prx` from 01.00 (the patch ships no `sce_module`). Stops on `d92a8da`, in order. Each one is the next stop after getting past the previous one in a scratch branch: **Eboot (`--skip-sce-module`)** 1. `Cannot decode instruction: Instruction exceeds 15 bytes (offset 0x3ee2d0)`: the syscall scan decodes a relative jump table (`99 fc ff ff`) as code and lands mid-instruction, so none of the later offsets is reached. 2. With jump tables masked in the syscall and call-site scans: `Imported TLS relocation 16 is not supported for this target (offset 0x20e5ab8)`. The eboot imports one thread-local variable from libc, `JHvEnCQLPQI#x#w` (DTPMOD64 at 0x20e5ab8, DTPOFF64 at 0x20e5ac0). My earlier checkout passed these through as imports, which is why that EXE reached the loader. 3. With those passed through: the collector stops at 0x37d73f. With jump-table handling in the collector (trim the unwind range at the table, no roots inside tables, the CFG does not enter them, including fall-through after a noreturn call) the eboot converts. 0x180d805 no longer appears, so #5195 covers it. 0x3833fb and 0x76fdbc are tables handled the same way; 0x76fdbc's table sits in the gap after the unwind range, before the next function. Without the CFG part the collector still stops at 0x37d73f. **Bundled modules** 4. `libSceFios2.prx: Unsupported symbol attributes: ` (empty name): the `STT_SECTION` at index 1 (`st_info` 0x03, `st_shndx` 0, `st_value` 0, unnamed; the same in `libc.prx` and the eboot). 5. With #5138 merged: `libSceFios2.prx: Invalid guest TLS relocation`. In these modules the index-1 symbol is referenced only by `R_X86_64_DTPMOD64` with addend 0 (13 in `libc.prx`, 3 in `libSceFios2.prx`, e.g. slot 0x503b0), never by RELATIVE. Rewriting those to symbol 0, as #5138 does for RELATIVE, gets past it. 6. `libc.prx: RELATIVE relocation has a symbol` (slot 0xbc880). 7. `libc.prx: Guest PREINIT_ARRAY has no module initializer`. 8. `Cyclic guest initialization dependency: libSceFios2.prx`: these modules list their dependencies in 0x6100000f, not 0x61000045; falling back to it fixes the order. 9. `PLT not found after the last unwind function (offset 0x3d033)`: both modules have their PLT at 0xc8, at the start of the text segment. In `libSceFios2.prx` the 0x115d1 bytes after 0x3d033 are a 0x7d-byte start routine with no unwind entry (0x3d040; calls through the PLT, walks an init list, no `fs:` accesses), then read-only data including the zlib CRC-32 table. 10. Without trimming: `overlapping instruction boundaries (offset 0x3d1fe)`, inside that CRC-32 table. Trimming at the last unwind function (what my local build effectively did, so "data after the PLT" in my earlier comment was only true for the eboot) gets past it, but also drops the start routine from code analysis. Harmless here, not a general rule. 11. `Code analysis: invalid relative relocation (offset 0xbc880)`. Accepting it there too, the full conversion completes. **RELATIVE with a nonzero symbol index:** eboot 0 of 173,750; `libSceFios2.prx` 0 of 207; `libc.prx` 6 of 660, all with `st_value` == addend and `st_other` 0: | slot | symbol | `st_info` | `st_shndx` | `st_value` = addend | `st_size` | |---|---|---|---|---|---| | 0xbc880 | 1411 | 0x12 (GLOBAL FUNC) | 3 | 0x2fa50 | 596 | | 0xbc940 | 240 | 0x11 (GLOBAL OBJECT) | 15 | 0xc1040 | 456 | | 0xbc948 | 241 | 0x11 (GLOBAL OBJECT) | 15 | 0xc0cb0 | 456 | | 0xbc970 | 242 | 0x11 (GLOBAL OBJECT) | 15 | 0xc0e78 | 456 | | 0xbc978 | 1552 | 0x12 (GLOBAL FUNC) | 3 | 0x5f5c0 | 239 | | 0xbc998 | 707 | 0x21 (WEAK OBJECT) | 21 | 0xd6ff8 | 8 | Everything except the jump-table handling was a scratch change to reach the next stop, not a proposed fix. Happy for you to take the RELATIVE case and `libSceDiscMap`. The jump-table handling was also necessary to get the conversion working. I haven't prepared a PR for it, but hopefully these findings help with addressing it upstream. AI-assisted (Claude Code); every run above was done locally on these files.
SandstromPL commented 2026-10-15 12:18:04 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by SandstromPL on 2026-10-15T12:18:04Z.


@SuperCatElvis Thanks, that's everything I needed! Here's the plan:

  • RELATIVE (stops 6 and 11): MarcZX100 already has a patch with tests for this exact case (st_value == addend) and has offered it on #5138, so I'll leave it with them rather than duplicate it. Your table of the six libc.prx relocations should help there.
  • Stops 9 and 10 come from my #5195. FindSceCodeEnd only looks for the PLT after the last unwind function. I'll make it also accept a PLT before the code and end the extent at the last unwind function, so the CRC-32 table stays out. The start routine at 0x3d040 stays unanalysed, and I'll note that in the debt file.
  • Stops 7 and 8: unless you'd rather do them, I'll take these too, crediting your findings.
    • Stop 8: read 0x6100000f in the guest reader.
    • Stop 7: on main a DT_INIT of 0 is read as "no initializer".
  • libSceDiscMap: I'll take it, but open it later. On main a PS4 module's imports aren't tied to a library (its needed modules are in 0x6100000f, not 0x61000045), so a missing libSceDiscMap.prx is skipped at load. It only becomes the stop once stop 8 is fixed.
  • Stop 5 (DTPMOD64 against the index-1 marker): I'll suggest it to @veosett on #5138, since it's the same marker.
  • Jump tables (stops 1 and 3): on main every other stop sits behind stop 1. Would you open a PR for your jump-table handling, or at least for the syscall and call-site scan part? Or share the diff, and I'll carry it with Co-authored-by.

Questions, if you still have the files at hand:

  1. Do libc.prx and libSceFios2.prx both have DT_INIT (tag 12) present with value 0?
  2. Does any unwind function start before the PLT at 0xc8, and does the PLT end before the next function?
  3. Was your stop-8 change only the guest-reader fallback to 0x6100000f?

When the branches are up, it would help if you could swap each one in for the matching scratch change, then confirm the stop is gone and the next one is as you listed.

AI Assisted

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6191857717 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/3093#issuecomment-6191857717). Originally posted by [SandstromPL](https://github.com/SandstromPL) on 2026-10-15T12:18:04Z. --- @SuperCatElvis Thanks, that's everything I needed! Here's the plan: - **RELATIVE (stops 6 and 11):** MarcZX100 already has a patch with tests for this exact case (`st_value == addend`) and has offered it on #5138, so I'll leave it with them rather than duplicate it. Your table of the six `libc.prx` relocations should help there. - **Stops 9 and 10 come from my #5195.** `FindSceCodeEnd` only looks for the PLT after the last unwind function. I'll make it also accept a PLT before the code and end the extent at the last unwind function, so the CRC-32 table stays out. The start routine at 0x3d040 stays unanalysed, and I'll note that in the debt file. - **Stops 7 and 8:** unless you'd rather do them, I'll take these too, crediting your findings. - Stop 8: read 0x6100000f in the guest reader. - Stop 7: on `main` a DT_INIT of 0 is read as "no initializer". - **`libSceDiscMap`:** I'll take it, but open it later. On `main` a PS4 module's imports aren't tied to a library (its needed modules are in 0x6100000f, not 0x61000045), so a missing `libSceDiscMap.prx` is skipped at load. It only becomes the stop once stop 8 is fixed. - **Stop 5** (DTPMOD64 against the index-1 marker): I'll suggest it to @veosett on #5138, since it's the same marker. - **Jump tables (stops 1 and 3):** on `main` every other stop sits behind stop 1. Would you open a PR for your jump-table handling, or at least for the syscall and call-site scan part? Or share the diff, and I'll carry it with `Co-authored-by`. Questions, if you still have the files at hand: 1. Do `libc.prx` and `libSceFios2.prx` both have DT_INIT (tag 12) present with value 0? 2. Does any unwind function start before the PLT at 0xc8, and does the PLT end before the next function? 3. Was your stop-8 change only the guest-reader fallback to 0x6100000f? When the branches are up, it would help if you could swap each one in for the matching scratch change, then confirm the stop is gone and the next one is as you listed. AI Assisted
Get-fix commented 2026-10-15 13:39:40 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by Get-fix on 2026-10-15T13:39:40Z.


Update: libSceFreeType is now #6376: the six FreeType functions the OpenOrbis samples import, on the bundled FreeType, in the PS4 LP64 layout. With it four more samples start and draw their text:

  • font: Hello, World! in two sizes.
  • keyboard: its pressed, modifier and locked key lists.
  • threading: its two threads taking turns.
  • SDL2: its score, game-over screen and debug overlay at 58 FPS.
  • system imports the same six functions and now starts as well: Logged into: Player (ID: 0x10000000).

A correction to my last update: the OpenOrbis toolchain has 16 sample programs, not 15 (library_example is the module using_library loads). With #5990 to #5994, #6376, #5138 and a change that answers the Linux TIOCGWINSZ with ENOTTY as #5569 does, 14 of the 16 start on Windows (main 92cdc7b62).

  • piglet still needs the 48 Piglet (OpenGL ES and EGL) functions.
  • networking was not run, since it listens on a TCP port.

Other changes since then:

  • #5993 is rebased.
  • #5994 now converts its test fixtures for Linux, Windows and macOS, after @jotitadev's macOS review.
  • Each of the five pull requests has a comment on the overlaps the bot lists, checked by merging each listed pull request with and without it.

AI-assisted: yes (Claude Code). I ran every build, test and sample above locally on Windows 11; no PS4 hardware was used.

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6193457139 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/3093#issuecomment-6193457139). Originally posted by [Get-fix](https://github.com/Get-fix) on 2026-10-15T13:39:40Z. --- Update: libSceFreeType is now #6376: the six FreeType functions the OpenOrbis samples import, on the bundled FreeType, in the PS4 LP64 layout. With it four more samples start and draw their text: - **font:** `Hello, World!` in two sizes. - **keyboard:** its pressed, modifier and locked key lists. - **threading:** its two threads taking turns. - **SDL2:** its score, game-over screen and debug overlay at 58 FPS. - **system** imports the same six functions and now starts as well: `Logged into: Player (ID: 0x10000000)`. A correction to my last update: the OpenOrbis toolchain has 16 sample programs, not 15 (`library_example` is the module `using_library` loads). With #5990 to #5994, #6376, #5138 and a change that answers the Linux `TIOCGWINSZ` with `ENOTTY` as #5569 does, 14 of the 16 start on Windows (`main` `92cdc7b62`). - **piglet** still needs the 48 Piglet (OpenGL ES and EGL) functions. - **networking** was not run, since it listens on a TCP port. Other changes since then: - #5993 is rebased. - #5994 now converts its test fixtures for Linux, Windows and macOS, after @jotitadev's macOS review. - Each of the five pull requests has a comment on the overlaps the bot lists, checked by merging each listed pull request with and without it. AI-assisted: yes (Claude Code). I ran every build, test and sample above locally on Windows 11; no PS4 hardware was used. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Get-fix commented 2026-10-15 18:37:16 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by Get-fix on 2026-10-15T18:37:16Z.


Update: the OpenOrbis piglet sample now runs too, with three new pull requests:

  • #6519 sceKernelLoadStartModule loads a system library given by its console path (/system/common/lib/<name>.sprx, or the sandboxed /<sandbox word>/common/lib/<name>.sprx), which is how the sample loads the two libraries below.
  • #6520 libScePrecompiledShaders: a table with AnyPS5's own GLSL source for the two shaders the sample looks up, since the console table holds Sony's compiled shaders.
  • #6521 libScePigletv2VSH: the 47 functions the sample imports (scePigletSetConfigurationVSH, 13 EGL 1.4 and 33 OpenGL ES 2.0 functions) on Vulkan. A correction to my last update: that is 47 functions, not 48; the 48th import is the shader table.

The sample loads both modules, prints GL_RENDERER: AnyPS5 Piglet on Vulkan and draws its rotating textured square at 59.96 FPS.

With these and #5990 to #5994, #6376, #5138 and a change that answers the Linux TIOCGWINSZ with ENOTTY as #5569 did, 15 of the 16 OpenOrbis sample programs start on Windows (main 03c4cb5e7). networking was not run, since it listens on a TCP port.

Other changes since then: #5990 and #5993 are rebased for their needs rebase labels; both conflicts were adjacent entries in the debt files.

AI-assisted: yes (Claude Code). I ran every build, test and sample above locally on Windows 11; no PS4 hardware was used.

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6199513813 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/3093#issuecomment-6199513813). Originally posted by [Get-fix](https://github.com/Get-fix) on 2026-10-15T18:37:16Z. --- Update: the OpenOrbis piglet sample now runs too, with three new pull requests: - #6519 `sceKernelLoadStartModule` loads a system library given by its console path (`/system/common/lib/<name>.sprx`, or the sandboxed `/<sandbox word>/common/lib/<name>.sprx`), which is how the sample loads the two libraries below. - #6520 `libScePrecompiledShaders`: a table with AnyPS5's own GLSL source for the two shaders the sample looks up, since the console table holds Sony's compiled shaders. - #6521 `libScePigletv2VSH`: the 47 functions the sample imports (`scePigletSetConfigurationVSH`, 13 EGL 1.4 and 33 OpenGL ES 2.0 functions) on Vulkan. A correction to my last update: that is 47 functions, not 48; the 48th import is the shader table. The sample loads both modules, prints `GL_RENDERER: AnyPS5 Piglet on Vulkan` and draws its rotating textured square at 59.96 FPS. With these and #5990 to #5994, #6376, #5138 and a change that answers the Linux `TIOCGWINSZ` with `ENOTTY` as #5569 did, 15 of the 16 OpenOrbis sample programs start on Windows (`main` `03c4cb5e7`). `networking` was not run, since it listens on a TCP port. Other changes since then: #5990 and #5993 are rebased for their **needs rebase** labels; both conflicts were adjacent entries in the debt files. AI-assisted: yes (Claude Code). I ran every build, test and sample above locally on Windows 11; no PS4 hardware was used. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Get-fix commented 2026-10-15 19:43:24 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by Get-fix on 2026-10-15T19:43:24Z.


Update: the first complete PS4 homebrew game plays on AnyPS5.

Fritz Dash is a one-button platformer made with the OpenOrbis toolchain. I built its PS4 eboot.bin from source with the toolchain's makefile, create-fself included. With my open PS4 pull requests and #6545, its menu, level select and first level run at 59.94 FPS on Windows, played with the keyboard's controller mapping.

#6545 is the one new fix it needed. create-fself drops a DT_INIT_ARRAYSZ of 0, so a plain-C program without constructors has DT_INIT_ARRAY and no size. The relinker refused that ("incomplete initializer array"); FreeBSD's rtld runs no initializers for it, and the relinker now does the same.

Two other homebrew programs I built the same way:

  • ClassiCube (PS4 port of the Minecraft Classic client) needed the same fix. It starts and draws its launcher, but no further on any platform: the file functions in its PS4 port are still stubs.
  • Skyline Sprint shows two more create-fself quirks, which I have not changed in AnyPS5 because I have no evidence it runs on a real PS4:
    • The file part of its data segment stops at the end of .data. The .data.<name> sections after it become zero-filled memory that only their relocations fill.
    • The data segment's PT_LOAD header appears twice, which the relinker rejects as overlapping.

AI-assisted: yes (Claude Code). I ran every build and game above locally on Windows 11; no PS4 hardware was used.

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6200802238 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/3093#issuecomment-6200802238). Originally posted by [Get-fix](https://github.com/Get-fix) on 2026-10-15T19:43:24Z. --- Update: the first complete PS4 homebrew game plays on AnyPS5. [Fritz Dash](https://github.com/BrianBoitano/fritz-dash) is a one-button platformer made with the OpenOrbis toolchain. I built its PS4 `eboot.bin` from source with the toolchain's makefile, `create-fself` included. With my open PS4 pull requests and #6545, its menu, level select and first level run at 59.94 FPS on Windows, played with the keyboard's controller mapping. #6545 is the one new fix it needed. `create-fself` drops a `DT_INIT_ARRAYSZ` of 0, so a plain-C program without constructors has `DT_INIT_ARRAY` and no size. The relinker refused that ("incomplete initializer array"); FreeBSD's rtld runs no initializers for it, and the relinker now does the same. Two other homebrew programs I built the same way: - **ClassiCube** (PS4 port of the Minecraft Classic client) needed the same fix. It starts and draws its launcher, but no further on any platform: the file functions in its PS4 port are still stubs. - **Skyline Sprint** shows two more `create-fself` quirks, which I have not changed in AnyPS5 because I have no evidence it runs on a real PS4: - The file part of its data segment stops at the end of `.data`. The `.data.<name>` sections after it become zero-filled memory that only their relocations fill. - The data segment's `PT_LOAD` header appears twice, which the relinker rejects as overlapping. AI-assisted: yes (Claude Code). I ran every build and game above locally on Windows 11; no PS4 hardware was used. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
SuperCatElvis commented 2026-10-15 21:08:18 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by SuperCatElvis on 2026-10-15T21:08:18Z.


@SandstromPL Thanks! Answers from the files:

  1. Yes. Both have DT_INIT (tag 12) present with value 0. Only libc.prx has a non-empty PREINIT_ARRAY: 0xc2040, size 8 (one entry), with INIT_ARRAY at 0xc2048 of size 0. In libSceFios2.prx, PREINIT_ARRAY and INIT_ARRAY both have size 0, so stop 7 only applies to libc.prx.
    Correction to my last comment: 0x3d040 in libSceFios2.prx is its DT_FINI, not a start routine. libc.prx has the same layout: DT_FINI 0x828a0 sits just after its last unwind function [0x82890, 0x82896), as the only routine without an unwind entry, followed by about 213 KiB of read-only data with no fs: loads. So ending the extent at the last unwind function leaves the DT_FINI routine of both modules unanalysed. The libc.prx one reads slot 0xbc880 (the RELATIVE-with-symbol pointer) and calls 0x2fa50 through it.
  2. No unwind function starts before the PLT, and the PLT ends before the first function:
    • libc.prx: PLT [0xc8, 0x5b8), 78 entries; first unwind function at 0x5c0.
    • libSceFios2.prx: PLT [0xc8, 0x5d8), 80 entries; first unwind function at 0x5e0.
      Both have 8 zero bytes between the PLT and that function (function ranges from ReadExceptionFunctions).
  3. Yes, only the guest-reader fallback: when there are no 0x61000045 entries, use the 0x6100000f ones. Nothing else changed for that stop.

Jump tables: diff attached, against 4eb91ea. Please carry it with Co-authored-by. It adds RelativeJumpTables.{hpp,cpp}: one detector for a trailing relative jump table in an unwind range, or in the gap up to the next function. The syscall and call-site scans run on a copy with those tables replaced by NOPs. The collector trims the unwind range at the table, adds no roots inside tables, and the CFG doesn't enter them, including fall-through after a noreturn call. It only runs with PT_SCE_DYNLIBDATA (pipeline) or an SCE dynamic base (collector). No new tests yet; the existing relinker suite is 182/182 on Linux. On 4eb91ea with the diff the eboot passes both scans and stops at stop 2; with my scratch TLS passthrough on top it converts. Without the CFG part the collector still stops at 0x37d73f.

The rest of the plan sounds good. I’ll leave it with you from here. Let me know if there’s anything more I can help with.

AI-assisted (Claude Code); every number above is from runs on these files.

ps4-jump-tables.diff.txt

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6202309687 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/3093#issuecomment-6202309687). Originally posted by [SuperCatElvis](https://github.com/SuperCatElvis) on 2026-10-15T21:08:18Z. --- @SandstromPL Thanks! Answers from the files: 1. Yes. Both have DT_INIT (tag 12) present with value 0. Only `libc.prx` has a non-empty PREINIT_ARRAY: 0xc2040, size 8 (one entry), with INIT_ARRAY at 0xc2048 of size 0. In `libSceFios2.prx`, PREINIT_ARRAY and INIT_ARRAY both have size 0, so stop 7 only applies to `libc.prx`. Correction to my last comment: 0x3d040 in `libSceFios2.prx` is its DT_FINI, not a start routine. `libc.prx` has the same layout: DT_FINI 0x828a0 sits just after its last unwind function [0x82890, 0x82896), as the only routine without an unwind entry, followed by about 213 KiB of read-only data with no `fs:` loads. So ending the extent at the last unwind function leaves the DT_FINI routine of both modules unanalysed. The `libc.prx` one reads slot 0xbc880 (the RELATIVE-with-symbol pointer) and calls 0x2fa50 through it. 2. No unwind function starts before the PLT, and the PLT ends before the first function: - `libc.prx`: PLT [0xc8, 0x5b8), 78 entries; first unwind function at 0x5c0. - `libSceFios2.prx`: PLT [0xc8, 0x5d8), 80 entries; first unwind function at 0x5e0. Both have 8 zero bytes between the PLT and that function (function ranges from `ReadExceptionFunctions`). 3. Yes, only the guest-reader fallback: when there are no 0x61000045 entries, use the 0x6100000f ones. Nothing else changed for that stop. Jump tables: diff attached, against `4eb91ea`. Please carry it with `Co-authored-by`. It adds `RelativeJumpTables.{hpp,cpp}`: one detector for a trailing relative jump table in an unwind range, or in the gap up to the next function. The syscall and call-site scans run on a copy with those tables replaced by NOPs. The collector trims the unwind range at the table, adds no roots inside tables, and the CFG doesn't enter them, including fall-through after a noreturn call. It only runs with PT_SCE_DYNLIBDATA (pipeline) or an SCE dynamic base (collector). No new tests yet; the existing relinker suite is 182/182 on Linux. On `4eb91ea` with the diff the eboot passes both scans and stops at stop 2; with my scratch TLS passthrough on top it converts. Without the CFG part the collector still stops at 0x37d73f. The rest of the plan sounds good. I’ll leave it with you from here. Let me know if there’s anything more I can help with. AI-assisted (Claude Code); every number above is from runs on these files. [ps4-jump-tables.diff.txt](https://github.com/user-attachments/files/33515569/ps4-jump-tables.diff.txt)
MarcZX10 commented 2026-10-15 21:50:46 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-15T21:50:46Z.


I evaluated the attached relative jump-table patch against current main and added a synthetic detector fixture locally. The relinker-only suite passes 182/182, including positive detection and rejection cases, but I do not have a reproducible eboot/fixture for the table in the reported PS4 case, and #6354 now addresses the earlier code-extent failure for the Until Dawn modules. I am holding off on opening a PR until the actual affected eboot (or a reduced binary fixture that reproduces the collector failure) is available, so table recognition can be validated against the reported case and nearby non-table code.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6203018338 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/3093#issuecomment-6203018338). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-15T21:50:46Z. --- I evaluated the attached relative jump-table patch against current main and added a synthetic detector fixture locally. The relinker-only suite passes 182/182, including positive detection and rejection cases, but I do not have a reproducible eboot/fixture for the table in the reported PS4 case, and #6354 now addresses the earlier code-extent failure for the Until Dawn modules. I am holding off on opening a PR until the actual affected eboot (or a reduced binary fixture that reproduces the collector failure) is available, so table recognition can be validated against the reported case and nearby non-table code.
MarcZX10 commented 2026-10-15 21:54:43 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-15T21:54:43Z.


Follow-up: I opened PR #6595, carrying the attached detector with your requested co-author credit and adding synthetic positive/negative coverage. The relinker-only CTest suite passes 182/182 locally, along with conventions. The PR description distinguishes that local validation from your reported eboot run; I did not run the eboot locally.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6203080440 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/3093#issuecomment-6203080440). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-15T21:54:43Z. --- Follow-up: I opened [PR #6595](https://github.com/boykopovar/AnyPS5/pull/6595), carrying the attached detector with your requested co-author credit and adding synthetic positive/negative coverage. The relinker-only CTest suite passes 182/182 locally, along with conventions. The PR description distinguishes that local validation from your reported eboot run; I did not run the eboot locally.
Get-fix commented 2026-10-15 23:13:41 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by Get-fix on 2026-10-15T23:13:41Z.


Update: the relinker now converts two retail PS4 titles, Bloodborne (CUSA00900) and Limbo (CUSA01664), both from dumps of my own copies.

  • #6618 is what both needed. Sony's toolchain places switch jump tables in the code segment after each function's last instruction, and code analysis, the syscall scan and the call-site resolver read them as instructions. That was Bloodborne's stop ("Instruction exceeds 15 bytes").
  • #6619 is a smaller fix Limbo also needed: one of its FDEs covers 0 bytes.

They convert but do not start yet. The relinker's import audit against today's libraries:

  • Bloodborne: 686 imports, 498 implemented, 8 throwing stubs, 180 absent.
  • Limbo: 547 imports, 321 implemented, 6 throwing stubs, 220 absent.
  • In both, every libSceGnmDriver function is absent, which is the PS4 graphics driver. Most of the rest are PSN libraries.

AI-assisted: yes (Claude Code). I ran every build and conversion above locally on Windows 11; no PS4 hardware was used, and no game files leave my machine.

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6204228313 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/3093#issuecomment-6204228313). Originally posted by [Get-fix](https://github.com/Get-fix) on 2026-10-15T23:13:41Z. --- Update: the relinker now converts two retail PS4 titles, Bloodborne (CUSA00900) and Limbo (CUSA01664), both from dumps of my own copies. - #6618 is what both needed. Sony's toolchain places switch jump tables in the code segment after each function's last instruction, and code analysis, the syscall scan and the call-site resolver read them as instructions. That was Bloodborne's stop ("Instruction exceeds 15 bytes"). - #6619 is a smaller fix Limbo also needed: one of its FDEs covers 0 bytes. They convert but do not start yet. The relinker's import audit against today's libraries: - Bloodborne: 686 imports, 498 implemented, 8 throwing stubs, 180 absent. - Limbo: 547 imports, 321 implemented, 6 throwing stubs, 220 absent. - In both, every `libSceGnmDriver` function is absent, which is the PS4 graphics driver. Most of the rest are PSN libraries. AI-assisted: yes (Claude Code). I ran every build and conversion above locally on Windows 11; no PS4 hardware was used, and no game files leave my machine. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
SandstromPL commented 2026-10-16 04:45:49 +00:00 (Migrated from github.com)
Author
Contributor

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


@SuperCatElvis Thanks, that answers all three!

Jump tables: MarcZX100 carried your diff as #6595, with your Co-authored-by, so I won't open another one. Get-fix's #6618 handles tables inside a function's unwind range (Bloodborne, and Limbo with #6619), but not tables in the gap after the range, like your 0x76fdbc. #6595 is now aimed at that gap. The two PRs conflict, and MarcZX100 offered to rebase #6595 on #6618 if #6618 lands first.

DT_FINI: thanks for the correction. #6354 ends the code extent at the last unwind function, so both DT_FINI routines stay out of the code analysis: 0x3d040 in libSceFios2.prx and 0x828a0 in libc.prx. I've fixed its description and debt line, which called 0x3d040 a start routine. Since the Windows and macOS outputs call DT_FINI at exit, an fs: access in it would run unchanged. You mentioned no fs: loads in the data after it; does the libc.prx routine itself have any fs: (0x64) prefix? Your PLT ranges also mean #6354's overlap check passes in both modules.

Stop 7: #6684 treats a present DT_INIT of 0 as the module initializer, so libc.prx gets past the preinit check. Its description asks two things: whether it gets past stop 7 with stop 8 next, and whether the code from 0 to the PLT at 0xc8 reads the preinit array at 0xc2040 or makes any fs: access.

Stop 8 is #6381, the same 0x6100000f fallback as yours, and libSceDiscMap is #6527.

Stops 5, 6 and 11: I've asked veosett on #5138 whether to fold the DTPMOD64 case (stop 5) into it, or let me open it as a follow-up. MarcZX100's #6357 accepts the RELATIVE case in both the guest reader and the code analysis (stops 6 and 11). It depends on #5138.

AI Assisted

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6208284300 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/3093#issuecomment-6208284300). Originally posted by [SandstromPL](https://github.com/SandstromPL) on 2026-10-16T04:45:49Z. --- @SuperCatElvis Thanks, that answers all three! **Jump tables:** MarcZX100 carried your diff as #6595, with your `Co-authored-by`, so I won't open another one. Get-fix's #6618 handles tables inside a function's unwind range (Bloodborne, and Limbo with #6619), but not tables in the gap after the range, like your 0x76fdbc. #6595 is now aimed at that gap. The two PRs conflict, and MarcZX100 offered to rebase #6595 on #6618 if #6618 lands first. **DT_FINI:** thanks for the correction. #6354 ends the code extent at the last unwind function, so both `DT_FINI` routines stay out of the code analysis: 0x3d040 in `libSceFios2.prx` and 0x828a0 in `libc.prx`. I've fixed its description and debt line, which called 0x3d040 a start routine. Since the Windows and macOS outputs call `DT_FINI` at exit, an `fs:` access in it would run unchanged. You mentioned no `fs:` loads in the data after it; does the `libc.prx` routine itself have any `fs:` (0x64) prefix? Your PLT ranges also mean #6354's overlap check passes in both modules. **Stop 7:** #6684 treats a present `DT_INIT` of 0 as the module initializer, so `libc.prx` gets past the preinit check. Its description asks two things: whether it gets past stop 7 with stop 8 next, and whether the code from 0 to the PLT at 0xc8 reads the preinit array at 0xc2040 or makes any `fs:` access. **Stop 8** is #6381, the same 0x6100000f fallback as yours, and **libSceDiscMap** is #6527. **Stops 5, 6 and 11:** I've asked veosett on #5138 whether to fold the DTPMOD64 case (stop 5) into it, or let me open it as a follow-up. MarcZX100's #6357 accepts the RELATIVE case in both the guest reader and the code analysis (stops 6 and 11). It depends on #5138. AI Assisted
Get-fix commented 2026-10-17 00:29:50 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by Get-fix on 2026-10-17T00:29:50Z.


Update: a retail PS4 game now plays. Limbo (CUSA01664) converts with its bundled modules, boots, and runs in game at 60 fps with sound on the AGC/Vulkan path PS5 titles use.

  • Pull request: #6977. PS4 GCN shaders run through the existing RDNA recompiler by re-encoding, with a real libSceGnmDriver, PS4 descriptors and tiling in the AGC driver, and a relinker fix for the bundled modules.
  • Bring-up thread: #6978

It stacks on the open relinker and library PRs listed there, from this thread's contributors.

AI-assisted: yes (Claude Code)

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6227350930 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/3093#issuecomment-6227350930). Originally posted by [Get-fix](https://github.com/Get-fix) on 2026-10-17T00:29:50Z. --- **Update: a retail PS4 game now plays.** Limbo (CUSA01664) converts with its bundled modules, boots, and runs in game at 60 fps with sound on the AGC/Vulkan path PS5 titles use. - Pull request: #6977. PS4 GCN shaders run through the existing RDNA recompiler by re-encoding, with a real `libSceGnmDriver`, PS4 descriptors and tiling in the AGC driver, and a relinker fix for the bundled modules. - Bring-up thread: #6978 It stacks on the open relinker and library PRs listed there, from this thread's contributors. AI-assisted: yes (Claude Code) 🤖 Generated with [Claude Code](https://claude.com/claude-code)
savvaniss commented 2026-10-17 15:32:34 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by savvaniss on 2026-10-17T15:32:34Z.


Hasbro Family Fun Pack (CUSA03312, base and its patch, from my own dump) now converts completely for Linux with open PRs and one new change. Windows still stops in the TLS rewrite, on bytes outside every unwind function. No game files are shared here; offsets and messages only.

Relinker built on Windows 11 Pro 26300 with WinLibs GCC 15.2.0 r7 from main 47a266cf9 plus the PRs below, added one at a time. Base and patch stop at the same steps; patch offsets are in parentheses.

# Stop on the stack so far Passed by
1 eboot: Strict filter: inconsistent FDE function range (offset 0xd42390) (0xd43fa8) #6619
2 eboot, instruction scan: Cannot decode instruction: Instruction exceeds 15 bytes (offset 0x783c70) (0x785360) new, below. #6618, #6595 and #6977 stop at the same offset
3 libSceFace.prx: Unsupported symbol attributes: (empty name, a section symbol) #5138
4 libSceFios2.prx: Invalid guest TLS relocation 3b158c1e4 from #6977
5 libc.prx: RELATIVE relocation has a symbol #6357. It conflicts with #5138 in GuestImageReader.cpp; accepting either form, a zero-value section symbol or a defined symbol whose value equals the addend, gets past it
6 libc.prx: Guest PREINIT_ARRAY has no module initializer #6684
7 Cyclic guest initialization dependency: libc.prx #6381
8 libSceFace.prx: PLT not found after the last unwind function (offset 0x27e21) #6354
9 eboot, --windows only: Unsupported Windows guest TLS instruction (bytes: 65 f0 5b) (offset 0x6d63c0) new, below

#6618 was also in the stack; I didn't check whether this title needs it. With everything above, the Linux conversion of base and patch completes: Converted modules: 9 (libc, libSceFios2, libSceFace, libSceFaceTracker, libSceHand, libSceHandTracker, libSceHeadTracker, libSceS3DConversion, libSceSmart), External prx references: 1345.

Stops 2 and 9: bytes between unwind functions that are not code from their first byte. Both offsets lie outside every FDE range, in gaps laid out as 16-byte slots. Each slot holds a function tail followed by NOP padding, but the tail often starts in the middle of an instruction.

  • Stop 2 is at VA 0x783c70 (file 0x787c70), in a 0x559-byte gap between the functions at 0x783950–0x783ab7 and 0x784010. The slot is a lone 48 followed by a 15-byte NOP (66 66 66 66 66 66 2e 0f 1f 84 00 00 00 00 00). Decoded from the 48, that is 16 bytes, so the decoder rejects it. A neighbouring slot is 4c followed by add $8,%rsp; pop %rbx; pop %rbp; ret.
  • Stop 9 is at file 0x6d63c0 (VA 0x6d23c0), in a 0xcb-byte gap after the function at 0x6d2070–0x6d2385. The slot starts 65 f0, followed by pop %rbx; pop %r14; pop %rbp; ret. Decoded from the slot start it reads as gs lock pop %rbx, which the Windows TLS rewrite rejects. Nearby slots start c0 c3 (the tail of xor %eax,%eax; ret) and 40 31 c0 c3.

As a local experiment only, InstructionScanner resumed at the next 16-byte boundary after a decode failure. The eboot needed it once (stop 2). The bundled modules needed it at 9 spots, the module VAs 0x968f, 0x9767, 0x3b897, 0x3b8d6, 0x3b915, 0x44e97, 0x44ed6, 0x44f15 and 0xc3e90; my log line doesn't name the module. That is what got the Linux conversion through. A general form might be: for SCE images, treat bytes outside unwind-function ranges and the PLT as padding. The scans would resume after a decode failure there, and the Windows TLS rewrite would ignore segment prefixes found there, while both stay strict inside FDE ranges. That is a design call for you. If it's welcome, I can open a PR; if it fits better into the PS4 stack, say so.

One more thing that made this slower to track down: the instruction scan reports virtual addresses (it is passed segmentVAddr, RelinkerPipeline.cpp:376), while WindowsTlsBuilder reports file offsets (header.Offset + offset). In this eboot the code segment is at file 0x4000 and VA 0, so the two differ by 0x4000.

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6235820957 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/3093#issuecomment-6235820957). Originally posted by [savvaniss](https://github.com/savvaniss) on 2026-10-17T15:32:34Z. --- Hasbro Family Fun Pack (CUSA03312, base and its patch, from my own dump) now converts completely for Linux with open PRs and one new change. Windows still stops in the TLS rewrite, on bytes outside every unwind function. No game files are shared here; offsets and messages only. Relinker built on Windows 11 Pro 26300 with WinLibs GCC 15.2.0 r7 from `main` `47a266cf9` plus the PRs below, added one at a time. Base and patch stop at the same steps; patch offsets are in parentheses. | # | Stop on the stack so far | Passed by | |---|---|---| | 1 | eboot: `Strict filter: inconsistent FDE function range (offset 0xd42390)` (`0xd43fa8`) | #6619 | | 2 | eboot, instruction scan: `Cannot decode instruction: Instruction exceeds 15 bytes (offset 0x783c70)` (`0x785360`) | new, below. #6618, #6595 and #6977 stop at the same offset | | 3 | `libSceFace.prx`: `Unsupported symbol attributes:` (empty name, a section symbol) | #5138 | | 4 | `libSceFios2.prx`: `Invalid guest TLS relocation` | 3b158c1e4 from #6977 | | 5 | `libc.prx`: `RELATIVE relocation has a symbol` | #6357. It conflicts with #5138 in `GuestImageReader.cpp`; accepting either form, a zero-value section symbol or a defined symbol whose value equals the addend, gets past it | | 6 | `libc.prx`: `Guest PREINIT_ARRAY has no module initializer` | #6684 | | 7 | `Cyclic guest initialization dependency: libc.prx` | #6381 | | 8 | `libSceFace.prx`: `PLT not found after the last unwind function (offset 0x27e21)` | #6354 | | 9 | eboot, `--windows` only: `Unsupported Windows guest TLS instruction (bytes: 65 f0 5b) (offset 0x6d63c0)` | new, below | #6618 was also in the stack; I didn't check whether this title needs it. With everything above, the Linux conversion of base and patch completes: `Converted modules: 9` (libc, libSceFios2, libSceFace, libSceFaceTracker, libSceHand, libSceHandTracker, libSceHeadTracker, libSceS3DConversion, libSceSmart), `External prx references: 1345`. **Stops 2 and 9: bytes between unwind functions that are not code from their first byte.** Both offsets lie outside every FDE range, in gaps laid out as 16-byte slots. Each slot holds a function tail followed by NOP padding, but the tail often starts in the middle of an instruction. - Stop 2 is at VA `0x783c70` (file `0x787c70`), in a 0x559-byte gap between the functions at `0x783950`–`0x783ab7` and `0x784010`. The slot is a lone `48` followed by a 15-byte NOP (`66 66 66 66 66 66 2e 0f 1f 84 00 00 00 00 00`). Decoded from the `48`, that is 16 bytes, so the decoder rejects it. A neighbouring slot is `4c` followed by `add $8,%rsp; pop %rbx; pop %rbp; ret`. - Stop 9 is at file `0x6d63c0` (VA `0x6d23c0`), in a 0xcb-byte gap after the function at `0x6d2070`–`0x6d2385`. The slot starts `65 f0`, followed by `pop %rbx; pop %r14; pop %rbp; ret`. Decoded from the slot start it reads as `gs lock pop %rbx`, which the Windows TLS rewrite rejects. Nearby slots start `c0 c3` (the tail of `xor %eax,%eax; ret`) and `40 31 c0 c3`. As a local experiment only, `InstructionScanner` resumed at the next 16-byte boundary after a decode failure. The eboot needed it once (stop 2). The bundled modules needed it at 9 spots, the module VAs `0x968f`, `0x9767`, `0x3b897`, `0x3b8d6`, `0x3b915`, `0x44e97`, `0x44ed6`, `0x44f15` and `0xc3e90`; my log line doesn't name the module. That is what got the Linux conversion through. A general form might be: for SCE images, treat bytes outside unwind-function ranges and the PLT as padding. The scans would resume after a decode failure there, and the Windows TLS rewrite would ignore segment prefixes found there, while both stay strict inside FDE ranges. That is a design call for you. If it's welcome, I can open a PR; if it fits better into the PS4 stack, say so. One more thing that made this slower to track down: the instruction scan reports virtual addresses (it is passed `segmentVAddr`, `RelinkerPipeline.cpp:376`), while `WindowsTlsBuilder` reports file offsets (`header.Offset + offset`). In this eboot the code segment is at file `0x4000` and VA `0`, so the two differ by `0x4000`. AI-assisted: yes (Claude Code)
MarcZX10 commented 2026-10-18 05:12:45 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-18T05:12:45Z.


Thanks for the additional Hasbro evidence. I checked the open #6618 scope: it recognizes relative jump-table data in or immediately after an unwind function, while the 0x783c70 decode failure you describe is in a gap outside every FDE range; the 0x6d63c0 Windows TLS rewrite case is separate again. Those could be useful focused follow-ups if the proposed scan behavior is tested with positive/negative synthetic fixtures that stay strict inside FDE ranges. If you still want to pursue them, please open the branch or PR in your own authorship; I can review the resulting diffs and coordinate the overlap with #6618.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6245985822 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/3093#issuecomment-6245985822). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-18T05:12:45Z. --- Thanks for the additional Hasbro evidence. I checked the open #6618 scope: it recognizes relative jump-table data in or immediately after an unwind function, while the `0x783c70` decode failure you describe is in a gap outside every FDE range; the `0x6d63c0` Windows TLS rewrite case is separate again. Those could be useful focused follow-ups if the proposed scan behavior is tested with positive/negative synthetic fixtures that stay strict inside FDE ranges. If you still want to pursue them, please open the branch or PR in your own authorship; I can review the resulting diffs and coordinate the overlap with #6618.
Sign in to join this conversation.
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#3093
No description provided.