feat(libc): fundamental and pointer RTTI records #106

Closed
asimplestray wants to merge 1 commit from upstream-pr/106 into main
asimplestray commented 2026-09-28 21:52:43 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by asimplestray on 2026-09-28T21:52:43Z.


What

Declares the C++ ABI data a real game (Hades, 1006 imports) needs at load: the loader died on undefined symbol: aeHxLWwq0gQ with BIND_NOW, so every one of these blocks boot.

  • Fundamental/pointer/function/enum __class_type_info category tables and meta-vtables (_ZTVN10__cxxabiv119__pointer_type_infoE, _ZTVN10__cxxabiv120__function_type_infoE, _ZTVN10__cxxabiv116__enum_type_infoE), mirroring the existing ClassTypeVtable/SingleTypeVtable shape so the repo's Match/Bases matcher (which already handles pointer conversions) keeps working.
  • Type records _ZTIb/i/l/v/d/f/Dn/PKc with Itanium mangled names.
  • rewind (FileStream via fseeko + clearerr) and wcsftime (plain std::wcsftime passthrough, next to strftime).

Names were identified by hashing OpenOrbis-PS4-Toolchain identifiers with the PS5 NID suffix and matching the game's import NIDs (252 hits); each name in this PR is proven by hash equality with the imported NID.

Scope notes: setjmp/longjmp (guest/host jmp_buf layout differs) and _Mtx_*/_Cosh/_Sinh (signatures unconfirmed) are deliberately left out for follow-ups.

Tested

Linux (GCC 16, BUILD_TESTING=ON): full build, ctest 56/56 pass, including extended exception_runtime (record names + kinds for all 8 new records and the 3 meta-vtables) and guest_standard_streams (rewind reposition + error-clear). Patched libc.prx now exports all 13 NIDs (verified with nm -D); the relinked Hades binary advances past them at load and now stops at the next unidentified import (p6lrRW8-MLY, single call site, follow-up).

Checklist

  • Based on current main; no other open PR implements the same functions (checked #77-86, #98, #101)
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (no new stubs; setjmp family untouched)
  • 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 (none added)
  • Generic behaviour, not specific to one title
  • Depends on: none
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4669740357 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/106). Originally posted by [asimplestray](https://github.com/asimplestray) on 2026-09-28T21:52:43Z. --- ### What Declares the C++ ABI data a real game (Hades, 1006 imports) needs at load: the loader died on `undefined symbol: aeHxLWwq0gQ` with `BIND_NOW`, so every one of these blocks boot. - Fundamental/pointer/function/enum `__class_type_info` category tables and meta-vtables (`_ZTVN10__cxxabiv119__pointer_type_infoE`, `_ZTVN10__cxxabiv120__function_type_infoE`, `_ZTVN10__cxxabiv116__enum_type_infoE`), mirroring the existing `ClassTypeVtable`/`SingleTypeVtable` shape so the repo's `Match`/`Bases` matcher (which already handles pointer conversions) keeps working. - Type records `_ZTIb/i/l/v/d/f/Dn/PKc` with Itanium mangled names. - `rewind` (`FileStream` via `fseeko` + `clearerr`) and `wcsftime` (plain `std::wcsftime` passthrough, next to `strftime`). Names were identified by hashing OpenOrbis-PS4-Toolchain identifiers with the PS5 NID suffix and matching the game's import NIDs (252 hits); each name in this PR is proven by hash equality with the imported NID. Scope notes: `setjmp`/`longjmp` (guest/host `jmp_buf` layout differs) and `_Mtx_*`/`_Cosh`/`_Sinh` (signatures unconfirmed) are deliberately left out for follow-ups. ### Tested Linux (GCC 16, `BUILD_TESTING=ON`): full build, `ctest` 56/56 pass, including extended `exception_runtime` (record names + kinds for all 8 new records and the 3 meta-vtables) and `guest_standard_streams` (rewind reposition + error-clear). Patched `libc.prx` now exports all 13 NIDs (verified with `nm -D`); the relinked Hades binary advances past them at load and now stops at the next unidentified import (`p6lrRW8-MLY`, single call site, follow-up). ### Checklist - [x] Based on current `main`; no other open PR implements the same functions (checked #77-86, #98, #101) - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except technical debt - [x] Unimplemented paths throw (no new stubs; `setjmp` family untouched) - [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 (none added) - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] AI-assisted: yes
boykopovar commented 2026-09-29 08:09:36 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by boykopovar on 2026-09-29T08:09:36Z.


Are the new exported symbols specific to a specific game? If so, they're likely present in that game's files in the sce_module folder. Relinker should be able to adapt files from there. If it doesn't work for your game, the problem is with Relinker. The prx files should only contain functions common to all games.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:5886265366 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/106#issuecomment-5886265366). Originally posted by [boykopovar](https://github.com/boykopovar) on 2026-09-29T08:09:36Z. --- Are the new exported symbols specific to a specific game? If so, they're likely present in that game's files in the sce_module folder. Relinker should be able to adapt files from there. If it doesn't work for your game, the problem is with Relinker. The prx files should only contain functions common to all games.
asimplestray commented 2026-09-29 20:16:10 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by asimplestray on 2026-09-29T20:16:10Z.


oh, ok. thanks

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:5897958031 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/106#issuecomment-5897958031). Originally posted by [asimplestray](https://github.com/asimplestray) on 2026-09-29T20:16:10Z. --- oh, ok. thanks

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!106
No description provided.