rust-for-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Symbol too long for allsyms warnings on KSYM_NAME_LEN
@ 2025-03-27  8:38 Arnd Bergmann
  2025-03-27 13:58 ` Peter Zijlstra
  0 siblings, 1 reply; 3+ messages in thread
From: Arnd Bergmann @ 2025-03-27  8:38 UTC (permalink / raw)
  To: Sergio González Collado, Brendan Higgins, David Gow,
	Miguel Ojeda, Alex Gaynor, linux-kselftest, kunit-dev,
	sergio.collado, Dave Hansen, H. Peter Anvin, Josh Poimboeuf,
	Peter Zijlstra
  Cc: Boqun Feng, Gary Guo, Björn Roy Baron, Benno Lossin,
	Andreas Hindborg, Alice Ryhl, David Rheinsberg, rust-for-linux,
	skhan, ricardo.marliere, Thomas Gleixner, Ingo Molnar,
	Borislav Petkov, Martin Rodriguez Reboredo, linux-kernel

My randconfig builds sometimes (around one in every 700 configs) run
into this warning on x86:

Symbol __pfx_snnnng1h2i3j4k5l6m7ng1h2i3j4k5l6m7nng1h2i3j4k5l6m7ng1h2i3j4k5l6m7nnng1h2i3j4k5l6m7ng1h2i3j4k5l6m7nng1h2i3j4k5l6m7ng1h2i3j4k5l6m7nnnng1h2i3j4k5l6m7ng1h2i3j4k5l6m7nng1h2i3j4k5l6m7ng1h2i3j4k5l6m7nnng1h2i3j4k5l6m7ng1h2i3j4k5l6m7nng1h2i3j4k5l6m7ng1h2i3j4k5l6m7nnnnng1h2i3j4k5l6m7ng1h2i3j4k5l6m7nng1h2i3j4k5l6m7ng1h2i3j4k5l6m7nnng1h2i3j4k5l6m7ng1h2i3j4k5l6m7nng1h2i3j4k5l6m7ng1h2i3j4k5l6m7nnnng1h2i3j4k5l6m7ng1h2i3j4k5l6m7nng1h2i3j4k5l6m7ng1h2i3j4k5l6m7nnng1h2i3j4k5l6m7ng1h2i3j4k5l6m7nng1h2i3j4k5l6m7ng1h2i3j4k5l6m7n too long for kallsyms (517 >= 512).
Please increase KSYM_NAME_LEN both in kernel and kallsyms.c

The check that gets triggered was added in commit c104c16073b
("Kunit to check the longest symbol length"), see
https://lore.kernel.org/all/20241117195923.222145-1-sergio.collado@gmail.com/

and the overlong identifier seems to be the result of objtool adding
the six-byte "__pfx_" string to a symbol in elf_create_prefix_symbol()
when CONFIG_FUNCTION_PADDING_CFI is set.

I think the suggestion to "Please increase KSYM_NAME_LEN both in
kernel and kallsyms.c" is misleading here and should probably be
changed. I don't know if this something that objtool should work
around, or something that needs to be adapted in the test.

      Arnd

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

* Re: Symbol too long for allsyms warnings on KSYM_NAME_LEN
  2025-03-27  8:38 Symbol too long for allsyms warnings on KSYM_NAME_LEN Arnd Bergmann
@ 2025-03-27 13:58 ` Peter Zijlstra
  2025-03-28 11:23   ` Arnd Bergmann
  0 siblings, 1 reply; 3+ messages in thread
From: Peter Zijlstra @ 2025-03-27 13:58 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Sergio González Collado, Brendan Higgins, David Gow,
	Miguel Ojeda, Alex Gaynor, linux-kselftest, kunit-dev,
	Dave Hansen, H. Peter Anvin, Josh Poimboeuf, Boqun Feng, Gary Guo,
	Björn Roy Baron, Benno Lossin, Andreas Hindborg, Alice Ryhl,
	David Rheinsberg, rust-for-linux, skhan, ricardo.marliere,
	Thomas Gleixner, Ingo Molnar, Borislav Petkov,
	Martin Rodriguez Reboredo, linux-kernel

On Thu, Mar 27, 2025 at 09:38:46AM +0100, Arnd Bergmann wrote:
> My randconfig builds sometimes (around one in every 700 configs) run
> into this warning on x86:
> 
> Symbol __pfx_snnnng1h2i3j4k5l6m7ng1h2i3j4k5l6m7nng1h2i3j4k5l6m7ng1h2i3j4k5l6m7nnng1h2i3j4k5l6m7ng1h2i3j4k5l6m7nng1h2i3j4k5l6m7ng1h2i3j4k5l6m7nnnng1h2i3j4k5l6m7ng1h2i3j4k5l6m7nng1h2i3j4k5l6m7ng1h2i3j4k5l6m7nnng1h2i3j4k5l6m7ng1h2i3j4k5l6m7nng1h2i3j4k5l6m7ng1h2i3j4k5l6m7nnnnng1h2i3j4k5l6m7ng1h2i3j4k5l6m7nng1h2i3j4k5l6m7ng1h2i3j4k5l6m7nnng1h2i3j4k5l6m7ng1h2i3j4k5l6m7nng1h2i3j4k5l6m7ng1h2i3j4k5l6m7nnnng1h2i3j4k5l6m7ng1h2i3j4k5l6m7nng1h2i3j4k5l6m7ng1h2i3j4k5l6m7nnng1h2i3j4k5l6m7ng1h2i3j4k5l6m7nng1h2i3j4k5l6m7ng1h2i3j4k5l6m7n too long for kallsyms (517 >= 512).
> Please increase KSYM_NAME_LEN both in kernel and kallsyms.c
> 
> The check that gets triggered was added in commit c104c16073b
> ("Kunit to check the longest symbol length"), see
> https://lore.kernel.org/all/20241117195923.222145-1-sergio.collado@gmail.com/
> 
> and the overlong identifier seems to be the result of objtool adding
> the six-byte "__pfx_" string to a symbol in elf_create_prefix_symbol()
> when CONFIG_FUNCTION_PADDING_CFI is set.
> 
> I think the suggestion to "Please increase KSYM_NAME_LEN both in
> kernel and kallsyms.c" is misleading here and should probably be
> changed. I don't know if this something that objtool should work
> around, or something that needs to be adapted in the test.

Probably test needs to be fixed; objtool can't really do anything here,
it just take the existing symname and prefixes it.


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

* Re: Symbol too long for allsyms warnings on KSYM_NAME_LEN
  2025-03-27 13:58 ` Peter Zijlstra
@ 2025-03-28 11:23   ` Arnd Bergmann
  0 siblings, 0 replies; 3+ messages in thread
From: Arnd Bergmann @ 2025-03-28 11:23 UTC (permalink / raw)
  To: Peter Zijlstra
  Cc: Sergio González Collado, Brendan Higgins, David Gow,
	Miguel Ojeda, Alex Gaynor, linux-kselftest, kunit-dev,
	Dave Hansen, H. Peter Anvin, Josh Poimboeuf, Boqun Feng, Gary Guo,
	Björn Roy Baron, Benno Lossin, Andreas Hindborg, Alice Ryhl,
	David Rheinsberg, rust-for-linux, Shuah Khan, ricardo.marliere,
	Thomas Gleixner, Ingo Molnar, Borislav Petkov,
	Martin Rodriguez Reboredo, linux-kernel

On Thu, Mar 27, 2025, at 14:58, Peter Zijlstra wrote:
> On Thu, Mar 27, 2025 at 09:38:46AM +0100, Arnd Bergmann wrote:
>> My randconfig builds sometimes (around one in every 700 configs) run
>> into this warning on x86:
>> 
>> Symbol __pfx_snnnng1h2i3j4k5l6m7ng1h2i3j4k5l6m7nng1h2i3j4k5l6m7ng1h2i3j4k5l6m7nnng1h2i3j4k5l6m7ng1h2i3j4k5l6m7nng1h2i3j4k5l6m7ng1h2i3j4k5l6m7nnnng1h2i3j4k5l6m7ng1h2i3j4k5l6m7nng1h2i3j4k5l6m7ng1h2i3j4k5l6m7nnng1h2i3j4k5l6m7ng1h2i3j4k5l6m7nng1h2i3j4k5l6m7ng1h2i3j4k5l6m7nnnnng1h2i3j4k5l6m7ng1h2i3j4k5l6m7nng1h2i3j4k5l6m7ng1h2i3j4k5l6m7nnng1h2i3j4k5l6m7ng1h2i3j4k5l6m7nng1h2i3j4k5l6m7ng1h2i3j4k5l6m7nnnng1h2i3j4k5l6m7ng1h2i3j4k5l6m7nng1h2i3j4k5l6m7ng1h2i3j4k5l6m7nnng1h2i3j4k5l6m7ng1h2i3j4k5l6m7nng1h2i3j4k5l6m7ng1h2i3j4k5l6m7n too long for kallsyms (517 >= 512).
>> Please increase KSYM_NAME_LEN both in kernel and kallsyms.c
>> 
>> The check that gets triggered was added in commit c104c16073b
>> ("Kunit to check the longest symbol length"), see
>> https://lore.kernel.org/all/20241117195923.222145-1-sergio.collado@gmail.com/
>> 
>> and the overlong identifier seems to be the result of objtool adding
>> the six-byte "__pfx_" string to a symbol in elf_create_prefix_symbol()
>> when CONFIG_FUNCTION_PADDING_CFI is set.
>> 
>> I think the suggestion to "Please increase KSYM_NAME_LEN both in
>> kernel and kallsyms.c" is misleading here and should probably be
>> changed. I don't know if this something that objtool should work
>> around, or something that needs to be adapted in the test.
>
> Probably test needs to be fixed; objtool can't really do anything here,
> it just take the existing symname and prefixes it.

I found a workaround that avoids the problem for me now, see
https://lore.kernel.org/linux-kbuild/20250328112156.2614513-1-arnd@kernel.org/

      Arnd

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

end of thread, other threads:[~2025-03-28 11:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-27  8:38 Symbol too long for allsyms warnings on KSYM_NAME_LEN Arnd Bergmann
2025-03-27 13:58 ` Peter Zijlstra
2025-03-28 11:23   ` Arnd Bergmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).