diff --git a/README.md b/README.md index 16eb1efc2..6d3b5db37 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ Converter for native execution of PlayStation 5 ELF binaries on Linux through bi ## Status -Execution reaches `_start`, stack unwinding and exception handling tables are built - an unhandled exception from the `memset` implementation (`libc memset not implemented`) is printed to stderr and terminates the process. +Execution reaches `_start`, stack unwinding and exception handling tables are built. All unimplemented stub functions throw std::runtime_error. `what()` is printed to stderr and the process terminates. Now: `sceKernelGetDirectMemorySize not implemented` ## Disclaimer diff --git a/core/libs/prx/libc/Export.cpp b/core/libs/prx/libc/Export.cpp index c3fe9013d..5972ab5aa 100644 --- a/core/libs/prx/libc/Export.cpp +++ b/core/libs/prx/libc/Export.cpp @@ -2,6 +2,7 @@ #include #include "SceTypes.hpp" +#include "src/General.cpp" #include "src/specifics/gcc/StackGuard.cpp" #include "src/specifics/linux/DlIteratePhdr.cpp" #include "src/Strings.cpp" diff --git a/core/libs/prx/libc/include/General.hpp b/core/libs/prx/libc/include/General.hpp index 72085eb73..194173cd0 100644 --- a/core/libs/prx/libc/include/General.hpp +++ b/core/libs/prx/libc/include/General.hpp @@ -1,11 +1,6 @@ #ifndef CORE_LIBS_PRX_LIBC_INCLUDE_GENERAL_HPP #define CORE_LIBS_PRX_LIBC_INCLUDE_GENERAL_HPP -#include -#include - -inline void NotImplemented_nid_no_patch(const char* funcName) { - throw std::runtime_error(std::string(funcName) + " not implemented"); -} +void NotImplemented_nid_no_patch(const char* funcName); #endif diff --git a/core/libs/prx/libc/src/General.cpp b/core/libs/prx/libc/src/General.cpp new file mode 100644 index 000000000..e70f3d513 --- /dev/null +++ b/core/libs/prx/libc/src/General.cpp @@ -0,0 +1,6 @@ +#include +#include + +extern "C" void NotImplemented_nid_no_patch(const char* funcName) { + throw std::runtime_error(std::string(funcName) + " not implemented"); +}