aboutsummaryrefslogtreecommitdiff
path: root/lib/hook-functions.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/hook-functions.c')
-rw-r--r--lib/hook-functions.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/hook-functions.c b/lib/hook-functions.c
index 674d424..d2fabe9 100644
--- a/lib/hook-functions.c
+++ b/lib/hook-functions.c
@@ -147,6 +147,7 @@ int substitute_hook_functions(const struct substitute_function_hook *hooks,
#else
bool thread_safe = false;
#endif
+ bool relaxed = !!(options & SUBSTITUTE_RELAXED);
if (recordp)
*recordp = NULL;
@@ -248,7 +249,8 @@ int substitute_hook_functions(const struct substitute_function_hook *hooks,
if ((ret = transform_dis_main(code, &trampoline_ptr, pc_patch_start,
&pc_patch_end, trampoline_addr,
&arch, hi->offset_by_pcdiff,
- thread_safe ? TRANSFORM_DIS_BAN_CALLS : 0)))
+ (thread_safe ? TRANSFORM_DIS_BAN_CALLS : 0) |
+ (relaxed ? 0 : TRANSFORM_DIS_REL_JUMPS))))
goto end;
trampoline_addr += (trampoline_ptr - trampoline_prev);