diff options
author | Peter Zijlstra <[email protected]> | 2020-03-23 21:11:14 +0100 |
---|---|---|
committer | Ingo Molnar <[email protected]> | 2020-04-22 10:53:51 +0200 |
commit | da837bd6f1994f780325649e8eee7d9b01c5ee4d (patch) | |
tree | 04502b674e4276167225554e8a192d34c0d17b34 | |
parent | 6804c1afd794c8135351faaa69e1503ee11393ac (diff) |
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) <[email protected]>
Reviewed-by: Miroslav Benes <[email protected]>
Reviewed-by: Alexandre Chartre <[email protected]>
Acked-by: Josh Poimboeuf <[email protected]>
Link: https://lkml.kernel.org/r/[email protected]
Signed-off-by: Ingo Molnar <[email protected]>
-rw-r--r-- | tools/objtool/check.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/tools/objtool/check.c b/tools/objtool/check.c index 923652ba5f9a..e201aa1d01f5 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; } |