arch: um: add linker section for kunit test modules Adds a linker section to UML where KUnit can put references to its test modules. This is part of transitioning it so that it is not entirely dependent on the init system. Change-Id: Ieacc4cf0bbb6fdc774bb7f68d61a6259055b8cb0 Signed-off-by: Brendan Higgins <brendanhiggins@google.com>
diff --git a/arch/um/include/asm/common.lds.S b/arch/um/include/asm/common.lds.S index 7adb4e6..3968ba3 100644 --- a/arch/um/include/asm/common.lds.S +++ b/arch/um/include/asm/common.lds.S
@@ -55,6 +55,10 @@ SECURITY_INIT + .test_modules : { + KUNIT_TEST_MODULES + } + .exitcall : { __exitcall_begin = .; *(.exitcall.exit)
diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h index d7701d4..424a219 100644 --- a/include/asm-generic/vmlinux.lds.h +++ b/include/asm-generic/vmlinux.lds.h
@@ -798,6 +798,11 @@ KEEP(*(.security_initcall.init)) \ __security_initcall_end = .; +#define KUNIT_TEST_MODULES \ + __test_modules_start = .; \ + KEEP(*(.test_modules)) \ + __test_modules_end = .; + #ifdef CONFIG_BLK_DEV_INITRD #define INIT_RAM_FS \ . = ALIGN(4); \ @@ -966,6 +971,7 @@ CON_INITCALL \ SECURITY_INITCALL \ INIT_RAM_FS \ + KUNIT_TEST_MODULES \ } #define BSS_SECTION(sbss_align, bss_align, stop_align) \