From 8672a5cc3dacceeef33b608e46406120110a7b04 Mon Sep 17 00:00:00 2001 From: boykopovar Date: Sat, 22 Aug 2026 11:18:42 +0300 Subject: [PATCH] fix(libs): libc export flag name fix --- core/libs/prx/libc/Export.cpp | 2 +- core/relinker/src/output/SysVDynamicSectionBuilder.cpp | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/core/libs/prx/libc/Export.cpp b/core/libs/prx/libc/Export.cpp index bfd399c7b..ca7162785 100644 --- a/core/libs/prx/libc/Export.cpp +++ b/core/libs/prx/libc/Export.cpp @@ -4,7 +4,7 @@ #include #include "SceTypes.hpp" -uint32_t g_need_flag = 1; +uint32_t Need_sceLibc = 1; extern "C" { diff --git a/core/relinker/src/output/SysVDynamicSectionBuilder.cpp b/core/relinker/src/output/SysVDynamicSectionBuilder.cpp index 0dcc2699c..1490ee65a 100644 --- a/core/relinker/src/output/SysVDynamicSectionBuilder.cpp +++ b/core/relinker/src/output/SysVDynamicSectionBuilder.cpp @@ -71,9 +71,15 @@ SysVDynamicSection SysVDynamicSectionBuilder::BuildDynamicSection( _appendElfSym(result.DynSymData, 0, 0, 0, 0, 0, 0); + auto stripHashSuffix = [](const std::string& value) -> std::string { + const auto hashPos = value.find('#'); + if (hashPos == std::string::npos) return value; + return value.substr(0, hashPos); + }; + std::uint32_t symIdx = 1; for (const auto& ref : nidReferences) { - const std::uint32_t nameOff = _appendStr(result.DynStrData, ref.Nid); + const std::uint32_t nameOff = _appendStr(result.DynStrData, stripHashSuffix(ref.Nid)); const auto info = static_cast((STB_GLOBAL << 4) | STT_FUNC); _appendElfSym(result.DynSymData, nameOff, info, STV_DEFAULT, 0, 0, 0);