diff --git a/kpatch-build/create-diff-object.c b/kpatch-build/create-diff-object.c index 25710e92..943d1af0 100644 --- a/kpatch-build/create-diff-object.c +++ b/kpatch-build/create-diff-object.c @@ -237,6 +237,7 @@ static void kpatch_bundle_symbols(struct kpatch_elf *kelf) { struct symbol *sym; unsigned int expected_offset; + unsigned int directcall_offset = 16; list_for_each_entry(sym, &kelf->symbols, list) { if (is_bundleable(sym)) { @@ -247,7 +248,8 @@ static void kpatch_bundle_symbols(struct kpatch_elf *kelf) else expected_offset = 0; - if (sym->sym.st_value != expected_offset) { + if (sym->sym.st_value != expected_offset && + !(getenv("CONFIG_DYNAMIC_FTRACE_WITH_DIRECT_CALLS") && sym->sym.st_value == directcall_offset)) { ERROR("symbol %s at offset %lu within section %s, expected %u", sym->name, sym->sym.st_value, sym->sec->name, expected_offset); diff --git a/kpatch-build/kpatch-build b/kpatch-build/kpatch-build index 366adead..d53ba1bb 100755 --- a/kpatch-build/kpatch-build +++ b/kpatch-build/kpatch-build @@ -1186,6 +1186,8 @@ else KBUILD_EXTRA_SYMBOLS="$SYMVERSFILE" fi +grep -q "CONFIG_DYNAMIC_FTRACE_WITH_DIRECT_CALLS=y" "$CONFIGFILE" && export CONFIG_DYNAMIC_FTRACE_WITH_DIRECT_CALLS=1 + # unsupported kernel option checking [[ -n "$CONFIG_DEBUG_INFO_SPLIT" ]] && die "kernel option 'CONFIG_DEBUG_INFO_SPLIT' not supported" [[ -n "$CONFIG_GCC_PLUGIN_LATENT_ENTROPY" ]] && die "kernel option 'CONFIG_GCC_PLUGIN_LATENT_ENTROPY' not supported"