Linux: .native wrapper libraries have no dependency edge to their plain twin, so guest modules cannot bind #906

Closed
opened 2026-10-06 15:36:51 +00:00 by jeffrey12cali · 11 comments
jeffrey12cali commented 2026-10-06 15:36:51 +00:00 (Migrated from github.com)
Contributor

Imported from boykopovar/AnyPS5. Originally posted by jeffrey12cali on 2026-10-06T15:36:51Z.


Symptom

On Linux a title's own module can never be loaded, and the title spins on it forever. Measured on PPSA28997 after its intro movies:

31418  [dl] dlopen(/app0/Media/Plugins/PSN.prx, 0x2) -> (nil) error: undefined symbol: wTpfglkmv34
15715  [dl] dlopen(/app0/Media/Plugins/PSN.prx.prx, 0x2) -> (nil) error: cannot open shared object file
15712  [dl] dlopen(/app0//app0/Media/Plugins/PSN.prx.prx, 0x2) -> (nil) error: cannot open shared object file

wTpfglkmv34 is sceMsgDialogProgressBarSetValue. The boot sequence stops dead there - the title is not waiting on an event or on input, it is retrying a load that cannot succeed.

Cause

The guest module's DT_NEEDED names the .native wrapper, but the symbol is exported only by the plain library, and no edge connects the two:

file exports wTpfglkmv34 DT_NEEDED mentions its plain twin
libs/libSceMsgDialog.native.prx no (24 global funcs) no
libs/libSceMsgDialog.prx yes (38 global funcs) -

Confirmed live: /proc/<pid>/maps shows only libSceMsgDialog.native.prx mapped, so the defining object is never in the new module's lookup scope and RTLD_NOW binding fails.

The same shape exists for every .native wrapper - none of the nine has a DT_NEEDED edge to its plain twin - and several have exports that exist only on one side:

library plain-only exports native-only exports reached from this title's PSN module
libSceSaveData 26 55 yes
libSceMsgDialog 17 5 yes
libSceAudiodec 146 1 no
libSceShare 4 0 no
libSceSaveDataDialog 3 5 yes
libSceAjm 1 196 yes
libSceAvPlayer 0 6 yes
libSceFont 0 0 no
libSceNgs2 1 101 no

Why Windows does not hit this

PE import resolution binds against every module already loaded in the process, and the Windows relinker points guest imports at the library that implements them. ELF lookup is scope-based, so on Linux naming only the wrapper is enough to fail. This is the same family as #694 (process-wide vs scoped symbol lookup), just at load time rather than at dlsym time.

Reproduction

Any title whose module imports a symbol that lives in a plain library while its DT_NEEDED names the .native wrapper. For this title: relink, launch on Linux, and watch for undefined symbol: wTpfglkmv34 from dlopen of the title's own PSN.prx.

Possible fixes

  1. Give each .native wrapper a DT_NEEDED on its plain twin (or the reverse) so the pair is always in one scope.
  2. Have the relinker emit the implementing library name in the converted guest module's DT_NEEDED instead of the wrapper.
  3. Load the plain libraries as part of the executable's dependency set, so they are in the global scope for later dlopens.

Not sufficient on its own

With libSceMsgDialog.prx force-loaded for the test, PSN.prx loads and the title then faults inside it at PSN.prx.guest.prx+0x3ee7 on the main thread - a separate problem, presumably the next wrapper edge in the table (libSceSaveData, 26 plain-only exports, is also in that module's DT_NEEDED). Reporting this one first because it is what makes the title stop booting.

Unrelated but worth noting from the same investigation: of the 2315 unimplemented NID imports our prepared tree stubs, exactly one is ever called by this title (dbOlWdppb4o, 24 times, which ps5rs attributes to sceAgcCreateInterpolantMapping in libSceAgc) - so the backlog size is not what is blocking boot.

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5731181694 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/906). Originally posted by [jeffrey12cali](https://github.com/jeffrey12cali) on 2026-10-06T15:36:51Z. --- ### Symptom On Linux a title's own module can never be loaded, and the title spins on it forever. Measured on PPSA28997 after its intro movies: ``` 31418 [dl] dlopen(/app0/Media/Plugins/PSN.prx, 0x2) -> (nil) error: undefined symbol: wTpfglkmv34 15715 [dl] dlopen(/app0/Media/Plugins/PSN.prx.prx, 0x2) -> (nil) error: cannot open shared object file 15712 [dl] dlopen(/app0//app0/Media/Plugins/PSN.prx.prx, 0x2) -> (nil) error: cannot open shared object file ``` `wTpfglkmv34` is `sceMsgDialogProgressBarSetValue`. The boot sequence stops dead there - the title is not waiting on an event or on input, it is retrying a load that cannot succeed. ### Cause The guest module's `DT_NEEDED` names the **`.native` wrapper**, but the symbol is exported only by the **plain** library, and no edge connects the two: | file | exports `wTpfglkmv34` | `DT_NEEDED` mentions its plain twin | | --- | --- | --- | | `libs/libSceMsgDialog.native.prx` | no (24 global funcs) | **no** | | `libs/libSceMsgDialog.prx` | **yes** (38 global funcs) | - | Confirmed live: `/proc/<pid>/maps` shows only `libSceMsgDialog.native.prx` mapped, so the defining object is never in the new module's lookup scope and `RTLD_NOW` binding fails. The same shape exists for **every** `.native` wrapper - none of the nine has a `DT_NEEDED` edge to its plain twin - and several have exports that exist only on one side: | library | plain-only exports | native-only exports | reached from this title's PSN module | | --- | --- | --- | --- | | `libSceSaveData` | 26 | 55 | yes | | `libSceMsgDialog` | 17 | 5 | yes | | `libSceAudiodec` | 146 | 1 | no | | `libSceShare` | 4 | 0 | no | | `libSceSaveDataDialog` | 3 | 5 | yes | | `libSceAjm` | 1 | 196 | yes | | `libSceAvPlayer` | 0 | 6 | yes | | `libSceFont` | 0 | 0 | no | | `libSceNgs2` | 1 | 101 | no | ### Why Windows does not hit this PE import resolution binds against every module already loaded in the process, and the Windows relinker points guest imports at the library that implements them. ELF lookup is scope-based, so on Linux naming only the wrapper is enough to fail. This is the same family as #694 (process-wide vs scoped symbol lookup), just at load time rather than at `dlsym` time. ### Reproduction Any title whose module imports a symbol that lives in a plain library while its `DT_NEEDED` names the `.native` wrapper. For this title: relink, launch on Linux, and watch for `undefined symbol: wTpfglkmv34` from `dlopen` of the title's own `PSN.prx`. ### Possible fixes 1. Give each `.native` wrapper a `DT_NEEDED` on its plain twin (or the reverse) so the pair is always in one scope. 2. Have the relinker emit the implementing library name in the converted guest module's `DT_NEEDED` instead of the wrapper. 3. Load the plain libraries as part of the executable's dependency set, so they are in the global scope for later `dlopen`s. ### Not sufficient on its own With `libSceMsgDialog.prx` force-loaded for the test, `PSN.prx` loads and the title then faults inside it at `PSN.prx.guest.prx+0x3ee7` on the main thread - a separate problem, presumably the next wrapper edge in the table (`libSceSaveData`, 26 plain-only exports, is also in that module's `DT_NEEDED`). Reporting this one first because it is what makes the title stop booting. Unrelated but worth noting from the same investigation: of the 2315 unimplemented NID imports our prepared tree stubs, exactly **one** is ever called by this title (`dbOlWdppb4o`, 24 times, which ps5rs attributes to `sceAgcCreateInterpolantMapping` in `libSceAgc`) - so the backlog size is not what is blocking boot.
Dextroid17 commented 2026-10-06 22:50:26 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by Dextroid17 on 2026-10-06T22:50:26Z.


Same question as #918: @jeffrey12cali are you still planning to send a PR for this, or should someone else take it? Happy to pick it up if you are not, but I do not want to duplicate your work.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6026885439 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/906#issuecomment-6026885439). Originally posted by [Dextroid17](https://github.com/Dextroid17) on 2026-10-06T22:50:26Z. --- Same question as #918: @jeffrey12cali are you still planning to send a PR for this, or should someone else take it? Happy to pick it up if you are not, but I do not want to duplicate your work.
jeffrey12cali commented 2026-10-06 23:09:01 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by jeffrey12cali on 2026-10-06T23:09:01Z.


Please take it — I have a title-side stopgap for now, and one measurement that should shape the implementation, because the obvious fix regresses this title.

The obvious fix is to give each X.native.prx wrapper a real DT_NEEDED edge to the plain X.prx. I built it (linking the twin into the wrapper targets) and the load does succeed — but every wrapper in the executable's DT_NEEDED is in the global scope on Linux, and the pairs share NIDs: libSceAvPlayer 30 exports with all 30 overlapping, libSceSaveData 41 with 14 overlapping, libSceMsgDialog 7 with 6. Pulling the plain twin in globally rebinds other modules to the wrong implementation, and the title then fails earlier than before: it prints its plugin-error block and never reaches the load that motivated this issue.

So the fix has to keep the twin out of the global scope. Two shapes look right to me:

  1. bring the twin in as a local dependency of the referring object, so it resolves inside that object's own scope, or
  2. have the wrapper re-export what the plain library provides, so nothing additional is loaded at all.

What I do today is a targeted version of (1), at prepare time: rewrite the importing module's own DT_NEEDED string from libSceMsgDialog.native.prx to libSceMsgDialog.prx. The replacement is shorter than what it replaces, so it fits the existing string-table slot and no table has to grow.

Repro: PPSA28997, Linux relink. The title retries dlopen(/app0/Media/Plugins/PSN.prx, RTLD_NOW) 1518 times per path variant, and every attempt fails with undefined symbol: wTpfglkmv34 (sceMsgDialogProgressBarSetValue, exported by libSceMsgDialog.prx, absent from libSceMsgDialog.native.prx). Happy to test whatever you land against this title.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6027105703 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/906#issuecomment-6027105703). Originally posted by [jeffrey12cali](https://github.com/jeffrey12cali) on 2026-10-06T23:09:01Z. --- Please take it — I have a title-side stopgap for now, and one measurement that should shape the implementation, because the obvious fix regresses this title. The obvious fix is to give each `X.native.prx` wrapper a real `DT_NEEDED` edge to the plain `X.prx`. I built it (linking the twin into the wrapper targets) and the load does succeed — but every wrapper in the executable's `DT_NEEDED` is in the global scope on Linux, and the pairs share NIDs: `libSceAvPlayer` 30 exports with all 30 overlapping, `libSceSaveData` 41 with 14 overlapping, `libSceMsgDialog` 7 with 6. Pulling the plain twin in globally rebinds other modules to the wrong implementation, and the title then fails *earlier* than before: it prints its plugin-error block and never reaches the load that motivated this issue. So the fix has to keep the twin out of the global scope. Two shapes look right to me: 1. bring the twin in as a *local* dependency of the referring object, so it resolves inside that object's own scope, or 2. have the wrapper re-export what the plain library provides, so nothing additional is loaded at all. What I do today is a targeted version of (1), at prepare time: rewrite the importing module's own `DT_NEEDED` string from `libSceMsgDialog.native.prx` to `libSceMsgDialog.prx`. The replacement is shorter than what it replaces, so it fits the existing string-table slot and no table has to grow. Repro: PPSA28997, Linux relink. The title retries `dlopen(/app0/Media/Plugins/PSN.prx, RTLD_NOW)` 1518 times per path variant, and every attempt fails with `undefined symbol: wTpfglkmv34` (`sceMsgDialogProgressBarSetValue`, exported by `libSceMsgDialog.prx`, absent from `libSceMsgDialog.native.prx`). Happy to test whatever you land against this title.
Dextroid17 commented 2026-10-06 23:13:56 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by Dextroid17 on 2026-10-06T23:13:56Z.


Implemented option 1 in a PR: each .native wrapper now links its plain twin on ELF targets, so the twin is in the wrapper's lookup scope. Verified locally — dlopen(libSceMsgDialog.native.prx) leaves libSceMsgDialog.prx unmapped before the change and maps it after, for all nine wrappers; 369/369 tests pass. @jeffrey12cali if you already have this in a branch, say so and I will close mine.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6027163009 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/906#issuecomment-6027163009). Originally posted by [Dextroid17](https://github.com/Dextroid17) on 2026-10-06T23:13:56Z. --- Implemented option 1 in a PR: each `.native` wrapper now links its plain twin on ELF targets, so the twin is in the wrapper's lookup scope. Verified locally — `dlopen(libSceMsgDialog.native.prx)` leaves `libSceMsgDialog.prx` unmapped before the change and maps it after, for all nine wrappers; 369/369 tests pass. @jeffrey12cali if you already have this in a branch, say so and I will close mine.
Dextroid17 commented 2026-10-06 23:14:55 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by Dextroid17 on 2026-10-06T23:14:55Z.


Thanks — and that measurement saved me from shipping a regression: #1009 took the DT_NEEDED edge approach and is now closed.

Taking it on the basis you describe: the twin has to stay out of the global scope. I am going to look at the relinker side first — where the converted guest module's DT_NEEDED is emitted, and whether it can name the library that actually defines the imported NID instead of the wrapper (your stopgap, applied at conversion time rather than at prepare time). If that turns out to be the wrong layer I will look at the wrapper re-exporting the plain library's symbols instead.

Your repro numbers are very useful; I will use the nine pairs and their overlap counts as the constraint to check against. If you would rather keep it and land your own version, say so and I will drop it.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6027174667 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/906#issuecomment-6027174667). Originally posted by [Dextroid17](https://github.com/Dextroid17) on 2026-10-06T23:14:55Z. --- Thanks — and that measurement saved me from shipping a regression: #1009 took the `DT_NEEDED` edge approach and is now closed. Taking it on the basis you describe: the twin has to stay out of the global scope. I am going to look at the relinker side first — where the converted guest module's `DT_NEEDED` is emitted, and whether it can name the library that actually defines the imported NID instead of the wrapper (your stopgap, applied at conversion time rather than at prepare time). If that turns out to be the wrong layer I will look at the wrapper re-exporting the plain library's symbols instead. Your repro numbers are very useful; I will use the nine pairs and their overlap counts as the constraint to check against. If you would rather keep it and land your own version, say so and I will drop it.
Dextroid17 commented 2026-10-06 23:17:28 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by Dextroid17 on 2026-10-06T23:17:28Z.


One measurement that constrains the shape, from a minimal ELF repro on this box (glibc, x86-64). Three shared libraries: libtwin.so (defines twin_sym), libwrapper.so, libmod.so (the "referring object"), and an executable.

configuration dlsym(RTLD_DEFAULT, "twin_sym") from a later dlopen
wrapper has DT_NEEDED on the twin (the approach in the PR I closed) visible — global leak
module has DT_NEEDED on the twin and is dlopened, not in the executable's DT_NEEDED not visible; dlsym(module, "twin_sym") still resolves
module has DT_NEEDED on the twin and is in the executable's DT_NEEDED visible — global leak

So shape 1 keeps the twin local only when the referring module is not in the executable's DT_NEEDED. GuestModuleBuilder::Build currently adds every converted guest module to the executable's DT_NEEDED (for (const auto index : order) addNeeded(...)), so a per-module twin edge on its own would still land in the executable's closure and rebind, which matches what you measured.

It also explains why your stopgap works: it replaces the wrapper name rather than adding the twin alongside it, so no pair is ever in one closure.

Two shapes that stay local, then:

  1. the referring module names the twin and is not in the executable's DT_NEEDED (which may conflict with the current initialization ordering), or
  2. the wrapper re-exports what the plain library provides, so nothing extra is loaded at all.

Happy to implement whichever you and @boykopovar prefer. I would rather ask than guess again after closing #1009.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6027204533 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/906#issuecomment-6027204533). Originally posted by [Dextroid17](https://github.com/Dextroid17) on 2026-10-06T23:17:28Z. --- One measurement that constrains the shape, from a minimal ELF repro on this box (glibc, x86-64). Three shared libraries: `libtwin.so` (defines `twin_sym`), `libwrapper.so`, `libmod.so` (the "referring object"), and an executable. | configuration | `dlsym(RTLD_DEFAULT, "twin_sym")` from a later `dlopen` | | --- | --- | | wrapper has `DT_NEEDED` on the twin (the approach in the PR I closed) | **visible** — global leak | | module has `DT_NEEDED` on the twin and is `dlopen`ed, not in the executable's `DT_NEEDED` | **not visible**; `dlsym(module, "twin_sym")` still resolves | | module has `DT_NEEDED` on the twin and *is* in the executable's `DT_NEEDED` | **visible** — global leak | So shape 1 keeps the twin local only when the referring module is not in the executable's `DT_NEEDED`. `GuestModuleBuilder::Build` currently adds **every** converted guest module to the executable's `DT_NEEDED` (`for (const auto index : order) addNeeded(...)`), so a per-module twin edge on its own would still land in the executable's closure and rebind, which matches what you measured. It also explains why your stopgap works: it *replaces* the wrapper name rather than adding the twin alongside it, so no pair is ever in one closure. Two shapes that stay local, then: 1. the referring module names the twin **and** is not in the executable's `DT_NEEDED` (which may conflict with the current initialization ordering), or 2. the wrapper re-exports what the plain library provides, so nothing extra is loaded at all. Happy to implement whichever you and @boykopovar prefer. I would rather ask than guess again after closing #1009.
Dextroid17 commented 2026-10-07 01:11:00 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by Dextroid17 on 2026-10-07T01:11:00Z.


I measured the pairs before touching any ELF scoping, and the premise behind the DT_NEEDED edge turns out to be mostly wrong: eight of the nine wrappers already export every symbol their plain twin does.

Counts from a Release build of libs (nm -D --defined-only, plain vs .native):

pair plain wrapper shared plain symbols missing from the wrapper
libSceFont.native 356 356 356 –
libSceAvPlayer.native 30 30 30 –
libSceAudiodec.native 15 15 15 –
libSceShare.native 17 13 13 4 real NIDs
libSceMsgDialog.native 10 11 10 –
libSceSaveDataDialog.native 8 10 8 –
libSceSaveData.native 12 40 11 _ZNKSt5ctypeIcE8do_widenEc
libSceAjm.native 1 37 0 DummyFunction_nid_no_patch
libSceNgs2.native 1 35 0 DummyFunction_nid_no_patch

Only libSceShare.native is genuinely incomplete. It is missing four exports the plain library has:

  • sceShareCaptureScreenshotExtended — implemented there: zeroes the request id and answers ERROR_NOT_SUPPORTED
  • sceShareCaptureVideoClipExtended — NotImplemented_nid_no_patch in the plain library too
  • sceShareGetRunningStatus — same
  • sceShareSetContentParamForApplicationTitle — same

The other three differences are not NIDs at all: a std::ctype template instantiation the linker happened to export, and the DummyFunction_nid_no_patch placeholder of two libraries that have one real export each. libSceAjm.native and libSceNgs2.native are the wrappers with the most exports in the whole set (37 and 35).

So an edge is not needed for eight of the nine pairs, and for the ninth the fix is to add four declarations to libSceShare.native — no DT_NEEDED edge, no second copy of anything in the global scope, and nothing for the pairs to rebind against. I am sending that as a PR instead of the scoping change.

That leaves one thing the overlap numbers do not explain, and I would rather ask than guess again. The original undefined symbol: wTpfglkmv34 is defined in both libSceMsgDialog.prx and libSceMsgDialog.native.prx, and (as you measured) the wrappers are in the executable's DT_NEEDED, so a global lookup should find it. Is the conversion giving that plugin a DT_NEEDED list that does not name the library it imports from — the relinker picking the wrapper where the NID actually lives in the plain twin — or is /app0/Media/Plugins/PSN.prx loaded in a way that does not consult the global scope at all?

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6028715637 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/906#issuecomment-6028715637). Originally posted by [Dextroid17](https://github.com/Dextroid17) on 2026-10-07T01:11:00Z. --- I measured the pairs before touching any ELF scoping, and the premise behind the `DT_NEEDED` edge turns out to be mostly wrong: eight of the nine wrappers already export every symbol their plain twin does. Counts from a Release build of `libs` (`nm -D --defined-only`, plain vs `.native`): | pair | plain | wrapper | shared | plain symbols missing from the wrapper | | --- | --- | --- | --- | --- | | libSceFont.native | 356 | 356 | 356 | – | | libSceAvPlayer.native | 30 | 30 | 30 | – | | libSceAudiodec.native | 15 | 15 | 15 | – | | **libSceShare.native** | 17 | 13 | 13 | **4 real NIDs** | | libSceMsgDialog.native | 10 | 11 | 10 | – | | libSceSaveDataDialog.native | 8 | 10 | 8 | – | | libSceSaveData.native | 12 | 40 | 11 | `_ZNKSt5ctypeIcE8do_widenEc` | | libSceAjm.native | 1 | 37 | 0 | `DummyFunction_nid_no_patch` | | libSceNgs2.native | 1 | 35 | 0 | `DummyFunction_nid_no_patch` | Only `libSceShare.native` is genuinely incomplete. It is missing four exports the plain library has: - `sceShareCaptureScreenshotExtended` — implemented there: zeroes the request id and answers `ERROR_NOT_SUPPORTED` - `sceShareCaptureVideoClipExtended` — `NotImplemented_nid_no_patch` in the plain library too - `sceShareGetRunningStatus` — same - `sceShareSetContentParamForApplicationTitle` — same The other three differences are not NIDs at all: a `std::ctype` template instantiation the linker happened to export, and the `DummyFunction_nid_no_patch` placeholder of two libraries that have one real export each. `libSceAjm.native` and `libSceNgs2.native` are the wrappers with the *most* exports in the whole set (37 and 35). So an edge is not needed for eight of the nine pairs, and for the ninth the fix is to add four declarations to `libSceShare.native` — no `DT_NEEDED` edge, no second copy of anything in the global scope, and nothing for the pairs to rebind against. I am sending that as a PR instead of the scoping change. That leaves one thing the overlap numbers do not explain, and I would rather ask than guess again. The original `undefined symbol: wTpfglkmv34` is defined in **both** `libSceMsgDialog.prx` and `libSceMsgDialog.native.prx`, and (as you measured) the wrappers are in the executable's `DT_NEEDED`, so a global lookup should find it. Is the conversion giving that plugin a `DT_NEEDED` list that does not name the library it imports from — the relinker picking the wrapper where the NID actually lives in the plain twin — or is `/app0/Media/Plugins/PSN.prx` loaded in a way that does not consult the global scope at all?
Dextroid17 commented 2026-10-07 01:17:16 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by Dextroid17 on 2026-10-07T01:17:16Z.


Sent as #1024: libSceShare.native now exports the four symbols it was missing, with a behavioural test. No dependency edge, no lookup-scope change — the wrapper defines them itself, so nothing extra enters the global scope. Full suite 372/372.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6028783516 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/906#issuecomment-6028783516). Originally posted by [Dextroid17](https://github.com/Dextroid17) on 2026-10-07T01:17:16Z. --- Sent as #1024: `libSceShare.native` now exports the four symbols it was missing, with a behavioural test. No dependency edge, no lookup-scope change — the wrapper defines them itself, so nothing extra enters the global scope. Full suite 372/372.
Dextroid17 commented 2026-10-07 02:08:51 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by Dextroid17 on 2026-10-07T02:08:51Z.


Correction to my measurement above, after @oneandonlydean pointed me at #228.

I concluded from the symbol counts that libSceShare.native was "the only genuine gap" and that adding the four exports to the wrapper was the fix. That conclusion is wrong. The owner's rule in #228 is that a title importing libSceX also loads libSceX.native, so the symbols are found from whichever of the pair is present, and a copy in the other library is not needed (Font being the known exception, where a title loads only one). Under that model libSceShare.native not exporting what libSceShare exports is not a load failure at all, and #1024 was closed for exactly that reason.

What survives from the measurement is the part that does not depend on that conclusion:

  • Eight of the nine wrappers already export every symbol their plain twin does, so a wrapper-side copy is not what is missing in this issue.
  • The four libSceShare exports are still the only real difference between a pair, and libSceShare is loaded alongside the wrapper.

So the question this issue actually turns on is the one @oneandonlydean raised on #1024: whether a module's import is resolved by how the plain library is found, rather than by what the wrapper exports. That matches the original symptom better than my reading did — wTpfglkmv34 is defined in both libSceMsgDialog.prx and libSceMsgDialog.native.prx, so a module that cannot see it has a lookup-scope problem, not a missing-export one.

I do not have a title to reproduce the undefined symbol line with, so I cannot settle it; leaving the measurement here for whoever can.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6029385182 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/906#issuecomment-6029385182). Originally posted by [Dextroid17](https://github.com/Dextroid17) on 2026-10-07T02:08:51Z. --- Correction to my measurement above, after @oneandonlydean pointed me at #228. I concluded from the symbol counts that `libSceShare.native` was "the only genuine gap" and that adding the four exports to the wrapper was the fix. **That conclusion is wrong.** The owner's rule in #228 is that a title importing `libSceX` also loads `libSceX.native`, so the symbols are found from whichever of the pair is present, and a copy in the other library is not needed (Font being the known exception, where a title loads only one). Under that model `libSceShare.native` not exporting what `libSceShare` exports is not a load failure at all, and #1024 was closed for exactly that reason. What survives from the measurement is the part that does not depend on that conclusion: - Eight of the nine wrappers already export every symbol their plain twin does, so a wrapper-side copy is not what is missing in this issue. - The four `libSceShare` exports are still the only real difference between a pair, and `libSceShare` is loaded alongside the wrapper. So the question this issue actually turns on is the one @oneandonlydean raised on #1024: whether a module's import is resolved by **how the plain library is found**, rather than by what the wrapper exports. That matches the original symptom better than my reading did — `wTpfglkmv34` is defined in both `libSceMsgDialog.prx` and `libSceMsgDialog.native.prx`, so a module that cannot see it has a lookup-scope problem, not a missing-export one. I do not have a title to reproduce the `undefined symbol` line with, so I cannot settle it; leaving the measurement here for whoever can.
jeffrey12cali commented 2026-10-07 05:16:10 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by jeffrey12cali on 2026-10-07T05:16:10Z.


Please land the libSceShare fix - I would rather have that than any scoping change, and I will not duplicate it.

Your counts and mine are both correct, and the reason is a snapshot difference worth writing down, because it explains why the wrapper looked incomplete here:

measurement our pin sos-v0.2.2 (c8830699), built libs your main build
libSceMsgDialog (plain) exports 12, including wTpfglkmv34 10, all shared with the wrapper
libSceMsgDialog.native exports 5, wTpfglkmv34 absent 11, nothing missing

The runtime agrees with the numbers rather than with either of us: on our pin dlopen(/app0/Media/Plugins/PSN.prx, RTLD_NOW) fails with undefined symbol: wTpfglkmv34, and on main the wrapper source declares it (core/libs/prx/libSceMsgDialog.native/Export.cpp contains ProgressBarSetValue). So the specific gap we hit was closed on main between those snapshots, and an edge really is unnecessary there now - only libSceShare.native is left incomplete, which is what your PR fixes.

Two things from this thread I would keep even though the edge is gone:

  1. Your glibc repro is a live constraint, not a historical note: GuestModuleBuilder::Build adds every converted guest module to the executable's DT_NEEDED, so a per-module dependency added to any module that is also in that list lands in the global closure by construction. If a title ever needs a twin that a wrapper cannot re-export, that is the wall it hits, and the two shapes you listed are the only ones that stay local.
  2. The overlap table as the check to run before adding any such edge.

For completeness, our side of this is temporary and self-labelling: tools/sos_linux/twinscope.py replaces the importing module's own DT_NEEDED string with the plain twin's name (a shorter string in the same slot, so no table grows) at prepare time, purely because we are pinned to sos-v0.2.2. When we re-pin onto main it comes out: the wrapper already answers the import, and your PR closes the last pair.

Thanks for measuring instead of defending the first approach - the repro and the table made this thread much better than my report did.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6031460632 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/906#issuecomment-6031460632). Originally posted by [jeffrey12cali](https://github.com/jeffrey12cali) on 2026-10-07T05:16:10Z. --- Please land the `libSceShare` fix - I would rather have that than any scoping change, and I will not duplicate it. Your counts and mine are both correct, and the reason is a snapshot difference worth writing down, because it explains why the wrapper looked incomplete here: | measurement | our pin `sos-v0.2.2` (`c8830699`), built `libs` | your `main` build | | --- | --- | --- | | `libSceMsgDialog` (plain) exports | 12, including `wTpfglkmv34` | 10, all shared with the wrapper | | `libSceMsgDialog.native` exports | **5, `wTpfglkmv34` absent** | 11, nothing missing | The runtime agrees with the numbers rather than with either of us: on our pin `dlopen(/app0/Media/Plugins/PSN.prx, RTLD_NOW)` fails with `undefined symbol: wTpfglkmv34`, and on `main` the wrapper source declares it (`core/libs/prx/libSceMsgDialog.native/Export.cpp` contains `ProgressBarSetValue`). So the specific gap we hit was closed on `main` between those snapshots, and an edge really is unnecessary there now - only `libSceShare.native` is left incomplete, which is what your PR fixes. Two things from this thread I would keep even though the edge is gone: 1. Your glibc repro is a live constraint, not a historical note: `GuestModuleBuilder::Build` adds *every* converted guest module to the executable's `DT_NEEDED`, so a per-module dependency added to any module that is also in that list lands in the global closure by construction. If a title ever needs a twin that a wrapper cannot re-export, that is the wall it hits, and the two shapes you listed are the only ones that stay local. 2. The overlap table as the check to run before adding any such edge. For completeness, our side of this is temporary and self-labelling: `tools/sos_linux/twinscope.py` *replaces* the importing module's own `DT_NEEDED` string with the plain twin's name (a shorter string in the same slot, so no table grows) at prepare time, purely because we are pinned to `sos-v0.2.2`. When we re-pin onto `main` it comes out: the wrapper already answers the import, and your PR closes the last pair. Thanks for measuring instead of defending the first approach - the repro and the table made this thread much better than my report did.
oneandonlydean commented 2026-10-08 08:26:11 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-08T08:26:11Z.


Closing: on main libSceMsgDialog.native exports wTpfglkmv34, so the module binds without a dependency edge, as measured above. If a title still fails with undefined symbol on current main, please comment with the log and it can be reopened.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6055868630 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/906#issuecomment-6055868630). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-08T08:26:11Z. --- Closing: on main `libSceMsgDialog.native` exports `wTpfglkmv34`, so the module binds without a dependency edge, as measured above. If a title still fails with `undefined symbol` on current main, please comment with the log and it can be reopened.
jeffrey12cali commented 2026-10-08 11:56:26 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by jeffrey12cali on 2026-10-08T11:56:26Z.


That matches my side, and the close is correct.

Our difference was only the snapshot. On sos-v0.2.2 (c8830699) the wrapper exports five symbols and wTpfglkmv34 is not among them, which is why dlopen of the title's PSN module failed there with that exact name. On current main the wrapper declares it, so no dependency edge is needed.

Our runner still carries a title-side stopgap for the older pin, because we are 18 commits behind. It replaces the importing module's own DT_NEEDED string rather than adding a second library, so nothing new reaches the global scope. It comes out when we re-pin.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6059319991 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/906#issuecomment-6059319991). Originally posted by [jeffrey12cali](https://github.com/jeffrey12cali) on 2026-10-08T11:56:26Z. --- That matches my side, and the close is correct. Our difference was only the snapshot. On `sos-v0.2.2` (`c8830699`) the wrapper exports five symbols and `wTpfglkmv34` is not among them, which is why `dlopen` of the title's `PSN` module failed there with that exact name. On current `main` the wrapper declares it, so no dependency edge is needed. Our runner still carries a title-side stopgap for the older pin, because we are 18 commits behind. It replaces the importing module's own `DT_NEEDED` string rather than adding a second library, so nothing new reaches the global scope. It comes out when we re-pin.
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#906
No description provided.