mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Tiezhu Yang <yangtiezhu@loongson.cn>
Cc: Josh Poimboeuf <jpoimboe@kernel.org>,
	Huacai Chen <chenhuacai@kernel.org>,
	loongarch@lists.linux.dev, linux-kernel@vger.kernel.org,
	loongson-kernel@lists.loongnix.cn
Subject: Re: [PATCH v3 5/8] objtool: Check local label about sibling call
Date: Fri, 20 Oct 2023 11:30:31 +0200	[thread overview]
Message-ID: <20231020093031.GB31411@noisy.programming.kicks-ass.net> (raw)
In-Reply-To: <1697768821-22931-6-git-send-email-yangtiezhu@loongson.cn>

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;
 };

  reply	other threads:[~2023-10-20  9:30 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-20  2:26 [PATCH v3 0/8] Add objtool and orc support for LoongArch Tiezhu Yang
2023-10-20  2:26 ` [PATCH v3 1/8] objtool/LoongArch: Enable objtool to be built Tiezhu Yang
2023-10-20  2:26 ` [PATCH v3 2/8] objtool/LoongArch: Implement instruction decoder Tiezhu Yang
2023-10-20  2:26 ` [PATCH v3 3/8] objtool/x86: Separate arch-specific and generic parts Tiezhu Yang
2023-10-20  2:26 ` [PATCH v3 4/8] objtool/LoongArch: Enable orc to be built Tiezhu Yang
2023-10-21  8:08   ` Huacai Chen
2023-10-20  2:26 ` [PATCH v3 5/8] objtool: Check local label about sibling call Tiezhu Yang
2023-10-20  9:30   ` Peter Zijlstra [this message]
2023-10-20 10:56     ` Tiezhu Yang
2023-10-20  2:26 ` [PATCH v3 6/8] objtool: Check local label in add_dead_ends() Tiezhu Yang
2023-10-20  2:27 ` [PATCH v3 7/8] objtool: Check local label in read_unwind_hints() Tiezhu Yang
2023-10-20  2:27 ` [PATCH v3 8/8] LoongArch: Add ORC stack unwinder support Tiezhu Yang
2023-10-21  8:08   ` Huacai Chen
2023-10-20  8:51 ` [PATCH v3 0/8] Add objtool and orc support for LoongArch Huacai Chen
2023-10-20 10:28   ` Tiezhu Yang
2023-10-20 10:45     ` Xi Ruoyao
2023-10-20 10:54       ` Tiezhu Yang
2023-10-21  8:13         ` Huacai Chen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231020093031.GB31411@noisy.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=chenhuacai@kernel.org \
    --cc=jpoimboe@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=loongarch@lists.linux.dev \
    --cc=loongson-kernel@lists.loongnix.cn \
    --cc=yangtiezhu@loongson.cn \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®