aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/mod/file2alias.c
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/mod/file2alias.c')
-rw-r--r--scripts/mod/file2alias.c4
1 files changed, 4 insertions, 0 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 "