Skip to content

Commit 61e9b75

Browse files
jpoimboeKAGA-KOKO
authored andcommitted
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
1 parent e10cd8f commit 61e9b75

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

‎tools/objtool/check.c‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2357,6 +2357,12 @@ static int validate_functions(struct objtool_file *file)
23572357
if (func->type != STT_FUNC)
23582358
continue;
23592359

2360+
if (!func->len) {
2361+
WARN("%s() is missing an ELF size annotation",
2362+
func->name);
2363+
warnings++;
2364+
}
2365+
23602366
if (func->pfunc != func || func->alias != func)
23612367
continue;
23622368

0 commit comments

Comments
 (0)