From: Peter Zijlstra Date: Mon, 23 Mar 2020 20:11:14 +0000 (+0100) Subject: objtool: Avoid iterating !text section symbols X-Git-Tag: v5.15~3783^2~30 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=da837bd6f1994f780325649e8eee7d9b01c5ee4d;p=platform%2Fkernel%2Flinux-starfive.git objtool: Avoid iterating !text section symbols validate_functions() iterates all sections their symbols; this is pointless to do for !text sections as they won't have instructions anyway. Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Miroslav Benes Reviewed-by: Alexandre Chartre Acked-by: Josh Poimboeuf Link: https://lkml.kernel.org/r/20200416115119.346582716@infradead.org Signed-off-by: Ingo Molnar --- diff --git a/tools/objtool/check.c b/tools/objtool/check.c index 923652b..e201aa1 100644 --- a/tools/objtool/check.c +++ b/tools/objtool/check.c @@ -2551,8 +2551,12 @@ static int validate_functions(struct objtool_file *file) struct section *sec; int warnings = 0; - for_each_sec(file, sec) + for_each_sec(file, sec) { + if (!(sec->sh.sh_flags & SHF_EXECINSTR)) + continue; + warnings += validate_section(file, sec); + } return warnings; }