mirror of
https://github.com/boykopovar/AnyPS5.git
synced 2026-10-21 08:12:09 -05:00
On Linux every module resolves its references through one global scope, and the guest modules are listed ahead of the host prx. When a title bundles its own libc.prx, the host libc and the other host prx bound their references to their own NIDs to the guest libc, so the host libc built its standard streams on top of the guest _Stdout. The exports of guest modules, and the guest and executable imports that a guest module satisfies, now carry a #guest suffix. The title's imports still reach the guest modules first, and a host prx only sees host definitions, as on Windows. sceKernelDlsym also looks for the suffixed name.
21 lines
695 B
C++
21 lines
695 B
C++
#include "prx/libc/include/general/VabiMacros.hpp"
|
|
#include "prx/libc/include/general/ExportMacros.hpp"
|
|
#ifdef _WIN32
|
|
#define MODULE_EXPORT __declspec(dllexport)
|
|
#else
|
|
#define MODULE_EXPORT __attribute__((visibility("default")))
|
|
#endif
|
|
extern "C" MODULE_EXPORT int APS5_VABI GuestModuleAdd_nid_postfix(int a, int b) {
|
|
return a + b;
|
|
}
|
|
#ifndef _WIN32
|
|
extern "C" MODULE_EXPORT int APS5_VABI GuestModuleMul_nid_no_patch(int a, int b) {
|
|
return a * b;
|
|
}
|
|
APS5_EXPORT("GuestModuleMul#guest", GuestModuleMul_nid_no_patch);
|
|
extern "C" MODULE_EXPORT int APS5_VABI GuestModuleSub_nid_no_patch(int a, int b) {
|
|
return a - b;
|
|
}
|
|
APS5_EXPORT("BOyBJaKwOa8#guest", GuestModuleSub_nid_no_patch);
|
|
#endif
|