All callable functions should have an ELF size.

Signed-off-by: Josh Poimboeuf <jpoim...@redhat.com>
---
 tools/objtool/check.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/tools/objtool/check.c b/tools/objtool/check.c
index 9bf4844d9226..16454cbca679 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;
 
-- 
2.20.1

Reply via email to