diff --git a/tools/objtool/check.c b/tools/objtool/check.c index 8d073bfd7d7f..ae0c94285124 100644 --- a/tools/objtool/check.c +++ b/tools/objtool/check.c @@ -236,14 +236,14 @@ static bool __dead_end_function(struct objtool_file *file, struct symbol *func, if (!func) return false; - if (func->bind == STB_WEAK) - return false; - - if (func->bind == STB_GLOBAL) + if (func->bind == STB_GLOBAL || func->bind == STB_WEAK) for (i = 0; i < ARRAY_SIZE(global_noreturns); i++) if (!strcmp(func->name, global_noreturns[i])) return true; + if (func->bind == STB_WEAK) + return false; + if (!func->len) return false;