feat(libc): expose 345 read-only runtime data exports #13449

Closed
kyon-eth wants to merge 11 commits from upstream-pr/13449 into main
kyon-eth commented 2026-10-30 15:08:51 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by kyon-eth on 2026-10-30T15:08:51Z.


What

Expose 345 read-only runtime data objects through libc: 146 RTTI type-name strings, six aliases to existing compiler-generated RTTI strings, 128 numeric-limit constants, 20 one-byte placeholder objects, and 45 additional floating-point, locale and standard-library constants. Each NID hashes from its corresponding public name. The strings, constant bytes, object sizes and distinct addresses match both version-labelled images; their labels do not authenticate retail firmware provenance.

The RTTI entries are name strings only; the change does not implement the corresponding type-info objects. Cross-module type-info identity, the relationship between these strings and runtime-generated RTTI objects, the numeric constants’, placeholders’ and other constants’ underlying types and title behavior are unverified. The loader's libSceLibcInternal to libc data fallback was checked with a separate macOS guest-import fixture using synthetic providers. No game unblock is claimed.

The six RTTI aliases point to existing compiler-emitted objects, preserving their storage identity in the tested macOS build. Linux and Windows alias emission remains unverified. This branch includes and depends on #13452, which teaches the public-header audit to accept data alias declarations.

The writable locale guard and facet-ID objects are excluded. Two inspected facet-ID paths in both version-labelled images assign IDs under a lock and register facets during classic-locale initialization; the current implementation has an incomplete classic facet table. The remaining paths and runtime lifecycle have not been verified.

Tested

  • Current Windows CI reported duplicate patched export name: 22g2xONdXV4 while patching libc. The branch remains draft until the provider collision is resolved and the Windows build is rechecked.

  • macOS x86-64: compiled and NID-patched a standalone data library; dynamic lookup verified the 339 standalone objects, their bytes and distinct addresses, including string terminators and numeric alignment.

  • Compiled 71 of 72 libc source files and linked them with the new data using dynamic lookup and chained fixups. NID patching succeeded and each of the 345 new NIDs appeared once; the six compiler-generated aliases had the same addresses as their native objects. The remaining archive source could not be compiled without the archive dependency. This partial link is not a full production build or a runtime test.

  • Cross-compiled the data source to Linux ELF and Windows COFF objects; the 339 standalone aliases appear once at distinct read-only offsets within their respective object files. Cross-object linking was not checked, and neither platform was run.

  • Public-header audit, conventions and whitespace checks passed. Source/added-symbol scans found no other open PR adding these names or NIDs. pr_overlap could not compare shared CMake/debt files in #5021, #5303, #6085, #7081, #7386, #7447, #7715, #8150, #8965, #9340, #9371, #9447, #9526, #9863, #10324, #10405, #10620, #10729, #11332, #11628, #11661, #11689, #11698, #12057, #12363, #12688, #12700 and #12965 because those branches conflict with main; their shared-file diffs were inspected, but future rebases may require reconciliation.

  • No full production-library build, Linux or Windows execution, console or game run was performed.

Checklist

  • Based on current main; no other open PR implements the same functions (the scanner cannot compare the branches listed above)
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: #13452
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5086532970 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/13449). Originally posted by [kyon-eth](https://github.com/kyon-eth) on 2026-10-30T15:08:51Z. --- ### What Expose 345 read-only runtime data objects through `libc`: 146 RTTI type-name strings, six aliases to existing compiler-generated RTTI strings, 128 numeric-limit constants, 20 one-byte placeholder objects, and 45 additional floating-point, locale and standard-library constants. Each NID hashes from its corresponding public name. The strings, constant bytes, object sizes and distinct addresses match both version-labelled images; their labels do not authenticate retail firmware provenance. The RTTI entries are name strings only; the change does not implement the corresponding type-info objects. Cross-module type-info identity, the relationship between these strings and runtime-generated RTTI objects, the numeric constants’, placeholders’ and other constants’ underlying types and title behavior are unverified. The loader's `libSceLibcInternal` to `libc` data fallback was checked with a separate macOS guest-import fixture using synthetic providers. No game unblock is claimed. The six RTTI aliases point to existing compiler-emitted objects, preserving their storage identity in the tested macOS build. Linux and Windows alias emission remains unverified. This branch includes and depends on #13452, which teaches the public-header audit to accept data alias declarations. The writable locale guard and facet-ID objects are excluded. Two inspected facet-ID paths in both version-labelled images assign IDs under a lock and register facets during classic-locale initialization; the current implementation has an incomplete classic facet table. The remaining paths and runtime lifecycle have not been verified. ### Tested - Current Windows CI reported `duplicate patched export name: 22g2xONdXV4` while patching libc. The branch remains draft until the provider collision is resolved and the Windows build is rechecked. - macOS x86-64: compiled and NID-patched a standalone data library; dynamic lookup verified the 339 standalone objects, their bytes and distinct addresses, including string terminators and numeric alignment. - Compiled 71 of 72 libc source files and linked them with the new data using dynamic lookup and chained fixups. NID patching succeeded and each of the 345 new NIDs appeared once; the six compiler-generated aliases had the same addresses as their native objects. The remaining archive source could not be compiled without the archive dependency. This partial link is not a full production build or a runtime test. - Cross-compiled the data source to Linux ELF and Windows COFF objects; the 339 standalone aliases appear once at distinct read-only offsets within their respective object files. Cross-object linking was not checked, and neither platform was run. - Public-header audit, conventions and whitespace checks passed. Source/added-symbol scans found no other open PR adding these names or NIDs. `pr_overlap` could not compare shared CMake/debt files in #5021, #5303, #6085, #7081, #7386, #7447, #7715, #8150, #8965, #9340, #9371, #9447, #9526, #9863, #10324, #10405, #10620, #10729, #11332, #11628, #11661, #11689, #11698, #12057, #12363, #12688, #12700 and #12965 because those branches conflict with main; their shared-file diffs were inspected, but future rebases may require reconciliation. - No full production-library build, Linux or Windows execution, console or game run was performed. ### Checklist - [ ] Based on current `main`; no other open PR implements the same functions (the scanner cannot compare the branches listed above) - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: #13452 - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes
MarcZX10 commented 2026-11-20 06:47:36 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-20T06:47:36Z.

Review: COMMENTED


Reviewed — comments

The Windows CI export collision is acknowledged in the PR description, but its conflicting export is not present in the files I could inspect, so the evidence does not support a formal merge decision.

What I ran

Reviewed head c467f9efa50ca05dfd3145e10deec321a82c5289; no build or tests were run. Read description.md, commits.md, manifest.json, diff.patch, README.md, and all changed source/header files listed as included in the manifest. Repository context was read for core/libs/prx/libc/CMakeLists.txt and core/libs/prx/libc/src/exception/Exports.cpp. No files were listed as excluded in the manifest.

Results

Check Result Note
Diff and changed files passed Read included changed files
Build and tests not run No execution environment provided
Windows export collision not verified CI report is author supplied

Findings

Blocking

None verified.

Non-blocking

  • The reported Windows failure is concrete but not independently attributable from the reviewed source: searching the repository at this head found the new 22g2xONdXV4 mapping at core/libs/prx/libc/src/RttiNames.cpp:28, while no second occurrence appeared in repository content. Please identify the other provider and resolve the collision, then rerun Windows CI before treating the branch as merge ready.

Not verified

  • No build, test suite, Linux or Windows execution, console behavior, or game behavior was run or confirmed.
  • files.json was not available as a review document; the prepared manifest indicates all 11 changed files are included and none are marked excluded.
  • The author-reported Windows CI failure and its root cause were not independently confirmed.

To get this to a good state

Nothing is required by this review. Optional: resolve the reported Windows export collision and rerun Windows CI before merge.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5988612086 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/13449#pullrequestreview-5988612086). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-20T06:47:36Z. **Review:** COMMENTED --- # Reviewed — comments The Windows CI export collision is acknowledged in the PR description, but its conflicting export is not present in the files I could inspect, so the evidence does not support a formal merge decision. ## What I ran Reviewed head `c467f9efa50ca05dfd3145e10deec321a82c5289`; no build or tests were run. Read `description.md`, `commits.md`, `manifest.json`, `diff.patch`, `README.md`, and all changed source/header files listed as included in the manifest. Repository context was read for `core/libs/prx/libc/CMakeLists.txt` and `core/libs/prx/libc/src/exception/Exports.cpp`. No files were listed as excluded in the manifest. ## Results | Check | Result | Note | |---|---|---| | Diff and changed files | passed | Read included changed files | | Build and tests | not run | No execution environment provided | | Windows export collision | not verified | CI report is author supplied | ## Findings ### Blocking None verified. ### Non-blocking - The reported Windows failure is concrete but not independently attributable from the reviewed source: searching the repository at this head found the new `22g2xONdXV4` mapping at `core/libs/prx/libc/src/RttiNames.cpp:28`, while no second occurrence appeared in repository content. Please identify the other provider and resolve the collision, then rerun Windows CI before treating the branch as merge ready. ## Not verified - No build, test suite, Linux or Windows execution, console behavior, or game behavior was run or confirmed. - `files.json` was not available as a review document; the prepared manifest indicates all 11 changed files are included and none are marked excluded. - The author-reported Windows CI failure and its root cause were not independently confirmed. ## To get this to a good state Nothing is required by this review. Optional: resolve the reported Windows export collision and rerun Windows CI before merge.
ligmaSec commented 2026-12-03 13:29:26 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by ligmaSec on 2026-12-03T13:29:26Z.

Review: COMMENTED


The complete NID-name unit suite passed all 52 tests on Linux. The branch public-header audit also passed, covering 374 libraries and 23,669 declarations.

AI-assisted: yes.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6170716965 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/13449#pullrequestreview-6170716965). Originally posted by [ligmaSec](https://github.com/ligmaSec) on 2026-12-03T13:29:26Z. **Review:** COMMENTED --- The complete NID-name unit suite passed all 52 tests on Linux. The branch public-header audit also passed, covering 374 libraries and 23,669 declarations. AI-assisted: yes.

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!13449
No description provided.