summaryrefslogtreecommitdiff
path: root/scripts/mod
diff options
context:
space:
mode:
authorMasahiro Yamada <masahiroy@kernel.org>2023-10-23 02:06:12 +0900
committerMasahiro Yamada <masahiroy@kernel.org>2023-10-28 21:31:22 +0900
commitb3d4f446fc0f6bf6d50abfc403eb375d9b9f6378 (patch)
tree2e5d8f669556f639092da7384cb54b40ccbd59ac /scripts/mod
parente578e4e3110635b20786e442baa3aeff9bb65f95 (diff)
modpost: merge sectioncheck table entries regarding init/exit sections
Check symbol references from normal sections to init/exit sections in a single entry. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Diffstat (limited to 'scripts/mod')
-rw-r--r--scripts/mod/modpost.c18
1 files changed, 3 insertions, 15 deletions
diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
index bc555ac5b47c..144194c8f15b 100644
--- a/scripts/mod/modpost.c
+++ b/scripts/mod/modpost.c
@@ -823,9 +823,7 @@ static void check_section(const char *modname, struct elf_info *elf,
TEXT_SECTIONS, OTHER_TEXT_SECTIONS
enum mismatch {
- TEXT_TO_ANY_INIT,
- DATA_TO_ANY_INIT,
- TEXTDATA_TO_ANY_EXIT,
+ TEXTDATA_TO_ANY_INIT_EXIT,
XXXINIT_TO_SOME_INIT,
ANY_INIT_TO_ANY_EXIT,
ANY_EXIT_TO_ANY_INIT,
@@ -857,19 +855,9 @@ static const struct sectioncheck sectioncheck[] = {
* normal code and data
*/
{
- .fromsec = { TEXT_SECTIONS, NULL },
- .bad_tosec = { ALL_INIT_SECTIONS, NULL },
- .mismatch = TEXT_TO_ANY_INIT,
-},
-{
- .fromsec = { DATA_SECTIONS, NULL },
- .bad_tosec = { ALL_INIT_SECTIONS, NULL },
- .mismatch = DATA_TO_ANY_INIT,
-},
-{
.fromsec = { TEXT_SECTIONS, DATA_SECTIONS, NULL },
- .bad_tosec = { ALL_EXIT_SECTIONS, NULL },
- .mismatch = TEXTDATA_TO_ANY_EXIT,
+ .bad_tosec = { ALL_INIT_SECTIONS, ALL_EXIT_SECTIONS, NULL },
+ .mismatch = TEXTDATA_TO_ANY_INIT_EXIT,
},
/* Do not reference init code/data from meminit code/data */
{