relinker: RetroArch (PPSA99169) can't convert its libretro cores: two are refused for DF_SYMBOLIC, and cores exporting the same name make another core's import ambiguous #5927

Closed
opened 2026-10-14 16:10:56 +00:00 by orishamir · 14 comments
orishamir commented 2026-10-14 16:10:56 +00:00 (Migrated from github.com)
Contributor

Imported from boykopovar/AnyPS5. Originally posted by orishamir on 2026-10-14T16:10:56Z.


RetroArch (PPSA99169, catalog 1.0.0-beta.1) ships 33 libretro cores as ELF shared objects in app0/cores/. It needs them converted with --module-dir cores before it can load any of them. That conversion fails for two reasons, both with a Linux relinker built from main 84b01f9cd and a Windows relinker built from main 28b6f1987 (with an unrelated libSceNgs2 change merged). Each of the other 31 cores converts when it is the only one in cores/.

1. Two cores are refused for DF_SYMBOLIC.

FAIL: .../cores/azahar_libretro.so: Unsupported guest dynamic flags

azahar_libretro.so (3DS) and ppsspp_libretro.so (PSP) have DT_FLAGS = SYMBOLIC BIND_NOW (readelf -d). The other 31 cores have BIND_NOW only. GuestImageReader.cpp:160 accepts DT_FLAGS bit 8 alone, and the DT_SYMBOLIC tag (16) is refused too.

2. Cores that export the same name make another core's import ambiguous.

With the two cores above set aside:

Linux:   FAIL: Ambiguous guest import getaddrinfo in .../cores/flycast_libretro.so: exported by .../cores/dolphin_libretro.so .../cores/pcsx2_libretro.so
Windows: FAIL: Ambiguous guest import after stripping #: getaddrinfo

dolphin_libretro.so and pcsx2_libretro.so each define getaddrinfo. flycast_libretro.so, mame_libretro.so and virtualjaguar_libretro.so import it without a library. The cores' DT_NEEDED entries name only system libraries (libkernel_web.sprx, libSceLibcInternal.sprx, libScePosixForWebKit.sprx), and no core names another.

The executable's imports are matched only against guest modules in its own DT_NEEDED (GuestModuleBuilder.cpp:194). A module's import with no declared library is matched against every guest module (GuestModuleBuilder.cpp:214-226). So two sibling plugins that both define a libc-style name block every third plugin that imports it.

Question. Should a guest module's undeclared import be matched only against guest modules in its own DT_NEEDED closure, as the executable's imports are? Then these imports fall through to the system libraries. That would change binding for every guest module with undeclared imports, so I haven't made a PR.

For DF_SYMBOLIC: on Windows a converted module is a DLL, and its references to its own definitions already bind internally. On Linux the converted .so would need the flag carried over for its own definitions to win over the executable's. I haven't checked how the Linux writer binds a module's references to its own exports.

Separately, an intermittent crash. Converting with seven of the cores that do convert together (fceumm, snes9x, genesis_plus_gx, mgba, stella, scummvm, dosbox_pure), the Windows relinker (WinLibs GCC 15.2.0, Release) crashed with 0xC0000005 in 4 of about 35 runs of the same command on the same files. Under gdb, with a Release relinker rebuilt with -g added, the fault is on the main thread, in order.push_back(CheckedRva(index)) at WindowsEntryStubBuilder.cpp:147 ([...] marks argument lists that were cut off in my capture):

Thread 1 received signal SIGSEGV, Segmentation fault.
#0  std::vector<unsigned int, std::allocator<unsigned int> >::emplace_back<unsigned int> (this=<synthetic pointer>) at C:/dev/winlibs/mingw64/include/c++/15.2.0/bits/vector.tcc:117
#1  std::vector<unsigned int, std::allocator<unsigned int> >::push_back (this=<synthetic pointer>, __x=<optimized out>) at C:/dev/winlibs/mingw64/include/c++/15.2.0/bits/stl_vector.h:1434
#2  Elfpatcher::Windows::WindowsEntryStubBuilder::Build (this=this@entry=0x5fe700, dataRva=<optimized out>, entryRva=<optimized out>, nativeImports=..., libraries=..., imports=..., runPath=..., lazyBinding=<optimized out>, lazyBinding@entry=false, [...]) at C:/dev/AnyPS5/core/relinker/elfpatcher/src/windows/WindowsEntryStubBuilder.cpp:147
#3  0x00007ff74bbe0af4 in Elfpatcher::Windows::WindowsPePatcher::Patch (this=<optimized out>, sourceElf=..., originalHeaders=..., dynamicSection=..., originalPltGotVaddr=<optimized out>, runPath=..., lazyBinding=<optimized out>, [...])
#4  0x00007ff74bbbd029 in Relinker::Conversion::Convert (this=this@entry=0x5ff0c0, input=..., options=...) at C:/dev/AnyPS5/core/relinker/relinker/src/pipeline/Conversion.cpp:124
#5  0x00007ff74bb93ba7 in (anonymous namespace)::Convert (args=..., inputPath=..., absPath=..., mainExecutable=<optimized out>, mainExecutable@entry=true, progress=...) at C:/dev/AnyPS5/core/relinker/main.cpp:68
#6  0x00007ff74bb96b1b in (anonymous namespace)::Run (argc=argc@entry=10, argv=argv@entry=0x6aef30) at C:/dev/AnyPS5/core/relinker/main.cpp:139
#7  0x00007ff74bb9f7ec in wmain (argc=<optimized out>, argv=<optimized out>) at C:/dev/winlibs/mingw64/include/c++/15.2.0/bits/stl_vector.h:1395
#8  0x00007ff74bb913ba in __tmainCRTStartup ()
#9  0x00007ff74bb91080 in mainCRTStartup ()

The only other thread was idle in ntdll!ZwWaitForWorkViaWorkerFactory. A crash of the plain Release build under gdb stopped in the same function (WindowsEntryStubBuilder::Build from WindowsPePatcher::Patch; no line information in that build). It didn't happen in 20 runs each of an -O2 -g build and a -D_GLIBCXX_ASSERTIONS build, or in 5 runs of an ASan relinker on Linux writing the same Windows output. So I don't know the cause.

Not established. Whether RetroArch then loads and runs a converted core. On main it reaches its frontend picker with --executable picker/picker.bin. I haven't loaded content with a core.

AI-assisted: yes (Claude Code Opus 5.5)

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5851276185 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/5927). Originally posted by [orishamir](https://github.com/orishamir) on 2026-10-14T16:10:56Z. --- RetroArch (PPSA99169, catalog 1.0.0-beta.1) ships 33 libretro cores as ELF shared objects in `app0/cores/`. It needs them converted with `--module-dir cores` before it can load any of them. That conversion fails for two reasons, both with a Linux relinker built from `main` 84b01f9cd and a Windows relinker built from `main` 28b6f1987 (with an unrelated libSceNgs2 change merged). Each of the other 31 cores converts when it is the only one in `cores/`. **1. Two cores are refused for `DF_SYMBOLIC`.** ``` FAIL: .../cores/azahar_libretro.so: Unsupported guest dynamic flags ``` `azahar_libretro.so` (3DS) and `ppsspp_libretro.so` (PSP) have `DT_FLAGS` = `SYMBOLIC BIND_NOW` (`readelf -d`). The other 31 cores have `BIND_NOW` only. `GuestImageReader.cpp:160` accepts `DT_FLAGS` bit 8 alone, and the `DT_SYMBOLIC` tag (16) is refused too. **2. Cores that export the same name make another core's import ambiguous.** With the two cores above set aside: ``` Linux: FAIL: Ambiguous guest import getaddrinfo in .../cores/flycast_libretro.so: exported by .../cores/dolphin_libretro.so .../cores/pcsx2_libretro.so Windows: FAIL: Ambiguous guest import after stripping #: getaddrinfo ``` `dolphin_libretro.so` and `pcsx2_libretro.so` each define `getaddrinfo`. `flycast_libretro.so`, `mame_libretro.so` and `virtualjaguar_libretro.so` import it without a library. The cores' `DT_NEEDED` entries name only system libraries (`libkernel_web.sprx`, `libSceLibcInternal.sprx`, `libScePosixForWebKit.sprx`), and no core names another. The executable's imports are matched only against guest modules in its own `DT_NEEDED` (`GuestModuleBuilder.cpp:194`). A module's import with no declared library is matched against every guest module (`GuestModuleBuilder.cpp:214-226`). So two sibling plugins that both define a libc-style name block every third plugin that imports it. **Question.** Should a guest module's undeclared import be matched only against guest modules in its own `DT_NEEDED` closure, as the executable's imports are? Then these imports fall through to the system libraries. That would change binding for every guest module with undeclared imports, so I haven't made a PR. For `DF_SYMBOLIC`: on Windows a converted module is a DLL, and its references to its own definitions already bind internally. On Linux the converted `.so` would need the flag carried over for its own definitions to win over the executable's. I haven't checked how the Linux writer binds a module's references to its own exports. **Separately, an intermittent crash.** Converting with seven of the cores that do convert together (fceumm, snes9x, genesis_plus_gx, mgba, stella, scummvm, dosbox_pure), the Windows relinker (WinLibs GCC 15.2.0, Release) crashed with 0xC0000005 in 4 of about 35 runs of the same command on the same files. Under gdb, with a Release relinker rebuilt with `-g` added, the fault is on the main thread, in `order.push_back(CheckedRva(index))` at `WindowsEntryStubBuilder.cpp:147` (`[...]` marks argument lists that were cut off in my capture): ``` Thread 1 received signal SIGSEGV, Segmentation fault. #0 std::vector<unsigned int, std::allocator<unsigned int> >::emplace_back<unsigned int> (this=<synthetic pointer>) at C:/dev/winlibs/mingw64/include/c++/15.2.0/bits/vector.tcc:117 #1 std::vector<unsigned int, std::allocator<unsigned int> >::push_back (this=<synthetic pointer>, __x=<optimized out>) at C:/dev/winlibs/mingw64/include/c++/15.2.0/bits/stl_vector.h:1434 #2 Elfpatcher::Windows::WindowsEntryStubBuilder::Build (this=this@entry=0x5fe700, dataRva=<optimized out>, entryRva=<optimized out>, nativeImports=..., libraries=..., imports=..., runPath=..., lazyBinding=<optimized out>, lazyBinding@entry=false, [...]) at C:/dev/AnyPS5/core/relinker/elfpatcher/src/windows/WindowsEntryStubBuilder.cpp:147 #3 0x00007ff74bbe0af4 in Elfpatcher::Windows::WindowsPePatcher::Patch (this=<optimized out>, sourceElf=..., originalHeaders=..., dynamicSection=..., originalPltGotVaddr=<optimized out>, runPath=..., lazyBinding=<optimized out>, [...]) #4 0x00007ff74bbbd029 in Relinker::Conversion::Convert (this=this@entry=0x5ff0c0, input=..., options=...) at C:/dev/AnyPS5/core/relinker/relinker/src/pipeline/Conversion.cpp:124 #5 0x00007ff74bb93ba7 in (anonymous namespace)::Convert (args=..., inputPath=..., absPath=..., mainExecutable=<optimized out>, mainExecutable@entry=true, progress=...) at C:/dev/AnyPS5/core/relinker/main.cpp:68 #6 0x00007ff74bb96b1b in (anonymous namespace)::Run (argc=argc@entry=10, argv=argv@entry=0x6aef30) at C:/dev/AnyPS5/core/relinker/main.cpp:139 #7 0x00007ff74bb9f7ec in wmain (argc=<optimized out>, argv=<optimized out>) at C:/dev/winlibs/mingw64/include/c++/15.2.0/bits/stl_vector.h:1395 #8 0x00007ff74bb913ba in __tmainCRTStartup () #9 0x00007ff74bb91080 in mainCRTStartup () ``` The only other thread was idle in `ntdll!ZwWaitForWorkViaWorkerFactory`. A crash of the plain Release build under gdb stopped in the same function (`WindowsEntryStubBuilder::Build` from `WindowsPePatcher::Patch`; no line information in that build). It didn't happen in 20 runs each of an `-O2 -g` build and a `-D_GLIBCXX_ASSERTIONS` build, or in 5 runs of an ASan relinker on Linux writing the same Windows output. So I don't know the cause. **Not established.** Whether RetroArch then loads and runs a converted core. On `main` it reaches its frontend picker with `--executable picker/picker.bin`. I haven't loaded content with a core. AI-assisted: yes (Claude Code Opus 5.5)
orishamir commented 2026-10-14 16:19:51 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by orishamir on 2026-10-14T16:19:51Z.


Two more things stand between the cores and a working load, found with two cores that convert together (fceumm and mgba), on main e34c47921 (Windows, RTX 4080). RetroArch then exits 3 s in with 0xC0000139:

  1. .sprx dependency names are used as library file names. The cores' DT_NEEDED entries are libkernel_web.sprx, libSceLibcInternal.sprx and libScePosixForWebKit.sprx. GuestModuleBuilder.cpp addHost passes them through unchanged, so the startup looks for libs\libkernel_web.sprx and reports -> not found; nothing is imported from it, continuing without it three times. AnyPS5 ships them as .prx. The libSceLibcInternal.prx -> libc.prx rule doesn't fire for the .sprx spelling either.
  2. The cores import by plain name, and the libraries export only NIDs. With copies of the three libraries under the .sprx names (only to see what comes next), they load, but all 140 imports stay unresolved (FAIL: unresolved ELF import memset, malloc, __error, __isthreaded, ...). libc.prx exports memset only as 8zTFvBIAIN8, and I found no name-to-NID translation in the relinker.

So loading a plain-ELF guest module like these needs .sprx names mapped to .prx and plain-name imports translated to NIDs, besides the scope and DF_SYMBOLIC points above. I can implement this in the relinker if that's the direction you want. It sets how plain-ELF guest modules bind, so I'm asking first.

AI-assisted: yes (Claude Code Opus 5.5)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6172968088 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/5927#issuecomment-6172968088). Originally posted by [orishamir](https://github.com/orishamir) on 2026-10-14T16:19:51Z. --- Two more things stand between the cores and a working load, found with two cores that convert together (fceumm and mgba), on `main` e34c47921 (Windows, RTX 4080). RetroArch then exits 3 s in with 0xC0000139: 1. **`.sprx` dependency names are used as library file names.** The cores' `DT_NEEDED` entries are `libkernel_web.sprx`, `libSceLibcInternal.sprx` and `libScePosixForWebKit.sprx`. `GuestModuleBuilder.cpp` `addHost` passes them through unchanged, so the startup looks for `libs\libkernel_web.sprx` and reports `-> not found; nothing is imported from it, continuing without it` three times. AnyPS5 ships them as `.prx`. The `libSceLibcInternal.prx` -> `libc.prx` rule doesn't fire for the `.sprx` spelling either. 2. **The cores import by plain name, and the libraries export only NIDs.** With copies of the three libraries under the `.sprx` names (only to see what comes next), they load, but all 140 imports stay unresolved (`FAIL: unresolved ELF import memset`, `malloc`, `__error`, `__isthreaded`, ...). `libc.prx` exports `memset` only as `8zTFvBIAIN8`, and I found no name-to-NID translation in the relinker. So loading a plain-ELF guest module like these needs `.sprx` names mapped to `.prx` and plain-name imports translated to NIDs, besides the scope and `DF_SYMBOLIC` points above. I can implement this in the relinker if that's the direction you want. It sets how plain-ELF guest modules bind, so I'm asking first. AI-assisted: yes (Claude Code Opus 5.5)
MarcZX10 commented 2026-10-14 18:05:21 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-14T18:05:21Z.


PR #5981 addresses the DF_SYMBOLIC conversion blocker only: the reader records the flag and the Linux guest-module writer preserves it together with DF_BIND_NOW. The relinker integration test verifies the output flags. The ambiguous undeclared imports and intermittent Windows relinker crash from this issue remain unaddressed; I did not infer a binding policy for them.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6174991345 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/5927#issuecomment-6174991345). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-14T18:05:21Z. --- PR #5981 addresses the `DF_SYMBOLIC` conversion blocker only: the reader records the flag and the Linux guest-module writer preserves it together with `DF_BIND_NOW`. The relinker integration test verifies the output flags. The ambiguous undeclared imports and intermittent Windows relinker crash from this issue remain unaddressed; I did not infer a binding policy for them.
MarcZX10 commented 2026-10-14 18:19:00 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-14T18:19:00Z.


Thanks for offering to take the remaining plain-ELF loading work. Yes, please proceed with a focused relinker PR for the observed .sprx dependency names and plain-name imports, with synthetic tests that prove dependency names resolve to the shipped .prx modules and representative imports (including memset → 8zTFvBIAIN8) resolve through the converted module path. Nid::ComputeNid already produces that NID, and DynamicLoader::FindSymbol has a fallback for explicit dlsym; the tests should specifically cover ELF relocation imports, since the dlsym fallback alone does not prove those are handled.

Please keep the sibling guest-export ambiguity policy and the intermittent Windows relinker crash out of that change; they need separate evidence. A successful conversion/load test for the two-core case would be useful, but avoid claiming RetroArch is playable unless content actually runs.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6175248262 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/5927#issuecomment-6175248262). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-14T18:19:00Z. --- Thanks for offering to take the remaining plain-ELF loading work. Yes, please proceed with a focused relinker PR for the observed `.sprx` dependency names and plain-name imports, with synthetic tests that prove dependency names resolve to the shipped `.prx` modules and representative imports (including `memset` → `8zTFvBIAIN8`) resolve through the converted module path. `Nid::ComputeNid` already produces that NID, and `DynamicLoader::FindSymbol` has a fallback for explicit `dlsym`; the tests should specifically cover ELF relocation imports, since the `dlsym` fallback alone does not prove those are handled. Please keep the sibling guest-export ambiguity policy and the intermittent Windows relinker crash out of that change; they need separate evidence. A successful conversion/load test for the two-core case would be useful, but avoid claiming RetroArch is playable unless content actually runs.
orishamir commented 2026-10-14 21:26:16 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by orishamir on 2026-10-14T21:26:16Z.


I started on the relinker change and stopped. Two findings change what it should be, so I'm not opening that PR yet:

  1. The title binds the cores' imports itself, to its own functions. RetroArch's PS5 port loads a core with its own in-process ELF loader (src/core_loader_ps5.cpp). Each undefined symbol goes through ps5_core_import(name). That table is generated from the cores' imports by tools/core-imports.py and points at symbols linked into the title. 81 names are redirected to the title's own replacements: malloc/calloc/realloc/operator new go to ps5_core_* (a core allocates from direct memory "so it cannot starve the libc heap"), pthread_create and the TSD calls go to ps5_core_pthread_*, dlopen/dlsym to ps5_cores_dlopen/ps5_cores_dlsym, syscall to ps5_syscall, and so on. So binding the plain-name imports to AnyPS5's libraries by NID, as I offered, gives the cores different functions than on the console: for example AnyPS5's malloc instead of the title's allocator, or a real pthread_create instead of the title's thread factory.
  2. An unconditional plain-name-to-NID rename breaks an existing behaviour. With imports that no guest module exports renamed to Nid::ComputeNid(name), guest_module_args fails on Linux: its module imports RecordArgs by plain name from a host library that exports that plain name, and the converted module then asks for d9+l6fKWZBY. So plain-name binding to a plain host export is something the relinker already supports and tests.

Mapping the cores' .sprx dependency names to the shipped .prx files is straightforward, but on its own it leaves every import unresolved.

On the console these cores never go through the system loader, so the route that matches it is the title's own loader running inside AnyPS5, with no relinker conversion of the cores. I haven't tested what that path does on AnyPS5 yet. Which route do you want: support the title's loader, or convert the cores with a binding rule of your choice?

AI-assisted: yes (Claude Code Opus 5.5)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6178861879 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/5927#issuecomment-6178861879). Originally posted by [orishamir](https://github.com/orishamir) on 2026-10-14T21:26:16Z. --- I started on the relinker change and stopped. Two findings change what it should be, so I'm not opening that PR yet: 1. **The title binds the cores' imports itself, to its own functions.** RetroArch's PS5 port loads a core with its own in-process ELF loader ([`src/core_loader_ps5.cpp`](https://github.com/mihawk-99/PS5_RetroArch/blob/bead80725cc11e3c5c65bd9424b0a4494ae36d45/src/core_loader_ps5.cpp#L238)). Each undefined symbol goes through `ps5_core_import(name)`. That table is generated from the cores' imports by [`tools/core-imports.py`](https://github.com/mihawk-99/PS5_RetroArch/blob/bead80725cc11e3c5c65bd9424b0a4494ae36d45/tools/core-imports.py#L36-L103) and points at symbols linked into the title. 81 names are redirected to the title's own replacements: `malloc`/`calloc`/`realloc`/`operator new` go to `ps5_core_*` (a core allocates from direct memory "so it cannot starve the libc heap"), `pthread_create` and the TSD calls go to `ps5_core_pthread_*`, `dlopen`/`dlsym` to `ps5_cores_dlopen`/`ps5_cores_dlsym`, `syscall` to `ps5_syscall`, and so on. So binding the plain-name imports to AnyPS5's libraries by NID, as I offered, gives the cores different functions than on the console: for example AnyPS5's `malloc` instead of the title's allocator, or a real `pthread_create` instead of the title's thread factory. 2. **An unconditional plain-name-to-NID rename breaks an existing behaviour.** With imports that no guest module exports renamed to `Nid::ComputeNid(name)`, `guest_module_args` fails on Linux: its module imports `RecordArgs` by plain name from a host library that exports that plain name, and the converted module then asks for `d9+l6fKWZBY`. So plain-name binding to a plain host export is something the relinker already supports and tests. Mapping the cores' `.sprx` dependency names to the shipped `.prx` files is straightforward, but on its own it leaves every import unresolved. On the console these cores never go through the system loader, so the route that matches it is the title's own loader running inside AnyPS5, with no relinker conversion of the cores. I haven't tested what that path does on AnyPS5 yet. Which route do you want: support the title's loader, or convert the cores with a binding rule of your choice? AI-assisted: yes (Claude Code Opus 5.5)
orishamir commented 2026-10-14 21:37:17 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by orishamir on 2026-10-14T21:37:17Z.


@boykopovar, a question for you, since you wrote the guest-module discovery: the comment above asks how plain-ELF modules like these cores should be handled. Either the title's own loader runs them inside AnyPS5, or the relinker converts them with a binding rule you choose. I'd rather not pick that for the project.

AI-assisted: yes (Claude Code Opus 5.5)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6179046647 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/5927#issuecomment-6179046647). Originally posted by [orishamir](https://github.com/orishamir) on 2026-10-14T21:37:17Z. --- @boykopovar, a question for you, since you wrote the guest-module discovery: the comment above asks how plain-ELF modules like these cores should be handled. Either the title's own loader runs them inside AnyPS5, or the relinker converts them with a binding rule you choose. I'd rather not pick that for the project. AI-assisted: yes (Claude Code Opus 5.5)
WallfacerX commented 2026-10-14 23:28:23 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by WallfacerX on 2026-10-14T23:28:23Z.


@boykopovar I have a local Windows guest-export fix with a regression using 65,537 distinct function targets. It fails on main and passes with the change, including runtime lookup through startup imports and guest dlsym.

With #5981 applied separately, unchanged Azahar also converts successfully and preserves all 90,705 export names. I have not run the core.

Given the findings about RetroArch’s own ELF loader, would you accept this as a focused converter fix related to #5927? I want to confirm it meets the title-needed requirement before opening my first PR.

AI-assisted: yes (Codex).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6180754118 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/5927#issuecomment-6180754118). Originally posted by [WallfacerX](https://github.com/WallfacerX) on 2026-10-14T23:28:23Z. --- @boykopovar I have a local Windows guest-export fix with a regression using 65,537 distinct function targets. It fails on main and passes with the change, including runtime lookup through startup imports and guest dlsym. With #5981 applied separately, unchanged Azahar also converts successfully and preserves all 90,705 export names. I have not run the core. Given the findings about RetroArch’s own ELF loader, would you accept this as a focused converter fix related to #5927? I want to confirm it meets the title-needed requirement before opening my first PR. AI-assisted: yes (Codex).
mazen320 commented 2026-10-15 07:00:05 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by mazen320 on 2026-10-15T07:00:05Z.


Runtime note: title ELF loader works on AnyPS5 (Windows)

Picked up the open question about “title loader vs relinker conversion.”

On PPSA99169 with stock fceumm_libretro.so left in app0/cores/ (no relinker conversion of that core), RetroArch’s in-process loader opened the .so and FCEUmm came up far enough to allocate 256×224 guest textures and run at ~120 FPS for 20k+ frames. Host stack was main + HostFileReady libkernel (#5999) + existing Agc libs.

That matches the finding that cores bind via ps5_core_import inside the title: conversion/DF_SYMBOLIC/ambiguous guest exports are not on the critical path for this title’s console-shaped load.

Still open here: getting a ROM through sceKernelOpen (smoke.nes not seen yet) and dumping post-core frames. Happy to keep poking content load; this is just the loader-route evidence.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6186421127 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/5927#issuecomment-6186421127). Originally posted by [mazen320](https://github.com/mazen320) on 2026-10-15T07:00:05Z. --- ### Runtime note: title ELF loader works on AnyPS5 (Windows) Picked up the open question about “title loader vs relinker conversion.” On PPSA99169 with stock `fceumm_libretro.so` left in `app0/cores/` (no relinker conversion of that core), RetroArch’s in-process loader opened the `.so` and FCEUmm came up far enough to allocate **256×224** guest textures and run at ~120 FPS for 20k+ frames. Host stack was main + HostFileReady libkernel (#5999) + existing Agc libs. That matches the finding that cores bind via `ps5_core_import` inside the title: conversion/`DF_SYMBOLIC`/ambiguous guest exports are not on the critical path for this title’s console-shaped load. Still open here: getting a ROM through `sceKernelOpen` (`smoke.nes` not seen yet) and dumping post-core frames. Happy to keep poking content load; this is just the loader-route evidence.
mazen320 commented 2026-10-15 07:08:49 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by mazen320 on 2026-10-15T07:08:49Z.


Confirmed: title ELF loader + content (not relinker cores)

Follow-up with a real ROM path:

  • /app0/test-run.txt + /app0/args.txt (-L + fceumm_libretro.so + smoke.nes + --max-frames-ss)
  • Stock .so (no relinker conversion of the core)
  • Log: dynamic core load → Loading content file: "/app0/content/smoke.nes" → geometry 256×224
  • Screenshot written to /app0/screenshots/smoke.png; content ran ~9s

So for RetroArch, the console-shaped route (title ps5_core_import loader on unmodified cores) already works on AnyPS5 Windows with HostFileReady (#5999). Relinker DF_SYMBOLIC / ambiguous exports remain relevant for converted modules, but they are not required to get FCEUmm+ROM on screen.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6186558338 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/5927#issuecomment-6186558338). Originally posted by [mazen320](https://github.com/mazen320) on 2026-10-15T07:08:49Z. --- ### Confirmed: title ELF loader + content (not relinker cores) Follow-up with a real ROM path: - `/app0/test-run.txt` + `/app0/args.txt` (`-L` + `fceumm_libretro.so` + `smoke.nes` + `--max-frames-ss`) - Stock `.so` (no relinker conversion of the core) - Log: dynamic core load → `Loading content file: "/app0/content/smoke.nes"` → geometry 256×224 - Screenshot written to `/app0/screenshots/smoke.png`; content ran ~9s So for RetroArch, the console-shaped route (title `ps5_core_import` loader on unmodified cores) already works on AnyPS5 Windows with HostFileReady (#5999). Relinker `DF_SYMBOLIC` / ambiguous exports remain relevant for *converted* modules, but they are not required to get FCEUmm+ROM on screen.
mazen320 commented 2026-10-15 07:11:05 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by mazen320 on 2026-10-15T07:11:05Z.


Pixel follow-up: empty-CHR smoke.nes explained the gray shot. A tiny checker.nes with filled CHR produced a visible tile grid in /app0/screenshots/checker.png via the title loader + stock fceumm_libretro.so (no relinker conversion).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6186595952 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/5927#issuecomment-6186595952). Originally posted by [mazen320](https://github.com/mazen320) on 2026-10-15T07:11:05Z. --- Pixel follow-up: empty-CHR `smoke.nes` explained the gray shot. A tiny `checker.nes` with filled CHR produced a visible tile grid in `/app0/screenshots/checker.png` via the title loader + stock `fceumm_libretro.so` (no relinker conversion).
mazen320 commented 2026-10-15 07:12:43 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by mazen320 on 2026-10-15T07:12:43Z.


mGBA note: stock mgba_libretro.so also loads through the title ELF loader (core loader: ready … mapped_bytes=3293184). It then exits with Libretro core requires content, but nothing was provided — expected without a ROM. Same route as FCEUmm.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6186622207 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/5927#issuecomment-6186622207). Originally posted by [mazen320](https://github.com/mazen320) on 2026-10-15T07:12:43Z. --- mGBA note: stock `mgba_libretro.so` also loads through the title ELF loader (`core loader: ready … mapped_bytes=3293184`). It then exits with `Libretro core requires content, but nothing was provided` — expected without a ROM. Same route as FCEUmm.
mazen320 commented 2026-10-15 07:13:33 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by mazen320 on 2026-10-15T07:13:33Z.


Same for Snes9x: stock snes9x_libretro.so loads (core loader: ready symbols=182 relocations=7952 mapped_bytes=6815744) and exits only for missing content. So FCEUmm / mGBA / Snes9x all take the title ELF loader path on Windows.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6186638295 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/5927#issuecomment-6186638295). Originally posted by [mazen320](https://github.com/mazen320) on 2026-10-15T07:13:33Z. --- Same for Snes9x: stock `snes9x_libretro.so` loads (`core loader: ready symbols=182 relocations=7952 mapped_bytes=6815744`) and exits only for missing content. So FCEUmm / mGBA / Snes9x all take the title ELF loader path on Windows.
mazen320 commented 2026-10-15 07:14:14 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by mazen320 on 2026-10-15T07:14:14Z.


Core loader survey (Windows, stock .so, title ELF loader)

With /app0/test-run.txt + args.txt -L <core> (no ROM):

Core Loader
fceumm ready + ROM pixels (checker.nes → checker.png tile grid)
mgba ready; exits needing content
snes9x ready; exits needing content
genesis_plus_gx ready; exits needing content
fbneo ready; exits needing content

Host stack includes HostFileReady (#5999). Relinker conversion of these cores was not used.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6186650718 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/5927#issuecomment-6186650718). Originally posted by [mazen320](https://github.com/mazen320) on 2026-10-15T07:14:14Z. --- ### Core loader survey (Windows, stock `.so`, title ELF loader) With `/app0/test-run.txt` + `args.txt` `-L <core>` (no ROM): | Core | Loader | |------|--------| | fceumm | ready + **ROM pixels** (`checker.nes` → `checker.png` tile grid) | | mgba | ready; exits needing content | | snes9x | ready; exits needing content | | genesis_plus_gx | ready; exits needing content | | fbneo | ready; exits needing content | Host stack includes HostFileReady (#5999). Relinker conversion of these cores was not used.
mazen320 commented 2026-10-15 07:18:45 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by mazen320 on 2026-10-15T07:18:45Z.


mGBA + homebrew µCity (ucity.gbc) also runs: geometry 160×144, screenshot written. Same title-loader path as FCEUmm.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6186721471 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/5927#issuecomment-6186721471). Originally posted by [mazen320](https://github.com/mazen320) on 2026-10-15T07:18:45Z. --- mGBA + homebrew µCity (`ucity.gbc`) also runs: geometry 160×144, screenshot written. Same title-loader path as FCEUmm.
mazen320 commented 2026-10-15 07:22:50 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by mazen320 on 2026-10-15T07:22:50Z.


Pad inject on mGBA+µCity reaches the in-game Select Slot menu (not just the title screen).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6186786352 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/5927#issuecomment-6186786352). Originally posted by [mazen320](https://github.com/mazen320) on 2026-10-15T07:22:50Z. --- Pad inject on mGBA+µCity reaches the in-game **Select Slot** menu (not just the title screen).
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#5927
No description provided.