| Date | Wed, 22 Apr 2020 22:24:30 -0000 | From | "tip-bot2 for Peter Zijlstra" <> | Subject | [tip: objtool/core] objtool: Avoid iterating !text section symbols |
| |
The following commit has been merged into the objtool/core branch of tip:
Commit-ID: 32cd779457c84c3d0ef34f9b45854f1c876395dc Gitweb: https://git.kernel.org/tip/32cd779457c84c3d0ef34f9b45854f1c876395dc Author: Peter Zijlstra <peterz@infradead.org> AuthorDate: Mon, 23 Mar 2020 21:11:14 +01:00 Committer: Peter Zijlstra <peterz@infradead.org> CommitterDate: Wed, 22 Apr 2020 23:10:08 +02:00
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) <peterz@infradead.org> Reviewed-by: Miroslav Benes <mbenes@suse.cz> Reviewed-by: Alexandre Chartre <alexandre.chartre@oracle.com> Acked-by: Josh Poimboeuf <jpoimboe@redhat.com> Link: https://lkml.kernel.org/r/20200416115119.346582716@infradead.org --- tools/objtool/check.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/tools/objtool/check.c b/tools/objtool/check.c index 584f221..ef082a3 100644 --- a/tools/objtool/check.c +++ b/tools/objtool/check.c @@ -2567,8 +2567,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; }
|