aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--darwin-bootstrap/bundle-loader.c2
-rw-r--r--lib/darwin/inject.c6
-rw-r--r--lib/substitute.h1
3 files changed, 7 insertions, 2 deletions
diff --git a/darwin-bootstrap/bundle-loader.c b/darwin-bootstrap/bundle-loader.c
index af24135..d559da3 100644
--- a/darwin-bootstrap/bundle-loader.c
+++ b/darwin-bootstrap/bundle-loader.c
@@ -154,7 +154,7 @@ static void load_bundle_list(const void *buf, size_t size) {
}
return;
invalid:
- ib_log("invalid bundle list data");
+ ib_log("invalid bundle list IPC data (substitute bug)");
}
static kern_return_t substituted_hello(mach_port_t service, int proto_version,
diff --git a/lib/darwin/inject.c b/lib/darwin/inject.c
index 0f67ccb..14b204b 100644
--- a/lib/darwin/inject.c
+++ b/lib/darwin/inject.c
@@ -615,7 +615,11 @@ int substitute_dlopen_in_pid(int pid, const char *filename, int options,
inject_start_arm[],
inject_start_arm64[];
- int target_page_size = cputype == CPU_TYPE_ARM64 ? 0x4000 : 0x1000;
+ int target_page_size =
+#if defined(__arm__) || defined(__arm64__)
+ cputype == CPU_TYPE_ARM64 ? 0x4000 :
+#endif
+ 0x1000;
kr = mach_vm_allocate(task, &target_stack, 2 * target_page_size, VM_FLAGS_ANYWHERE);
if (kr) {
asprintf(error, "couldn't allocate target stack");
diff --git a/lib/substitute.h b/lib/substitute.h
index d752d47..f75aa82 100644
--- a/lib/substitute.h
+++ b/lib/substitute.h
@@ -8,6 +8,7 @@
#include <stdlib.h>
#include <stdint.h>
+#include <stdbool.h>
#ifdef __cplusplus
extern "C" {