mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* objtool: static_call: can't find static_call_key symbol: __SCK__WARN_trap
@ 2026-02-02 16:18 Arnd Bergmann
  2026-02-02 18:19 ` Josh Poimboeuf
  0 siblings, 1 reply; 4+ messages in thread
From: Arnd Bergmann @ 2026-02-02 16:18 UTC (permalink / raw)
  To: Peter Zijlstra, Josh Poimboeuf; +Cc: x86, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 414 bytes --]

Hi,

I see a new objtool related build failure on current linux-next
with clang-21:

samples/livepatch/livepatch-shadow-fix1.o: error: objtool: static_call: can't find static_call_key symbol: __SCK__WARN_trap

I couldn't figure out what exactly is going on there, this seems fine
with gcc, and so far only one of hundreds of configs has this issue.

See the attachments for .config and the object file.

      Arnd

[-- Attachment #2: livepatch-shadow-objtool-warning.config.gz --]
[-- Type: application/gzip, Size: 47420 bytes --]

[-- Attachment #3: livepatch-shadow-fix1.o.gz --]
[-- Type: application/gzip, Size: 4922 bytes --]

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

* Re: objtool: static_call: can't find static_call_key symbol: __SCK__WARN_trap
  2026-02-02 16:18 objtool: static_call: can't find static_call_key symbol: __SCK__WARN_trap Arnd Bergmann
@ 2026-02-02 18:19 ` Josh Poimboeuf
  2026-02-02 18:20   ` Josh Poimboeuf
  0 siblings, 1 reply; 4+ messages in thread
From: Josh Poimboeuf @ 2026-02-02 18:19 UTC (permalink / raw)
  To: Arnd Bergmann; +Cc: Peter Zijlstra, x86, linux-kernel, live-patching

On Mon, Feb 02, 2026 at 05:18:13PM +0100, Arnd Bergmann wrote:
> Hi,
> 
> I see a new objtool related build failure on current linux-next
> with clang-21:
> 
> samples/livepatch/livepatch-shadow-fix1.o: error: objtool: static_call: can't find static_call_key symbol: __SCK__WARN_trap
> 
> I couldn't figure out what exactly is going on there, this seems fine
> with gcc, and so far only one of hundreds of configs has this issue.
> 
> See the attachments for .config and the object file.

Ah, this is CONFIG_MEM_ALLOC_PROFILING_DEBUG inserting a WARN() in the
sample livepatch module's memory allocation, triggering the following
warning (file->klp is true):

		if (!key_sym) {
			if (!opts.module || file->klp) {
				ERROR("static_call: can't find static_call_key symbol: %s", tmp);
				return -1;
			}


So this is showing that the sample livepatch modules (which are built
differently from the new klp-build way of building livepatch modules)
will fail to build when trying to access a non-exported static key.

I will need to stare at that a bit to try to figure out a fix.

-- 
Josh

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

* Re: objtool: static_call: can't find static_call_key symbol: __SCK__WARN_trap
  2026-02-02 18:19 ` Josh Poimboeuf
@ 2026-02-02 18:20   ` Josh Poimboeuf
  2026-02-02 18:26     ` Josh Poimboeuf
  0 siblings, 1 reply; 4+ messages in thread
From: Josh Poimboeuf @ 2026-02-02 18:20 UTC (permalink / raw)
  To: Arnd Bergmann; +Cc: Peter Zijlstra, x86, linux-kernel, live-patching

On Mon, Feb 02, 2026 at 10:19:33AM -0800, Josh Poimboeuf wrote:
> On Mon, Feb 02, 2026 at 05:18:13PM +0100, Arnd Bergmann wrote:
> > Hi,
> > 
> > I see a new objtool related build failure on current linux-next
> > with clang-21:
> > 
> > samples/livepatch/livepatch-shadow-fix1.o: error: objtool: static_call: can't find static_call_key symbol: __SCK__WARN_trap
> > 
> > I couldn't figure out what exactly is going on there, this seems fine
> > with gcc, and so far only one of hundreds of configs has this issue.
> > 
> > See the attachments for .config and the object file.
> 
> Ah, this is CONFIG_MEM_ALLOC_PROFILING_DEBUG inserting a WARN() in the
> sample livepatch module's memory allocation, triggering the following
> warning (file->klp is true):
> 
> 		if (!key_sym) {
> 			if (!opts.module || file->klp) {
> 				ERROR("static_call: can't find static_call_key symbol: %s", tmp);
> 				return -1;
> 			}
> 
> 
> So this is showing that the sample livepatch modules (which are built
> differently from the new klp-build way of building livepatch modules)
> will fail to build when trying to access a non-exported static key.

Erm, non-exported static *call*.

-- 
Josh

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

* Re: objtool: static_call: can't find static_call_key symbol: __SCK__WARN_trap
  2026-02-02 18:20   ` Josh Poimboeuf
@ 2026-02-02 18:26     ` Josh Poimboeuf
  0 siblings, 0 replies; 4+ messages in thread
From: Josh Poimboeuf @ 2026-02-02 18:26 UTC (permalink / raw)
  To: Arnd Bergmann; +Cc: Peter Zijlstra, x86, linux-kernel, live-patching

On Mon, Feb 02, 2026 at 10:20:15AM -0800, Josh Poimboeuf wrote:
> On Mon, Feb 02, 2026 at 10:19:33AM -0800, Josh Poimboeuf wrote:
> > On Mon, Feb 02, 2026 at 05:18:13PM +0100, Arnd Bergmann wrote:
> > > Hi,
> > > 
> > > I see a new objtool related build failure on current linux-next
> > > with clang-21:
> > > 
> > > samples/livepatch/livepatch-shadow-fix1.o: error: objtool: static_call: can't find static_call_key symbol: __SCK__WARN_trap
> > > 
> > > I couldn't figure out what exactly is going on there, this seems fine
> > > with gcc, and so far only one of hundreds of configs has this issue.
> > > 
> > > See the attachments for .config and the object file.
> > 
> > Ah, this is CONFIG_MEM_ALLOC_PROFILING_DEBUG inserting a WARN() in the
> > sample livepatch module's memory allocation, triggering the following
> > warning (file->klp is true):
> > 
> > 		if (!key_sym) {
> > 			if (!opts.module || file->klp) {
> > 				ERROR("static_call: can't find static_call_key symbol: %s", tmp);
> > 				return -1;
> > 			}
> > 
> > 
> > So this is showing that the sample livepatch modules (which are built
> > differently from the new klp-build way of building livepatch modules)
> > will fail to build when trying to access a non-exported static key.
> 
> Erm, non-exported static *call*.

So I think we can just remove that file->klp check.  That check is
perhaps a bit too strict since it doesn't take into account livepatch
modules that were built without klp-build.

-- 
Josh

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

end of thread, other threads:[~2026-02-02 18:26 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-02-02 16:18 objtool: static_call: can't find static_call_key symbol: __SCK__WARN_trap Arnd Bergmann
2026-02-02 18:19 ` Josh Poimboeuf
2026-02-02 18:20   ` Josh Poimboeuf
2026-02-02 18:26     ` Josh Poimboeuf

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®