From 7a07c08abe46f97f2412f06c77204e9015f97a47 Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Thu, 18 Dec 2025 21:35:50 +0000 Subject: Move to a shared static RWX section Does away with the need to mark a region as executable on load. Also allows the self-modified stuff and hook trampolines to fit in the same page, so we take up ever-so-slightly less memory. Unfortunately I had issues getting the test binary to build correctly and eventually decided to give up as it wasn't testing much of value anyway. Also note that the build now allows for .c and .S files with the same basename, which required renaming the .o files, so you might want to clean out your .build/ directory before building this one. --- src/sst.c | 4 ---- 1 file changed, 4 deletions(-) (limited to 'src/sst.c') diff --git a/src/sst.c b/src/sst.c index 17e020f..64dd303 100644 --- a/src/sst.c +++ b/src/sst.c @@ -540,10 +540,6 @@ static void hook_plugin_unload_cbv2(struct con_cmdargs *args) { } static bool do_load(ifacefactory enginef, ifacefactory serverf) { - if_cold (!hook_init()) { - errmsg_warnsys("couldn't set up memory for function hooking"); - return false; - } factory_engine = enginef; factory_server = serverf; if_cold (!engineapi_init(ifacever)) return false; if (GAMETYPE_MATCHES(OE)) shuntvars(); // see also comment in con_detect() -- cgit v1.2.3-54-g00ecf