aboutsummaryrefslogtreecommitdiff
path: root/lib/hook-functions.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--lib/hook-functions.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/hook-functions.c b/lib/hook-functions.c
index 1c96d61..310b839 100644
--- a/lib/hook-functions.c
+++ b/lib/hook-functions.c
@@ -237,7 +237,8 @@ int substitute_hook_functions(const struct substitute_function_hook *hooks,
hi->outro_trampoline++;
#endif
if (hook->old_ptr)
- *(void **) hook->old_ptr = hi->outro_trampoline;
+ *(uintptr_t *) hook->old_ptr = trampoline_addr +
+ (uintptr_t)(hi->outro_trampoline - outro_trampoline_real);
/* Generate the rewritten start of the function for the outro
* trampoline (complaining if any bad instructions are found)