mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Oleg Nesterov <oleg@redhat.com>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: linux-kernel@vger.kernel.org
Subject: build failure caused by RUNTIME_CONST()
Date: Fri, 2 Aug 2024 13:45:18 +0200	[thread overview]
Message-ID: <20240802114518.GA20924@redhat.com> (raw)

make bzImage results in

	undefined reference to `__start_runtime_shift_d_hash_shift'
	undefined reference to `__stop_runtime_shift_d_hash_shift'
	undefined reference to `__start_runtime_ptr_dentry_hashtable'
	undefined reference to `__stop_runtime_ptr_dentry_hashtable'

The patch below seems to fix the problem, but I didn't find any report on lkml,
so perhaps I am the only one which hits this problem? And perhaps this is because
my gcc 5.3.1 is quite old?

OTOH, I know nothing about lds magic, so I fail to understand where these
__start/stop_runtime_xxx can come from without something like the change below...

Oleg.
---

diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
index ad6afc5c4918..6846fa6bdd81 100644
--- a/include/asm-generic/vmlinux.lds.h
+++ b/include/asm-generic/vmlinux.lds.h
@@ -913,10 +913,12 @@
 
 #define RUNTIME_NAME(t,x) runtime_##t##_##x
 
-#define RUNTIME_CONST(t,x)						\
+#define RUNTIME_CONST(t,x) _RUNTIME_CONST(RUNTIME_NAME(t,x))
+
+#define _RUNTIME_CONST(name)						\
 	. = ALIGN(8);							\
-	RUNTIME_NAME(t,x) : AT(ADDR(RUNTIME_NAME(t,x)) - LOAD_OFFSET) {	\
-		*(RUNTIME_NAME(t,x));					\
+	name : AT(ADDR(name) - LOAD_OFFSET) {	\
+		BOUNDED_SECTION_PRE_LABEL(name, name, __start_, __stop_) \
 	}
 
 /* Alignment must be consistent with (kunit_suite *) in include/kunit/test.h */


             reply	other threads:[~2024-08-02 11:45 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-02 11:45 Oleg Nesterov [this message]
2024-08-02 16:50 ` Linus Torvalds
2024-08-02 22:10   ` Oleg Nesterov
2024-08-03  1:19     ` Linus Torvalds
2024-08-03 12:01       ` Oleg Nesterov
2024-08-03 15:35         ` Linus Torvalds
2024-08-03 15:45         ` Linus Torvalds
2024-08-05  7:19       ` Rasmus Villemoes

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=20240802114518.GA20924@redhat.com \
    --to=oleg@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@linux-foundation.org \
    /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

all inboxes | Powered by JetHome®