[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20231020093031.GB31411@noisy.programming.kicks-ass.net>
Date: Fri, 20 Oct 2023 11:30:31 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: Tiezhu Yang <yangtiezhu@...ngson.cn>
Cc: Josh Poimboeuf <jpoimboe@...nel.org>,
Huacai Chen <chenhuacai@...nel.org>, loongarch@...ts.linux.dev,
linux-kernel@...r.kernel.org, loongson-kernel@...ts.loongnix.cn
Subject: Re: [PATCH v3 5/8] objtool: Check local label about sibling call
On Fri, Oct 20, 2023 at 10:26:58AM +0800, Tiezhu Yang wrote:
> + if (reloc && reloc->sym->type == STT_NOTYPE &&
> + strncmp(reloc->sym->name, ".L", 2) == 0)
> + if (reloc->sym->type == STT_NOTYPE &&
> + strncmp(reloc->sym->name, ".L", 2) == 0) {
Would not something like the below be better?
diff --git a/tools/objtool/check.c b/tools/objtool/check.c
index e308d1ba664e..a57d293c834d 100644
--- a/tools/objtool/check.c
+++ b/tools/objtool/check.c
@@ -2506,6 +2506,9 @@ static int classify_symbols(struct objtool_file *file)
struct symbol *func;
for_each_sym(file, func) {
+ if (func->type == STT_NOTYPE && strstarts(func->name, ".L"))
+ func->local_label = true;
+
if (func->bind != STB_GLOBAL)
continue;
diff --git a/tools/objtool/include/objtool/elf.h b/tools/objtool/include/objtool/elf.h
index 9f71e988eca4..2b8a69de4db8 100644
--- a/tools/objtool/include/objtool/elf.h
+++ b/tools/objtool/include/objtool/elf.h
@@ -67,6 +67,7 @@ struct symbol {
u8 profiling_func : 1;
u8 warned : 1;
u8 embedded_insn : 1;
+ u8 local_label : 1;
struct list_head pv_target;
struct reloc *relocs;
};
Powered by blists - more mailing lists