diff options
| author | Josh Poimboeuf <jpoimboe@kernel.org> | 2026-03-19 01:42:30 +0300 |
|---|---|---|
| committer | Josh Poimboeuf <jpoimboe@kernel.org> | 2026-05-05 07:16:05 +0300 |
| commit | 8eebd573113362ef3a3c75f166a83ee060dae11b (patch) | |
| tree | 29f0c3cfe698f88cff4d424c89a331bf919960c0 /tools | |
| parent | ff0cf5efef40e3b60e7bb27a6072f9a0c6e4c5ce (diff) | |
| download | linux-8eebd573113362ef3a3c75f166a83ee060dae11b.tar.xz | |
objtool: Add is_alias_sym() helper
Improve readability with a new is_alias_sym() helper.
No functional changes intended.
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Acked-by: Song Liu <song@kernel.org>
Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>
Diffstat (limited to 'tools')
| -rw-r--r-- | tools/objtool/check.c | 6 | ||||
| -rw-r--r-- | tools/objtool/include/objtool/elf.h | 5 |
2 files changed, 8 insertions, 3 deletions
diff --git a/tools/objtool/check.c b/tools/objtool/check.c index f020f21f94a7..6c94eb32c090 100644 --- a/tools/objtool/check.c +++ b/tools/objtool/check.c @@ -491,7 +491,7 @@ static int decode_instructions(struct objtool_file *file) return -1; } - if (func->embedded_insn || func->alias != func) + if (func->embedded_insn || is_alias_sym(func)) continue; if (!find_insn(file, sec, func->offset)) { @@ -2229,7 +2229,7 @@ static int add_jump_table_alts(struct objtool_file *file) return 0; for_each_sym(file->elf, func) { - if (!is_func_sym(func) || func->alias != func) + if (!is_func_sym(func) || is_alias_sym(func)) continue; mark_func_jump_tables(file, func); @@ -4523,7 +4523,7 @@ static int validate_symbol(struct objtool_file *file, struct section *sec, return 1; } - if (sym->pfunc != sym || sym->alias != sym) + if (sym->pfunc != sym || is_alias_sym(sym)) return 0; insn = find_insn(file, sec, sym->offset); diff --git a/tools/objtool/include/objtool/elf.h b/tools/objtool/include/objtool/elf.h index 8a543cea43b9..ccc72a692d9a 100644 --- a/tools/objtool/include/objtool/elf.h +++ b/tools/objtool/include/objtool/elf.h @@ -298,6 +298,11 @@ static inline bool is_local_sym(struct symbol *sym) return sym->bind == STB_LOCAL; } +static inline bool is_alias_sym(struct symbol *sym) +{ + return sym->alias != sym; +} + static inline bool is_prefix_func(struct symbol *sym) { return sym->prefix; |
