Merge pull request #1295 from TibixDev/pr/tls-destructor-test

test(libc): resolve the library address in the TLS destructor test
This commit is contained in:
Dean
2026-10-08 18:23:12 +13:00
committed by GitHub
2 changed files with 4 additions and 2 deletions
@@ -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()
+3 -1
View File
@@ -1,6 +1,7 @@
#include "SceTypes.hpp"
#include <cstdint>
#include <cstdlib>
#include <dlfcn.h>
#include <stdexcept>
#include <vector>
@@ -68,7 +69,8 @@ bool ForceThrows(KernelModule handle) {
int main() {
self = ModuleOf(&dsoHandle);
void* otherDso = reinterpret_cast<void*>(&_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;