aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/mod
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/mod')
-rw-r--r--scripts/mod/file2alias.c4
-rw-r--r--scripts/mod/modpost.c5
-rw-r--r--scripts/mod/modpost.h1
3 files changed, 9 insertions, 1 deletions
diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c
index 9ddf944cce29..348d8687b7c9 100644
--- a/scripts/mod/file2alias.c
+++ b/scripts/mod/file2alias.c
@@ -51,11 +51,13 @@ do { \
51 sprintf(str + strlen(str), "*"); \ 51 sprintf(str + strlen(str), "*"); \
52} while(0) 52} while(0)
53 53
54unsigned int cross_build = 0;
54/** 55/**
55 * Check that sizeof(device_id type) are consistent with size of section 56 * Check that sizeof(device_id type) are consistent with size of section
56 * in .o file. If in-consistent then userspace and kernel does not agree 57 * in .o file. If in-consistent then userspace and kernel does not agree
57 * on actual size which is a bug. 58 * on actual size which is a bug.
58 * Also verify that the final entry in the table is all zeros. 59 * Also verify that the final entry in the table is all zeros.
60 * Ignore both checks if build host differ from target host and size differs.
59 **/ 61 **/
60static void device_id_check(const char *modname, const char *device_id, 62static void device_id_check(const char *modname, const char *device_id,
61 unsigned long size, unsigned long id_size, 63 unsigned long size, unsigned long id_size,
@@ -64,6 +66,8 @@ static void device_id_check(const char *modname, const char *device_id,
64 int i; 66 int i;
65 67
66 if (size % id_size || size < id_size) { 68 if (size % id_size || size < id_size) {
69 if (cross_build != 0)
70 return;
67 fatal("%s: sizeof(struct %s_device_id)=%lu is not a modulo " 71 fatal("%s: sizeof(struct %s_device_id)=%lu is not a modulo "
68 "of the size of section __mod_%s_device_table=%lu.\n" 72 "of the size of section __mod_%s_device_table=%lu.\n"
69 "Fix definition of struct %s_device_id " 73 "Fix definition of struct %s_device_id "
diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
index 695b5d657cf5..110cf243fa4e 100644
--- a/scripts/mod/modpost.c
+++ b/scripts/mod/modpost.c
@@ -2026,7 +2026,7 @@ int main(int argc, char **argv)
2026 int opt; 2026 int opt;
2027 int err; 2027 int err;
2028 2028
2029 while ((opt = getopt(argc, argv, "i:I:msSo:awM:K:")) != -1) { 2029 while ((opt = getopt(argc, argv, "i:I:cmsSo:awM:K:")) != -1) {
2030 switch (opt) { 2030 switch (opt) {
2031 case 'i': 2031 case 'i':
2032 kernel_read = optarg; 2032 kernel_read = optarg;
@@ -2035,6 +2035,9 @@ int main(int argc, char **argv)
2035 module_read = optarg; 2035 module_read = optarg;
2036 external_module = 1; 2036 external_module = 1;
2037 break; 2037 break;
2038 case 'c':
2039 cross_build = 1;
2040 break;
2038 case 'm': 2041 case 'm':
2039 modversions = 1; 2042 modversions = 1;
2040 break; 2043 break;
diff --git a/scripts/mod/modpost.h b/scripts/mod/modpost.h
index 565c5872407e..09f58e33d227 100644
--- a/scripts/mod/modpost.h
+++ b/scripts/mod/modpost.h
@@ -135,6 +135,7 @@ struct elf_info {
135}; 135};
136 136
137/* file2alias.c */ 137/* file2alias.c */
138extern unsigned int cross_build;
138void handle_moddevtable(struct module *mod, struct elf_info *info, 139void handle_moddevtable(struct module *mod, struct elf_info *info,
139 Elf_Sym *sym, const char *symname); 140 Elf_Sym *sym, const char *symname);
140void add_moddevtable(struct buffer *buf, struct module *mod); 141void add_moddevtable(struct buffer *buf, struct module *mod);