Skip to content

Commit b3d4f44

Browse files
committed
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 <[email protected]>
1 parent e578e4e commit b3d4f44

File tree

1 file changed

+3
-15
lines changed

1 file changed

+3
-15
lines changed

scripts/mod/modpost.c

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -823,9 +823,7 @@ static void check_section(const char *modname, struct elf_info *elf,
823823
TEXT_SECTIONS, OTHER_TEXT_SECTIONS
824824

825825
enum mismatch {
826-
TEXT_TO_ANY_INIT,
827-
DATA_TO_ANY_INIT,
828-
TEXTDATA_TO_ANY_EXIT,
826+
TEXTDATA_TO_ANY_INIT_EXIT,
829827
XXXINIT_TO_SOME_INIT,
830828
ANY_INIT_TO_ANY_EXIT,
831829
ANY_EXIT_TO_ANY_INIT,
@@ -856,20 +854,10 @@ static const struct sectioncheck sectioncheck[] = {
856854
/* Do not reference init/exit code/data from
857855
* normal code and data
858856
*/
859-
{
860-
.fromsec = { TEXT_SECTIONS, NULL },
861-
.bad_tosec = { ALL_INIT_SECTIONS, NULL },
862-
.mismatch = TEXT_TO_ANY_INIT,
863-
},
864-
{
865-
.fromsec = { DATA_SECTIONS, NULL },
866-
.bad_tosec = { ALL_INIT_SECTIONS, NULL },
867-
.mismatch = DATA_TO_ANY_INIT,
868-
},
869857
{
870858
.fromsec = { TEXT_SECTIONS, DATA_SECTIONS, NULL },
871-
.bad_tosec = { ALL_EXIT_SECTIONS, NULL },
872-
.mismatch = TEXTDATA_TO_ANY_EXIT,
859+
.bad_tosec = { ALL_INIT_SECTIONS, ALL_EXIT_SECTIONS, NULL },
860+
.mismatch = TEXTDATA_TO_ANY_INIT_EXIT,
873861
},
874862
/* Do not reference init code/data from meminit code/data */
875863
{

0 commit comments

Comments
 (0)