feat(libc): export std::numpunct<wchar_t> id and _Getcat #11773
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/11773"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by edubox on 2026-10-27T07:35:33Z.
What
Export
std::numpunct<wchar_t>::id(XZNi3XtbWQ4) and implementstd::numpunct<wchar_t>::_Getcat(SdXFaufpLIs), the two unversioned libc symbols that thelibc.prxof Rayman 30 Aniversario (PPSA33016) and Fatal Frame II (PPSA32802) import and AnyPS5 does not export.The facet is the same 0x30-byte C-locale object as the narrow
numpunct<char>:groupingis a narrow string pointer at offset 0x10,falsenameandtruenameare pointers to 16-bit strings at offsets 0x20 and 0x28, anddecimal_pointandthousands_separe 16-bit values at 0x18 and 0x1a. Thegroupingvirtual writes the narrow string with the narrow size and capacity rules (inline capacity 15, heap capacitylength | 15), whilefalsenameandtruenamewrite the guest 16-bit string with the same rules ascollate<wchar_t>::do_transform(inline capacity 7, heap capacitylength | 7, two bytes per unit)._Getcatreturns 4, as the narrow entry does.Console evidence: in the
libc.prxshipped by PPSA33016 (unwrapped, dynsym),XZNi3XtbWQ4is an 8-byteSTT_OBJECTin.data, andSdXFaufpLIsis a 0x17b-byte function at 0xa2670 that allocates 0x30 bytes, stores the vtable, the empty grouping string, 16-bit'.'and',', pointers to the 16-bit strings"false"and"true", and returns 4.Tested
guest_locale_testspasses. The new checks cover the wide id's 8-byte size, the facet's 16-bit./,, the narrow empty grouping, and the 16-bit"false"/"true"._Cnd_register_at_thread_exit/_Cnd_unregister_at_thread_exitpair, so that run used a local build that includes those registrations; this PR does not depend on that work.__stack_chk_fail) that never reaches the wide facet, so it is not used as evidence here.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)