diff --git a/core/libs/prx/libSceLibcInternal/CMakeLists.txt b/core/libs/prx/libSceLibcInternal/CMakeLists.txt index 6443b72c5..2c0060756 100644 --- a/core/libs/prx/libSceLibcInternal/CMakeLists.txt +++ b/core/libs/prx/libSceLibcInternal/CMakeLists.txt @@ -17,7 +17,7 @@ if(BUILD_TESTING) if(NOT WIN32) add_test_executable(guest_force_tls_destructor_tests ${LIBS_INCLUDE_DIR}/tests/GuestForceTlsDestructor.cpp) target_include_directories(guest_force_tls_destructor_tests PRIVATE ${LIBS_INCLUDE_DIR}) - target_link_libraries(guest_force_tls_destructor_tests PRIVATE libSceLibcInternal libkernel libc) + target_link_libraries(guest_force_tls_destructor_tests PRIVATE libSceLibcInternal libkernel libc ${CMAKE_DL_LIBS}) add_test(NAME guest_force_tls_destructor COMMAND guest_force_tls_destructor_tests) set_tests_properties(guest_force_tls_destructor PROPERTIES TIMEOUT 20) endif() diff --git a/core/libs/tests/GuestForceTlsDestructor.cpp b/core/libs/tests/GuestForceTlsDestructor.cpp index 991538f24..49264c929 100644 --- a/core/libs/tests/GuestForceTlsDestructor.cpp +++ b/core/libs/tests/GuestForceTlsDestructor.cpp @@ -1,6 +1,7 @@ #include "SceTypes.hpp" #include #include +#include #include #include @@ -68,7 +69,8 @@ bool ForceThrows(KernelModule handle) { int main() { self = ModuleOf(&dsoHandle); - void* otherDso = reinterpret_cast(&_sceLibcInternalThreadDtors_nid_postfix); + void* otherDso = dlsym(RTLD_NEXT, "_sceLibcInternalThreadDtors_nid_postfix"); + Require(otherDso != nullptr); const KernelModule other = ModuleOf(otherDso); Require(other != self && other != 0); int local = 0;