From: Song Liu Date: Thu, 5 Mar 2026 23:15:29 +0000 (-0800) Subject: objtool/klp: Remove .llvm suffix in demangle_name() X-Git-Tag: v7.1-rc1~198^2~13 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=020b71dcafeeececb78d9ee9e5a2e68e8e05e922;p=thirdparty%2Fkernel%2Flinux.git objtool/klp: Remove .llvm suffix in demangle_name() Remove .llvm suffix, so that we can correlate foo.llvm. and foo.llvm.. Signed-off-by: Song Liu Link: https://patch.msgid.link/20260305231531.3847295-6-song@kernel.org Signed-off-by: Josh Poimboeuf --- diff --git a/tools/objtool/elf.c b/tools/objtool/elf.c index 7e019f15aac59..feaec45a14a01 100644 --- a/tools/objtool/elf.c +++ b/tools/objtool/elf.c @@ -455,6 +455,11 @@ static int read_sections(struct elf *elf) static ssize_t demangled_name_len(const char *name) { ssize_t idx; + const char *p; + + p = strstr(name, ".llvm."); + if (p) + return p - name; if (!strstarts(name, "__UNIQUE_ID_") && !strchr(name, '.')) return strlen(name); @@ -482,6 +487,9 @@ static ssize_t demangled_name_len(const char *name) * __UNIQUE_ID_addressable___UNIQUE_ID_pci_invalid_bar_694_695 * * to remove both trailing numbers, also remove trailing '_'. + * + * For symbols with llvm suffix, i.e., foo.llvm., remove the + * .llvm. part. */ static const char *demangle_name(struct symbol *sym) {