From: Josh Poimboeuf Date: Thu, 18 Jul 2019 01:36:49 +0000 (-0500) Subject: objtool: Warn on zero-length functions X-Git-Tag: v5.3-rc1~11^2~8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=61e9b75a0ccf1fecacc28a2d77ea4a19aa404e39;p=thirdparty%2Fkernel%2Flinux.git objtool: Warn on zero-length functions All callable functions should have an ELF size. Signed-off-by: Josh Poimboeuf Signed-off-by: Thomas Gleixner Tested-by: Nick Desaulniers Acked-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/03d429c4fa87829c61c5dc0e89652f4d9efb62f1.1563413318.git.jpoimboe@redhat.com --- diff --git a/tools/objtool/check.c b/tools/objtool/check.c index 3f8664b0e3f94..dece3253ff6a4 100644 --- a/tools/objtool/check.c +++ b/tools/objtool/check.c @@ -2357,6 +2357,12 @@ static int validate_functions(struct objtool_file *file) if (func->type != STT_FUNC) continue; + if (!func->len) { + WARN("%s() is missing an ELF size annotation", + func->name); + warnings++; + } + if (func->pfunc != func || func->alias != func) continue;