From be0ef0cc28fce7e699d431ee15d68ac5631c7321 Mon Sep 17 00:00:00 2001 From: kd-11 Date: Sat, 24 Aug 2024 04:55:51 +0300 Subject: [PATCH] macos - Fix crash executing resolver --- rpcs3/Emu/Cell/PPUThread.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/rpcs3/Emu/Cell/PPUThread.cpp b/rpcs3/Emu/Cell/PPUThread.cpp index 6e0f8865fd..1997a13b14 100644 --- a/rpcs3/Emu/Cell/PPUThread.cpp +++ b/rpcs3/Emu/Cell/PPUThread.cpp @@ -5170,8 +5170,18 @@ bool ppu_initialize(const ppu_module& info, bool check_only, u64 file_size) ensure(jit_mod.symbol_resolver); } +#ifdef __APPLE__ + // Symbol resolver is in JIT mem, so we must enable execution + pthread_jit_write_protect_np(true); +#endif + jit_mod.symbol_resolver(vm::g_exec_addr, info.segs[0].addr); +#ifdef __APPLE__ + // Symbol resolver is in JIT mem, so we must enable execution + pthread_jit_write_protect_np(false); +#endif + // Find a BLR-only function in order to copy it to all BLRs (some games need it) for (const auto& func : info.funcs) {