Skip to content

Commit

Permalink
modpost: disallow *driver to reference .meminit* sections
Browse files Browse the repository at this point in the history
Drivers must not reference .meminit* sections, which are discarded
when CONFIG_MEMORY_HOTPLUG=n.

The reason for whitelisting "*driver" in the section mismatch check
was to allow drivers to reference symbols annotated as __devinit or
__devexit that existed in the past.

Those annotations were removed by the following commits:

 - 54b956b ("Remove __dev* markings from init.h")
 - 92e9e6d ("modpost.c: Stop checking __dev* section mismatches")

Remove the stale whitelist.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
  • Loading branch information
masahir0y committed Oct 28, 2023
1 parent 6a4e59e commit 50cccec
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions scripts/mod/modpost.c
Original file line number Diff line number Diff line change
Expand Up @@ -1006,12 +1006,6 @@ static int secref_whitelist(const char *fromsec, const char *fromsym,
"*_console")))
return 0;

/* symbols in data sections that may refer to meminit sections */
if (match(fromsec, PATTERNS(DATA_SECTIONS)) &&
match(tosec, PATTERNS(ALL_XXXINIT_SECTIONS)) &&
match(fromsym, PATTERNS("*driver")))
return 0;

/*
* symbols in data sections must not refer to .exit.*, but there are
* quite a few offenders, so hide these unless for W=1 builds until
Expand Down

0 comments on commit 50cccec

Please sign in to comment.