aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/mod
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/mod')
-rw-r--r--scripts/mod/modpost.c80
1 files changed, 48 insertions, 32 deletions
diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
index 87e3ee56e87d..c903a16ba0e6 100644
--- a/scripts/mod/modpost.c
+++ b/scripts/mod/modpost.c
@@ -586,6 +586,54 @@ static int strrcmp(const char *s, const char *sub)
586 return memcmp(s + slen - sublen, sub, sublen); 586 return memcmp(s + slen - sublen, sub, sublen);
587} 587}
588 588
589/*
590 * Functions used only during module init is marked __init and is stored in
591 * a .init.text section. Likewise data is marked __initdata and stored in
592 * a .init.data section.
593 * If this section is one of these sections return 1
594 * See include/linux/init.h for the details
595 */
596static int init_section(const char *name)
597{
598 if (strcmp(name, ".init") == 0)
599 return 1;
600 if (strncmp(name, ".init.", strlen(".init.")) == 0)
601 return 1;
602 return 0;
603}
604
605/*
606 * Functions used only during module exit is marked __exit and is stored in
607 * a .exit.text section. Likewise data is marked __exitdata and stored in
608 * a .exit.data section.
609 * If this section is one of these sections return 1
610 * See include/linux/init.h for the details
611 **/
612static int exit_section(const char *name)
613{
614 if (strcmp(name, ".exit.text") == 0)
615 return 1;
616 if (strcmp(name, ".exit.data") == 0)
617 return 1;
618 return 0;
619
620}
621
622/*
623 * Data sections are named like this:
624 * .data | .data.rel | .data.rel.*
625 * Return 1 if the specified section is a data section
626 */
627static int data_section(const char *name)
628{
629 if ((strcmp(name, ".data") == 0) ||
630 (strcmp(name, ".data.rel") == 0) ||
631 (strncmp(name, ".data.rel.", strlen(".data.rel.")) == 0))
632 return 1;
633 else
634 return 0;
635}
636
589/** 637/**
590 * Whitelist to allow certain references to pass with no warning. 638 * Whitelist to allow certain references to pass with no warning.
591 * 639 *
@@ -1108,21 +1156,6 @@ static int initexit_section_ref_ok(const char *name)
1108 return 0; 1156 return 0;
1109} 1157}
1110 1158
1111/**
1112 * Functions used only during module init is marked __init and is stored in
1113 * a .init.text section. Likewise data is marked __initdata and stored in
1114 * a .init.data section.
1115 * If this section is one of these sections return 1
1116 * See include/linux/init.h for the details
1117 **/
1118static int init_section(const char *name)
1119{
1120 if (strcmp(name, ".init") == 0)
1121 return 1;
1122 if (strncmp(name, ".init.", strlen(".init.")) == 0)
1123 return 1;
1124 return 0;
1125}
1126 1159
1127/* 1160/*
1128 * Identify sections from which references to a .init section is OK. 1161 * Identify sections from which references to a .init section is OK.
@@ -1180,23 +1213,6 @@ static int init_section_ref_ok(const char *name)
1180} 1213}
1181 1214
1182/* 1215/*
1183 * Functions used only during module exit is marked __exit and is stored in
1184 * a .exit.text section. Likewise data is marked __exitdata and stored in
1185 * a .exit.data section.
1186 * If this section is one of these sections return 1
1187 * See include/linux/init.h for the details
1188 **/
1189static int exit_section(const char *name)
1190{
1191 if (strcmp(name, ".exit.text") == 0)
1192 return 1;
1193 if (strcmp(name, ".exit.data") == 0)
1194 return 1;
1195 return 0;
1196
1197}
1198
1199/*
1200 * Identify sections from which references to a .exit section is OK. 1216 * Identify sections from which references to a .exit section is OK.
1201 */ 1217 */
1202static int exit_section_ref_ok(const char *name) 1218static int exit_section_ref_ok(const char *name)