All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] kallsyms: Omit unnamed local symbols from System.map and kallsyms
@ 2026-11-26 16:57 Ard Biesheuvel
  2026-11-28 21:19 ` Nathan Chancellor
  0 siblings, 1 reply; 2+ messages in thread
From: Ard Biesheuvel @ 2026-11-26 16:57 UTC (permalink / raw)
  To: llvm
  Cc: Ard Biesheuvel, Nathan Chancellor, Nicolas Schier,
	Nick Desaulniers, Bill Wendling, Justin Stitt, linux-kbuild

From: Ard Biesheuvel <ardb@kernel.org>

Since LLVM PR #223686 [1] ("[LLD][ELF] AArch64 Errata patch use
STT_NOTYPE for symbols"), ld.lld --fix-cortex-a53-843419 (enabled on
arm64 by CONFIG_ARM64_ERRATUM_843419, which defaults to y) synthesizes
an unnamed (st_name == 0, "") STT_NOTYPE local symbol for every
executable InputSection that lacks an STT_SECTION symbol in its input
object, such as empty .text sections in data-only or .init.text
translation units, or per-function sections under -ffunction-sections.

elf_symbol_type() classifies these unnamed STT_NOTYPE local symbols in
executable sections as 't' (matching GNU nm and llvm-nm), and
sysmap_omits() does not filter empty names. As a result, nameless 't'
entries are emitted into System.map and compressed into the kernel's
kallsyms tables.

Beyond bloating the kallsyms tables with useless nameless entries, this
causes CONFIG_KALLSYMS_SELFTEST to fail at boot ("Test for Nth symbol
failed: ()"), because kallsyms_lookup_name("") explicitly rejects empty
strings and returns 0.

Omit symbols with an empty name in sysmap_omits() so they are excluded
from both System.map and kallsyms.

[1] https://github.com/llvm/llvm-project/commit/5da7779afdf3

Cc: Nathan Chancellor <nathan@kernel.org>
Cc: Nicolas Schier <nsc@kernel.org>
Cc: Nick Desaulniers <ndesaulniers@google.com>
Cc: Bill Wendling <morbo@google.com>
Cc: Justin Stitt <justinstitt@google.com>
Cc: linux-kbuild@vger.kernel.org
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
---
 scripts/kallsyms-sysmap.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/scripts/kallsyms-sysmap.c b/scripts/kallsyms-sysmap.c
index a482968eba51..1cb3b1775157 100644
--- a/scripts/kallsyms-sysmap.c
+++ b/scripts/kallsyms-sysmap.c
@@ -96,6 +96,10 @@ static bool sysmap_omits(const char *name, char type)
 {
 	size_t i;
 
+	/* Unnamed symbols (st_name == 0). */
+	if (!*name)
+		return true;
+
 	/* Absolute, undefined and debugging symbols. */
 	if (type == 'a' || type == 'N' || type == 'U' || type == 'w')
 		return true;
-- 
2.56.1.839.g22a8290db9-goog


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] kallsyms: Omit unnamed local symbols from System.map and kallsyms
  2026-11-26 16:57 [PATCH] kallsyms: Omit unnamed local symbols from System.map and kallsyms Ard Biesheuvel
@ 2026-11-28 21:19 ` Nathan Chancellor
  0 siblings, 0 replies; 2+ messages in thread
From: Nathan Chancellor @ 2026-11-28 21:19 UTC (permalink / raw)
  To: llvm, Ard Biesheuvel
  Cc: Ard Biesheuvel, Nicolas Schier, Nick Desaulniers, Bill Wendling,
	Justin Stitt, linux-kbuild

On Thu, 26 Nov 2026 17:57:40 +0100, Ard Biesheuvel wrote:
> kallsyms: Omit unnamed local symbols from System.map and kallsyms

Applied to

  https://git.kernel.org/pub/scm/linux/kernel/git/kbuild/linux.git kbuild-fixes-unstable

Thanks!

[1/1] kallsyms: Omit unnamed local symbols from System.map and kallsyms
      https://git.kernel.org/kbuild/c/a9690d17841d

Please look out for regression or issue reports or other follow up
comments, as they may result in the patch/series getting dropped or
reverted. Patches applied to an "unstable" branch are accepted pending
wider testing in -next and any post-commit review; they will generally
be moved to the main branch in a week if no issues are found.

Best regards,
-- 
Cheers,
Nathan



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-11-28 21:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-26 16:57 [PATCH] kallsyms: Omit unnamed local symbols from System.map and kallsyms Ard Biesheuvel
2026-11-28 21:19 ` Nathan Chancellor

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.