mirror of
https://github.com/boykopovar/AnyPS5.git
synced 2026-10-18 23:07:07 -05:00
Two defined ELF exports that are renamed to the same name, such as foo and foo_nid_disambig1, were both written as one name and the patcher exited 0, leaving a lookup that can reach only one of them. The PE and Mach-O back ends already reject this. The ELF patcher now remembers the address (st_value and st_shndx) of each patched export name and throws "duplicate patched export name" only when the name comes from a symbol at a different address. Aliases of one address are kept: the Linux libc defines __cxa_throw and __cxa_throw_nid_no_patch_cut as aliases of __cxa_throw_nid_postfix, so both become __cxa_throw, and any lookup of that name resolves to the same code. The Linux libc also exported __gxx_personality_v0 twice at different addresses: the forwarding function in Personality.cpp and the __gxx_personality_v0_nid_no_patch_cut alias of the guest personality. Drop that alias, so the name keeps only the forwarding function, as in the PE build. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>