diff options
Diffstat (limited to 'scripts/mod')
-rw-r--r-- | scripts/mod/file2alias.c | 12 | ||||
-rw-r--r-- | scripts/mod/modpost.c | 5 |
2 files changed, 16 insertions, 1 deletions
diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c index 4eea60b1693e..a3344285ccf4 100644 --- a/scripts/mod/file2alias.c +++ b/scripts/mod/file2alias.c | |||
@@ -710,6 +710,14 @@ static int do_dmi_entry(const char *filename, struct dmi_system_id *id, | |||
710 | strcat(alias, ":"); | 710 | strcat(alias, ":"); |
711 | return 1; | 711 | return 1; |
712 | } | 712 | } |
713 | |||
714 | static int do_platform_entry(const char *filename, | ||
715 | struct platform_device_id *id, char *alias) | ||
716 | { | ||
717 | sprintf(alias, PLATFORM_MODULE_PREFIX "%s", id->name); | ||
718 | return 1; | ||
719 | } | ||
720 | |||
713 | /* Ignore any prefix, eg. some architectures prepend _ */ | 721 | /* Ignore any prefix, eg. some architectures prepend _ */ |
714 | static inline int sym_is(const char *symbol, const char *name) | 722 | static inline int sym_is(const char *symbol, const char *name) |
715 | { | 723 | { |
@@ -849,6 +857,10 @@ void handle_moddevtable(struct module *mod, struct elf_info *info, | |||
849 | do_table(symval, sym->st_size, | 857 | do_table(symval, sym->st_size, |
850 | sizeof(struct dmi_system_id), "dmi", | 858 | sizeof(struct dmi_system_id), "dmi", |
851 | do_dmi_entry, mod); | 859 | do_dmi_entry, mod); |
860 | else if (sym_is(symname, "__mod_platform_device_table")) | ||
861 | do_table(symval, sym->st_size, | ||
862 | sizeof(struct platform_device_id), "platform", | ||
863 | do_platform_entry, mod); | ||
852 | free(zeros); | 864 | free(zeros); |
853 | } | 865 | } |
854 | 866 | ||
diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c index 88921611b22e..7e62303133dc 100644 --- a/scripts/mod/modpost.c +++ b/scripts/mod/modpost.c | |||
@@ -415,8 +415,9 @@ static int parse_elf(struct elf_info *info, const char *filename) | |||
415 | const char *secstrings | 415 | const char *secstrings |
416 | = (void *)hdr + sechdrs[hdr->e_shstrndx].sh_offset; | 416 | = (void *)hdr + sechdrs[hdr->e_shstrndx].sh_offset; |
417 | const char *secname; | 417 | const char *secname; |
418 | int nobits = sechdrs[i].sh_type == SHT_NOBITS; | ||
418 | 419 | ||
419 | if (sechdrs[i].sh_offset > info->size) { | 420 | if (!nobits && sechdrs[i].sh_offset > info->size) { |
420 | fatal("%s is truncated. sechdrs[i].sh_offset=%lu > " | 421 | fatal("%s is truncated. sechdrs[i].sh_offset=%lu > " |
421 | "sizeof(*hrd)=%zu\n", filename, | 422 | "sizeof(*hrd)=%zu\n", filename, |
422 | (unsigned long)sechdrs[i].sh_offset, | 423 | (unsigned long)sechdrs[i].sh_offset, |
@@ -425,6 +426,8 @@ static int parse_elf(struct elf_info *info, const char *filename) | |||
425 | } | 426 | } |
426 | secname = secstrings + sechdrs[i].sh_name; | 427 | secname = secstrings + sechdrs[i].sh_name; |
427 | if (strcmp(secname, ".modinfo") == 0) { | 428 | if (strcmp(secname, ".modinfo") == 0) { |
429 | if (nobits) | ||
430 | fatal("%s has NOBITS .modinfo\n", filename); | ||
428 | info->modinfo = (void *)hdr + sechdrs[i].sh_offset; | 431 | info->modinfo = (void *)hdr + sechdrs[i].sh_offset; |
429 | info->modinfo_len = sechdrs[i].sh_size; | 432 | info->modinfo_len = sechdrs[i].sh_size; |
430 | } else if (strcmp(secname, "__ksymtab") == 0) | 433 | } else if (strcmp(secname, "__ksymtab") == 0) |