]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
kunit: move KUNIT_TABLE out of INIT_DATA
authorRae Moar <rmoar@google.com>
Wed, 13 Dec 2023 19:44:16 +0000 (19:44 +0000)
committerShuah Khan <skhan@linuxfoundation.org>
Mon, 18 Dec 2023 20:21:15 +0000 (13:21 -0700)
Alter the linker section of KUNIT_TABLE to move it out of INIT_DATA and
into DATA_DATA.

Data for KUnit tests does not need to be in the init section.

In order to run tests again after boot the KUnit data cannot be labeled as
init data as the kernel could write over it.

Add a KUNIT_INIT_TABLE in the next patch for KUnit tests that test init
data/functions.

Reviewed-by: David Gow <davidgow@google.com>
Signed-off-by: Rae Moar <rmoar@google.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
include/asm-generic/vmlinux.lds.h

index bae0fe4d499bccead73abfeda5fac62dc04bbd1e..1107905d37fc68cfbdac4f6a54fbeb8245474958 100644 (file)
        BRANCH_PROFILE()                                                \
        TRACE_PRINTKS()                                                 \
        BPF_RAW_TP()                                                    \
-       TRACEPOINT_STR()
+       TRACEPOINT_STR()                                                \
+       KUNIT_TABLE()
 
 /*
  * Data section helpers
        THERMAL_TABLE(governor)                                         \
        EARLYCON_TABLE()                                                \
        LSM_TABLE()                                                     \
-       EARLY_LSM_TABLE()                                               \
-       KUNIT_TABLE()
+       EARLY_LSM_TABLE()
 
 #define INIT_TEXT                                                      \
        *(.init.text .init.text.*)                                      \