Skip to content

Commit

Permalink
kunit: move KUNIT_TABLE out of INIT_DATA
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Rae Moar authored and Shuah Khan committed Dec 18, 2023
1 parent 6eb0ea2 commit 69dfdce
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions include/asm-generic/vmlinux.lds.h
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,8 @@
BRANCH_PROFILE() \
TRACE_PRINTKS() \
BPF_RAW_TP() \
TRACEPOINT_STR()
TRACEPOINT_STR() \
KUNIT_TABLE()

/*
* Data section helpers
Expand Down Expand Up @@ -699,8 +700,7 @@
THERMAL_TABLE(governor) \
EARLYCON_TABLE() \
LSM_TABLE() \
EARLY_LSM_TABLE() \
KUNIT_TABLE()
EARLY_LSM_TABLE()

#define INIT_TEXT \
*(.init.text .init.text.*) \
Expand Down

0 comments on commit 69dfdce

Please sign in to comment.