Skip to content

Commit 90a025a

Browse files
bjh83shuahkh
authored andcommitted
vmlinux.lds.h: add linker section for KUnit test suites
Add a linker section where KUnit can put references to its test suites. This patch is the first step in transitioning to dispatching all KUnit tests from a centralized executor rather than having each as its own separate late_initcall. Co-developed-by: Iurii Zaikin <yzaikin@google.com> Signed-off-by: Iurii Zaikin <yzaikin@google.com> Signed-off-by: Brendan Higgins <brendanhiggins@google.com> Reviewed-by: Stephen Boyd <sboyd@kernel.org> Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
1 parent 2a41fc5 commit 90a025a

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

include/asm-generic/vmlinux.lds.h

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -717,7 +717,8 @@
717717
THERMAL_TABLE(governor) \
718718
EARLYCON_TABLE() \
719719
LSM_TABLE() \
720-
EARLY_LSM_TABLE()
720+
EARLY_LSM_TABLE() \
721+
KUNIT_TABLE()
721722

722723
#define INIT_TEXT \
723724
*(.init.text .init.text.*) \
@@ -909,6 +910,13 @@
909910
KEEP(*(.con_initcall.init)) \
910911
__con_initcall_end = .;
911912

913+
/* Alignment must be consistent with (kunit_suite *) in include/kunit/test.h */
914+
#define KUNIT_TABLE() \
915+
. = ALIGN(8); \
916+
__kunit_suites_start = .; \
917+
KEEP(*(.kunit_test_suites)) \
918+
__kunit_suites_end = .;
919+
912920
#ifdef CONFIG_BLK_DEV_INITRD
913921
#define INIT_RAM_FS \
914922
. = ALIGN(4); \

0 commit comments

Comments
 (0)