aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJosh Poimboeuf <jpoimboe@redhat.com>2019-07-17 21:36:49 -0400
committerThomas Gleixner <tglx@linutronix.de>2019-07-18 15:01:07 -0400
commit61e9b75a0ccf1fecacc28a2d77ea4a19aa404e39 (patch)
treebd51bf0c1091f2620f5adb159b194948fa73f433
parente10cd8fe8ddfd28a172d2be57ae0e90c7f752e6a (diff)
objtool: Warn on zero-length functions
All callable functions should have an ELF size. Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Tested-by: Nick Desaulniers <ndesaulniers@google.com> Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org> Link: https://lkml.kernel.org/r/03d429c4fa87829c61c5dc0e89652f4d9efb62f1.1563413318.git.jpoimboe@redhat.com
-rw-r--r--tools/objtool/check.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/tools/objtool/check.c b/tools/objtool/check.c
index 3f8664b0e3f9..dece3253ff6a 100644
--- a/tools/objtool/check.c
+++ b/tools/objtool/check.c
@@ -2357,6 +2357,12 @@ static int validate_functions(struct objtool_file *file)
2357 if (func->type != STT_FUNC) 2357 if (func->type != STT_FUNC)
2358 continue; 2358 continue;
2359 2359
2360 if (!func->len) {
2361 WARN("%s() is missing an ELF size annotation",
2362 func->name);
2363 warnings++;
2364 }
2365
2360 if (func->pfunc != func || func->alias != func) 2366 if (func->pfunc != func || func->alias != func)
2361 continue; 2367 continue;
2362 2368