Skip to content

Commit da837bd

Browse files
Peter ZijlstraIngo Molnar
authored andcommitted
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]>
1 parent 6804c1a commit da837bd

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

tools/objtool/check.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2551,8 +2551,12 @@ static int validate_functions(struct objtool_file *file)
25512551
struct section *sec;
25522552
int warnings = 0;
25532553

2554-
for_each_sec(file, sec)
2554+
for_each_sec(file, sec) {
2555+
if (!(sec->sh.sh_flags & SHF_EXECINSTR))
2556+
continue;
2557+
25552558
warnings += validate_section(file, sec);
2559+
}
25562560

25572561
return warnings;
25582562
}

0 commit comments

Comments
 (0)