From: Changbin Du <changbin.du@gmail.com>
To: Nathan Chancellor <nathan@kernel.org>,
Masahiro Yamada <masahiroy@kernel.org>,
Nick Desaulniers <ndesaulniers@google.com>
Cc: linux-kernel@vger.kernel.org, llvm@lists.linux.dev,
linux-riscv@lists.infradead.org,
Changbin Du <changbin.du@gmail.com>
Subject: [PATCH] kallsyms: ignore local block labels generated by compiler
Date: Fri, 28 Jan 2022 18:57:46 +0800 [thread overview]
Message-ID: <20220128105746.2459-1-changbin.du@gmail.com> (raw)
The llvm compiler can generate lots of local block labels and they might
overlap with C defined symbols. So let's ignore such local labels.
Before this change, dumpstack shows a local symbol for epc:
[ 0.040341][ T0] Hardware name: riscv-virtio,qemu (DT)
[ 0.040376][ T0] epc : .LBB6_14+0x22/0x6a
[ 0.040452][ T0] ra : restore_all+0x12/0x6e
After this change, the C defined symbol is shown which is expected:
[ 0.035795][ T0] Hardware name: riscv-virtio,qemu (DT)
[ 0.036332][ T0] epc : trace_hardirqs_on+0x54/0x13c
[ 0.036567][ T0] ra : restore_all+0x12/0x6e
Signed-off-by: Changbin Du <changbin.du@gmail.com>
---
scripts/kallsyms.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/scripts/kallsyms.c b/scripts/kallsyms.c
index 54ad86d13784..5f4be9d72a32 100644
--- a/scripts/kallsyms.c
+++ b/scripts/kallsyms.c
@@ -108,6 +108,7 @@ static bool is_ignored_symbol(const char *name, char type)
/* Symbol names that begin with the following are ignored.*/
static const char * const ignored_prefixes[] = {
"$", /* local symbols for ARM, MIPS, etc. */
+ ".LBB", /* local block labels generated by compiler */
".LASANPC", /* s390 kasan local symbols */
"__crc_", /* modversions */
"__efistub_", /* arm64 EFI stub namespace */
--
2.32.0
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
next reply other threads:[~2022-01-28 10:58 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-28 10:57 Changbin Du [this message]
2022-01-28 15:21 ` [PATCH] kallsyms: ignore local block labels generated by compiler Changbin Du
2022-01-28 18:59 ` Nick Desaulniers
2022-01-29 0:55 ` Changbin Du
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=20220128105746.2459-1-changbin.du@gmail.com \
--to=changbin.du@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=llvm@lists.linux.dev \
--cc=masahiroy@kernel.org \
--cc=nathan@kernel.org \
--cc=ndesaulniers@google.com \
/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