]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
objtool: Add is_alias_sym() helper
authorJosh Poimboeuf <jpoimboe@kernel.org>
Wed, 18 Mar 2026 22:42:30 +0000 (15:42 -0700)
committerJosh Poimboeuf <jpoimboe@kernel.org>
Tue, 5 May 2026 04:16:05 +0000 (21:16 -0700)
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>
tools/objtool/check.c
tools/objtool/include/objtool/elf.h

index f020f21f94a7635bf9e24f1ca7c130a7efc894b3..6c94eb32c0901230707bb1da138b4db5e66691ce 100644 (file)
@@ -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);
index 8a543cea43b90cf650a5494975d2a1bcf86d7ea6..ccc72a692d9a685e533e0da6b1ebd6434e878230 100644 (file)
@@ -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;