diff options
author | Ingo Molnar <mingo@elte.hu> | 2009-04-08 11:25:42 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-04-08 11:26:00 -0400 |
commit | 5af8c4e0fac9838428bd718040b664043a05f37c (patch) | |
tree | 75a01d98ed244db45fe3c734c4a81c1a3d92ac37 /scripts/mod | |
parent | 46e0bb9c12f4bab539736f1714cbf16600f681ec (diff) | |
parent | 577c9c456f0e1371cbade38eaf91ae8e8a308555 (diff) |
Merge commit 'v2.6.30-rc1' into sched/urgent
Merge reason: update to latest upstream to queue up fix
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'scripts/mod')
-rw-r--r-- | scripts/mod/file2alias.c | 13 | ||||
-rw-r--r-- | scripts/mod/modpost.c | 9 |
2 files changed, 19 insertions, 3 deletions
diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c index 491b8b1b6abf..a3344285ccf4 100644 --- a/scripts/mod/file2alias.c +++ b/scripts/mod/file2alias.c | |||
@@ -210,6 +210,7 @@ static void do_usb_table(void *symval, unsigned long size, | |||
210 | static int do_hid_entry(const char *filename, | 210 | static int do_hid_entry(const char *filename, |
211 | struct hid_device_id *id, char *alias) | 211 | struct hid_device_id *id, char *alias) |
212 | { | 212 | { |
213 | id->bus = TO_NATIVE(id->bus); | ||
213 | id->vendor = TO_NATIVE(id->vendor); | 214 | id->vendor = TO_NATIVE(id->vendor); |
214 | id->product = TO_NATIVE(id->product); | 215 | id->product = TO_NATIVE(id->product); |
215 | 216 | ||
@@ -709,6 +710,14 @@ static int do_dmi_entry(const char *filename, struct dmi_system_id *id, | |||
709 | strcat(alias, ":"); | 710 | strcat(alias, ":"); |
710 | return 1; | 711 | return 1; |
711 | } | 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 | |||
712 | /* Ignore any prefix, eg. some architectures prepend _ */ | 721 | /* Ignore any prefix, eg. some architectures prepend _ */ |
713 | static inline int sym_is(const char *symbol, const char *name) | 722 | static inline int sym_is(const char *symbol, const char *name) |
714 | { | 723 | { |
@@ -848,6 +857,10 @@ void handle_moddevtable(struct module *mod, struct elf_info *info, | |||
848 | do_table(symval, sym->st_size, | 857 | do_table(symval, sym->st_size, |
849 | sizeof(struct dmi_system_id), "dmi", | 858 | sizeof(struct dmi_system_id), "dmi", |
850 | 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); | ||
851 | free(zeros); | 864 | free(zeros); |
852 | } | 865 | } |
853 | 866 | ||
diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c index 88921611b22e..8cc70612984c 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) |
@@ -1604,12 +1607,12 @@ static void read_symbols(char *modname) | |||
1604 | 1607 | ||
1605 | parse_elf_finish(&info); | 1608 | parse_elf_finish(&info); |
1606 | 1609 | ||
1607 | /* Our trick to get versioning for struct_module - it's | 1610 | /* Our trick to get versioning for module struct etc. - it's |
1608 | * never passed as an argument to an exported function, so | 1611 | * never passed as an argument to an exported function, so |
1609 | * the automatic versioning doesn't pick it up, but it's really | 1612 | * the automatic versioning doesn't pick it up, but it's really |
1610 | * important anyhow */ | 1613 | * important anyhow */ |
1611 | if (modversions) | 1614 | if (modversions) |
1612 | mod->unres = alloc_symbol("struct_module", 0, mod->unres); | 1615 | mod->unres = alloc_symbol("module_layout", 0, mod->unres); |
1613 | } | 1616 | } |
1614 | 1617 | ||
1615 | #define SZ 500 | 1618 | #define SZ 500 |