linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* build failure caused by RUNTIME_CONST()
@ 2024-08-02 11:45 Oleg Nesterov
  2024-08-02 16:50 ` Linus Torvalds
  0 siblings, 1 reply; 8+ messages in thread
From: Oleg Nesterov @ 2024-08-02 11:45 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linux-kernel

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 */


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

end of thread, other threads:[~2024-08-05  7:19 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-02 11:45 build failure caused by RUNTIME_CONST() Oleg Nesterov
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

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).