aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/darwin/interpose.c8
-rw-r--r--lib/darwin/objc.c8
2 files changed, 9 insertions, 7 deletions
diff --git a/lib/darwin/interpose.c b/lib/darwin/interpose.c
index 419fc65..dd267ac 100644
--- a/lib/darwin/interpose.c
+++ b/lib/darwin/interpose.c
@@ -101,7 +101,7 @@ static int try_bind_section(void *bind, size_t size, const struct interpose_stat
if ((uint32_t) new != new) {
/* text rels should only show up on i386, where
* this is impossible... */
- panic("bad TEXT_ABSOLUTE32 rel\n");
+ substitute_panic("bad TEXT_ABSOLUTE32 rel\n");
}
old = __atomic_exchange_n((uint32_t *) p, (uint32_t) new, __ATOMIC_RELAXED);
break;
@@ -111,14 +111,14 @@ static int try_bind_section(void *bind, size_t size, const struct interpose_stat
uintptr_t rel = new - pc;
if ((uint32_t) rel != rel) {
/* ditto */
- panic("bad TEXT_ABSOLUTE32 rel\n");
+ substitute_panic("bad TEXT_ABSOLUTE32 rel\n");
}
old = __atomic_exchange_n((uint32_t *) p, (uint32_t) rel, __ATOMIC_RELAXED);
old += pc;
break;
}
default:
- panic("unknown relocation type\n");
+ substitute_panic("unknown relocation type\n");
break;
}
if (h->old_ptr)
@@ -151,7 +151,7 @@ int substitute_interpose_imports(const struct substitute_image *image,
int ret = SUBSTITUTE_OK;
if (options != 0)
- panic("%s: unrecognized options\n", __func__);
+ substitute_panic("%s: unrecognized options\n", __func__);
struct interpose_state st;
st.slide = image->slide;
diff --git a/lib/darwin/objc.c b/lib/darwin/objc.c
index 398e3e7..d457581 100644
--- a/lib/darwin/objc.c
+++ b/lib/darwin/objc.c
@@ -55,7 +55,8 @@ static int get_trampoline(void *func, void *arg1, void *arg2, void *tramp_ptr) {
struct tramp_info_page_header *header = LIST_FIRST(&tramp_free_page_list);
if (!header) {
if (PAGE_SIZE > _PAGE_SIZE)
- panic("%s: strange PAGE_SIZE %x\n", __func__, PAGE_SIZE);
+ substitute_panic("%s: strange PAGE_SIZE %lx\n",
+ __func__, (long) PAGE_SIZE);
void *new_pages = mmap(NULL, _PAGE_SIZE * 2, PROT_READ | PROT_WRITE,
MAP_SHARED | MAP_ANON, -1, 0);
if (new_pages == MAP_FAILED) {
@@ -125,7 +126,7 @@ static void free_trampoline(void *tramp) {
struct tramp_info_page_header *header = page + 2 * _PAGE_SIZE - sizeof(*header);
if (header->magic != TRAMP_MAGIC)
- panic("%s: bad pointer\n", __func__);
+ substitute_panic("%s: bad pointer\n", __func__);
if (header->version != TRAMP_VERSION) {
/* shouldn't happen, but just in case multiple versions of this library
* are mixed up */
@@ -185,7 +186,8 @@ int substitute_hook_objc_message(Class class, SEL selector, void *replacement,
* the meantime, since we found the method above and it
* couldn't have been found in a superclass, but the objc2
* runtime doesn't allow removing methods. */
- panic("%s: no superclass but the method didn't exist\n", __func__);
+ substitute_panic("%s: no superclass but the method didn't exist\n",
+ __func__);
}
ret = get_trampoline(class_getMethodImplementation, super, selector, old_ptr);
if (created_imp_ptr)