summaryrefslogtreecommitdiffstats
path: root/tools/objtool/klp-diff.c
diff options
context:
space:
mode:
authorWentong Tian <tianwentong2000@gmail.com>2026-01-22 22:44:04 +0800
committerJosh Poimboeuf <jpoimboe@kernel.org>2026-03-06 08:08:19 -0800
commitc19c854b307424c745dd6de73eea8db099c79408 (patch)
tree961e62a38896a8e7c7ee7812d13555946468ff95 /tools/objtool/klp-diff.c
parent11439c4635edd669ae435eec308f4ab8a0804808 (diff)
downloadlinux-c19c854b307424c745dd6de73eea8db099c79408.tar.gz
linux-c19c854b307424c745dd6de73eea8db099c79408.zip
objtool: Use section/symbol type helpers
Commit 25eac74b6bdb ("objtool: Add section/symbol type helpers") introduced several helper macros to improve code readability. Update the remaining open-coded checks in check.c, disas.c, elf.c, and klp-diff.c to use these new helpers. Signed-off-by: Wentong Tian <tianwentong2000@gmail.com> Link: https://patch.msgid.link/20260122144404.40602-1-tianwentong2000@gmail.com Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>
Diffstat (limited to 'tools/objtool/klp-diff.c')
-rw-r--r--tools/objtool/klp-diff.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/tools/objtool/klp-diff.c b/tools/objtool/klp-diff.c
index 9f1f4011eb9c..885775f6072e 100644
--- a/tools/objtool/klp-diff.c
+++ b/tools/objtool/klp-diff.c
@@ -271,7 +271,7 @@ static bool is_uncorrelated_static_local(struct symbol *sym)
*/
static bool is_clang_tmp_label(struct symbol *sym)
{
- return sym->type == STT_NOTYPE &&
+ return is_notype_sym(sym) &&
is_text_sec(sym->sec) &&
strstarts(sym->name, ".Ltmp") &&
isdigit(sym->name[5]);
@@ -480,7 +480,7 @@ static unsigned long find_sympos(struct elf *elf, struct symbol *sym)
if (sym->bind != STB_LOCAL)
return 0;
- if (vmlinux && sym->type == STT_FUNC) {
+ if (vmlinux && is_func_sym(sym)) {
/*
* HACK: Unfortunately, symbol ordering can differ between
* vmlinux.o and vmlinux due to the linker script emitting
@@ -1046,8 +1046,8 @@ static int clone_reloc_klp(struct elfs *e, struct reloc *patched_reloc,
sec->name, offset, patched_sym->name, \
addend >= 0 ? "+" : "-", labs(addend), \
sym_type(patched_sym), \
- patched_sym->type == STT_SECTION ? "" : " ", \
- patched_sym->type == STT_SECTION ? "" : sym_bind(patched_sym), \
+ is_sec_sym(patched_sym) ? "" : " ", \
+ is_sec_sym(patched_sym) ? "" : sym_bind(patched_sym), \
is_undef_sym(patched_sym) ? " UNDEF" : "", \
export ? " EXPORTED" : "", \
klp ? " KLP" : "")