From 92c42039bf2030549b8013357b4ec66123390fa5 Mon Sep 17 00:00:00 2001 From: Kamalesh Babulal Date: Fri, 12 Jun 2020 01:31:36 -0400 Subject: [PATCH] gcc-plugin: abort building klp module on error MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Abort building the klp module, if the code for local and non-local calls are not found instead of skipping the pass and building module, which might result in un-loadable module with the kernel error: module_64: livepatch_ext4_cond_resched: Expected nop after call, got 7fe5fb78 at ext4_setup_system_zone+0x460/0xc90 [livepatch_ext4_cond_resched] gcc would not allow me to use "can't" in the error message and throw build error: gcc-plugins/ppc64le-plugin.c:49:17: error: contraction ‘can't’ in format; use ‘cannot’ instead [-Werror=format-diag] Signed-off-by: Kamalesh Babulal --- kpatch-build/gcc-plugins/ppc64le-plugin.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/kpatch-build/gcc-plugins/ppc64le-plugin.c b/kpatch-build/gcc-plugins/ppc64le-plugin.c index 181438c..25852be 100644 --- a/kpatch-build/gcc-plugins/ppc64le-plugin.c +++ b/kpatch-build/gcc-plugins/ppc64le-plugin.c @@ -46,8 +46,7 @@ static unsigned int ppc64le_plugin_execute(void) found: if (nonlocal_code == -1 || local_code == -1 || value_nonlocal_code == -1 || value_local_code == -1) { - fprintf(stderr, PLUGIN_NAME ": can't find call instruction codes"); - return 1; + error("%s: cannot find call instruction codes", PLUGIN_NAME); } /* Convert local calls to non-local */