Relinker silently skips fSELF-wrapped bundled modules, so a title's own sce_module never gets converted #2599

Closed
opened 2026-10-10 08:17:02 +00:00 by StarMrGamer · 1 comment
StarMrGamer commented 2026-10-10 08:17:02 +00:00 (Migrated from github.com)
Contributor

Imported from boykopovar/AnyPS5. Originally posted by StarMrGamer on 2026-10-10T08:17:02Z.


What

When a bundled module in sce_module/ is wrapped in fSELF (SELF container, magic 54 14 f5 ee), the relinker silently ignores it: no error, no warning, no app0/sce_module output. The module is simply not part of the runtime layout.

This is inconsistent with the executable itself: an fSELF eboot.bin fails loudly with FAIL: The input is a SELF container, not an ELF. A module in the same wrapper is dropped without a word.

Evidence

Catalog title PPSA17641 (ProsperoHomebrew 01.001.000-ish; record in https://github.com/blackbearreloaded/ps5-homebrew-catalog, artifact sha256-checked):

  1. Input layout is eboot.elf beside sce_module/libc.prx, where libc.prx starts with 54 14 f5 ee 00 01 01 12.
  2. relinker eboot.elf out/app.elf prints sce_module/sce_modules/prx processing: enabled, completes with exit 0, and produces no app0/sce_module at all. Nothing mentions the module.
  3. Unwrap the same libc.prx from its fSELF wrapper (same container format as the eboot one: 32-byte header, entry table, ELF header block, scattered segments; the module variant only differs in magic). Re-run the same relink.
  4. Now the relinker converts it: app0/sce_module/libc.prx.guest.prx is produced.

Where it happens: GuestModuleBuilder::Build, core/relinker/relinker/src/guest/GuestModuleBuilder.cpp around line 84 — the isElf filter decides per file, and a non-ELF file is skipped rather than rejected.

Why it matters

ps5-payload-dev SDK homebrew ships fSELF-wrapped modules in sce_module/ routinely (every catalog title I unwrapped had one, typically the SDK libc.prx). For those titles the relinked executable runs without its own modules in the layout, and anything the module provides is missing at runtime. Per the project rules, unsupported inputs should fail clearly instead of being dropped.

Possible directions

  • Unwrap fSELF modules the same way the eboot wrapper is expected to be handled, or
  • Fail the relink with a clear message naming the module, like the executable case does.

I have no preference; the current silence is the problem.

Tested

Linux, main 256b8ed4. Reproduced with PPSA17641 as above; the before/after behaviour differs only by the module's wrapper. Every catalog homebrew sce_module I checked is fSELF-wrapped.

Written with AI assistance.

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5789506999 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/2599). Originally posted by [StarMrGamer](https://github.com/StarMrGamer) on 2026-10-10T08:17:02Z. --- ### What When a bundled module in `sce_module/` is wrapped in fSELF (SELF container, magic `54 14 f5 ee`), the relinker silently ignores it: no error, no warning, no `app0/sce_module` output. The module is simply not part of the runtime layout. This is inconsistent with the executable itself: an fSELF `eboot.bin` fails loudly with `FAIL: The input is a SELF container, not an ELF`. A module in the same wrapper is dropped without a word. ### Evidence Catalog title PPSA17641 (ProsperoHomebrew 01.001.000-ish; record in https://github.com/blackbearreloaded/ps5-homebrew-catalog, artifact sha256-checked): 1. Input layout is `eboot.elf` beside `sce_module/libc.prx`, where `libc.prx` starts with `54 14 f5 ee 00 01 01 12`. 2. `relinker eboot.elf out/app.elf` prints `sce_module/sce_modules/prx processing: enabled`, completes with exit 0, and produces no `app0/sce_module` at all. Nothing mentions the module. 3. Unwrap the same `libc.prx` from its fSELF wrapper (same container format as the eboot one: 32-byte header, entry table, ELF header block, scattered segments; the module variant only differs in magic). Re-run the same relink. 4. Now the relinker converts it: `app0/sce_module/libc.prx.guest.prx` is produced. Where it happens: `GuestModuleBuilder::Build`, `core/relinker/relinker/src/guest/GuestModuleBuilder.cpp` around line 84 — the `isElf` filter decides per file, and a non-ELF file is skipped rather than rejected. ### Why it matters ps5-payload-dev SDK homebrew ships fSELF-wrapped modules in `sce_module/` routinely (every catalog title I unwrapped had one, typically the SDK `libc.prx`). For those titles the relinked executable runs without its own modules in the layout, and anything the module provides is missing at runtime. Per the project rules, unsupported inputs should fail clearly instead of being dropped. ### Possible directions - Unwrap fSELF modules the same way the eboot wrapper is expected to be handled, or - Fail the relink with a clear message naming the module, like the executable case does. I have no preference; the current silence is the problem. ### Tested Linux, main 256b8ed4. Reproduced with PPSA17641 as above; the before/after behaviour differs only by the module's wrapper. Every catalog homebrew `sce_module` I checked is fSELF-wrapped. Written with AI assistance.
elsi06 commented 2026-10-10 08:28:52 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by elsi06 on 2026-10-10T08:28:52Z.


Fix: commit bc444a67 on branch fix/relinker-self-guest-modules of https://github.com/elsi06/AnyPS5, based on main f6af6d11. The PR (#2605) was closed automatically by the intake rule.

It takes the second direction from the issue: the guest module scan in GuestModuleBuilder::Build throws Guest module is a SELF container, not an ELF: <path> for a file starting with 4f 15 3d 1d or 54 14 f5 ee, as ElfReader already does for a SELF executable (#184, #1317). This also applies in the recursive search for needed modules. Other non-ELF files are still skipped. No unwrapping, in line with #28 being closed. docs/user/USAGE.md gets one sentence saying such a module is an error.

Tested on macOS (Apple Silicon, AppleClang), relinker-only build:

  • guest_module_directories gets SELF cases for both magics, for Linux and Windows output: exit code 2, the module path in the message, no executable and no app0/; with --exclude-sce-module libc.prx the relink succeeds and converts only the other module.
  • The new cases fail with main's GuestModuleBuilder.cpp and pass with the change.
  • All 89 relinker tests and tools/check_conventions.py --base origin/main pass.

Not tested with PPSA17641 or on Linux/Windows hosts.

Written with AI assistance.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6095682847 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/2599#issuecomment-6095682847). Originally posted by [elsi06](https://github.com/elsi06) on 2026-10-10T08:28:52Z. --- Fix: commit [`bc444a67`](https://github.com/elsi06/AnyPS5/commit/bc444a675d4f695c5bd8dc0f7b4eb25930d23993) on branch [`fix/relinker-self-guest-modules`](https://github.com/elsi06/AnyPS5/tree/fix/relinker-self-guest-modules) of https://github.com/elsi06/AnyPS5, based on `main` f6af6d11. The PR (#2605) was closed automatically by the intake rule. It takes the second direction from the issue: the guest module scan in `GuestModuleBuilder::Build` throws `Guest module is a SELF container, not an ELF: <path>` for a file starting with `4f 15 3d 1d` or `54 14 f5 ee`, as `ElfReader` already does for a SELF executable (#184, #1317). This also applies in the recursive search for needed modules. Other non-ELF files are still skipped. No unwrapping, in line with #28 being closed. `docs/user/USAGE.md` gets one sentence saying such a module is an error. Tested on macOS (Apple Silicon, AppleClang), relinker-only build: - `guest_module_directories` gets SELF cases for both magics, for Linux and Windows output: exit code 2, the module path in the message, no executable and no `app0/`; with `--exclude-sce-module libc.prx` the relink succeeds and converts only the other module. - The new cases fail with `main`'s `GuestModuleBuilder.cpp` and pass with the change. - All 89 relinker tests and `tools/check_conventions.py --base origin/main` pass. Not tested with PPSA17641 or on Linux/Windows hosts. Written with AI assistance.
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#2599
No description provided.