diff options
| author | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2012-05-24 04:13:01 -0400 |
|---|---|---|
| committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2012-05-24 04:13:01 -0400 |
| commit | e644dae645e167d154c0526358940986682a72b0 (patch) | |
| tree | 972993c6568085b8d407fc7e13de10f4b93c651d /scripts/mod | |
| parent | 899c612d74d4a242158a4db20367388d6299c028 (diff) | |
| parent | 86809173ce32ef03bd4d0389dfc72df0c805e9c4 (diff) | |
Merge branch 'next' into for-linus
Diffstat (limited to 'scripts/mod')
| -rw-r--r-- | scripts/mod/file2alias.c | 25 | ||||
| -rw-r--r-- | scripts/mod/modpost.c | 9 | ||||
| -rw-r--r-- | scripts/mod/modpost.h | 1 |
3 files changed, 32 insertions, 3 deletions
diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c index b89efe6e4c85..8e730ccc3f2b 100644 --- a/scripts/mod/file2alias.c +++ b/scripts/mod/file2alias.c | |||
| @@ -1029,6 +1029,31 @@ static int do_amba_entry(const char *filename, | |||
| 1029 | } | 1029 | } |
| 1030 | ADD_TO_DEVTABLE("amba", struct amba_id, do_amba_entry); | 1030 | ADD_TO_DEVTABLE("amba", struct amba_id, do_amba_entry); |
| 1031 | 1031 | ||
| 1032 | /* LOOKS like x86cpu:vendor:VVVV:family:FFFF:model:MMMM:feature:*,FEAT,* | ||
| 1033 | * All fields are numbers. It would be nicer to use strings for vendor | ||
| 1034 | * and feature, but getting those out of the build system here is too | ||
| 1035 | * complicated. | ||
| 1036 | */ | ||
| 1037 | |||
| 1038 | static int do_x86cpu_entry(const char *filename, struct x86_cpu_id *id, | ||
| 1039 | char *alias) | ||
| 1040 | { | ||
| 1041 | id->feature = TO_NATIVE(id->feature); | ||
| 1042 | id->family = TO_NATIVE(id->family); | ||
| 1043 | id->model = TO_NATIVE(id->model); | ||
| 1044 | id->vendor = TO_NATIVE(id->vendor); | ||
| 1045 | |||
| 1046 | strcpy(alias, "x86cpu:"); | ||
| 1047 | ADD(alias, "vendor:", id->vendor != X86_VENDOR_ANY, id->vendor); | ||
| 1048 | ADD(alias, ":family:", id->family != X86_FAMILY_ANY, id->family); | ||
| 1049 | ADD(alias, ":model:", id->model != X86_MODEL_ANY, id->model); | ||
| 1050 | strcat(alias, ":feature:*"); | ||
| 1051 | if (id->feature != X86_FEATURE_ANY) | ||
| 1052 | sprintf(alias + strlen(alias), "%04X*", id->feature); | ||
| 1053 | return 1; | ||
| 1054 | } | ||
| 1055 | ADD_TO_DEVTABLE("x86cpu", struct x86_cpu_id, do_x86cpu_entry); | ||
| 1056 | |||
| 1032 | /* Does namelen bytes of name exactly match the symbol? */ | 1057 | /* Does namelen bytes of name exactly match the symbol? */ |
| 1033 | static bool sym_is(const char *name, unsigned namelen, const char *symbol) | 1058 | static bool sym_is(const char *name, unsigned namelen, const char *symbol) |
| 1034 | { | 1059 | { |
diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c index 9adb667dd31a..c4e7d1510f9d 100644 --- a/scripts/mod/modpost.c +++ b/scripts/mod/modpost.c | |||
| @@ -132,8 +132,10 @@ static struct module *new_module(char *modname) | |||
| 132 | /* strip trailing .o */ | 132 | /* strip trailing .o */ |
| 133 | s = strrchr(p, '.'); | 133 | s = strrchr(p, '.'); |
| 134 | if (s != NULL) | 134 | if (s != NULL) |
| 135 | if (strcmp(s, ".o") == 0) | 135 | if (strcmp(s, ".o") == 0) { |
| 136 | *s = '\0'; | 136 | *s = '\0'; |
| 137 | mod->is_dot_o = 1; | ||
| 138 | } | ||
| 137 | 139 | ||
| 138 | /* add to list */ | 140 | /* add to list */ |
| 139 | mod->name = p; | 141 | mod->name = p; |
| @@ -587,7 +589,8 @@ static void handle_modversions(struct module *mod, struct elf_info *info, | |||
| 587 | unsigned int crc; | 589 | unsigned int crc; |
| 588 | enum export export; | 590 | enum export export; |
| 589 | 591 | ||
| 590 | if (!is_vmlinux(mod->name) && strncmp(symname, "__ksymtab", 9) == 0) | 592 | if ((!is_vmlinux(mod->name) || mod->is_dot_o) && |
| 593 | strncmp(symname, "__ksymtab", 9) == 0) | ||
| 591 | export = export_from_secname(info, get_secindex(info, sym)); | 594 | export = export_from_secname(info, get_secindex(info, sym)); |
| 592 | else | 595 | else |
| 593 | export = export_from_sec(info, get_secindex(info, sym)); | 596 | export = export_from_sec(info, get_secindex(info, sym)); |
| @@ -849,7 +852,7 @@ static void check_section(const char *modname, struct elf_info *elf, | |||
| 849 | 852 | ||
| 850 | #define ALL_INIT_DATA_SECTIONS \ | 853 | #define ALL_INIT_DATA_SECTIONS \ |
| 851 | ".init.setup$", ".init.rodata$", \ | 854 | ".init.setup$", ".init.rodata$", \ |
| 852 | ".devinit.rodata$", ".cpuinit.rodata$", ".meminit.rodata$" \ | 855 | ".devinit.rodata$", ".cpuinit.rodata$", ".meminit.rodata$", \ |
| 853 | ".init.data$", ".devinit.data$", ".cpuinit.data$", ".meminit.data$" | 856 | ".init.data$", ".devinit.data$", ".cpuinit.data$", ".meminit.data$" |
| 854 | #define ALL_EXIT_DATA_SECTIONS \ | 857 | #define ALL_EXIT_DATA_SECTIONS \ |
| 855 | ".exit.data$", ".devexit.data$", ".cpuexit.data$", ".memexit.data$" | 858 | ".exit.data$", ".devexit.data$", ".cpuexit.data$", ".memexit.data$" |
diff --git a/scripts/mod/modpost.h b/scripts/mod/modpost.h index 2031119080dc..51207e4d5f8b 100644 --- a/scripts/mod/modpost.h +++ b/scripts/mod/modpost.h | |||
| @@ -113,6 +113,7 @@ struct module { | |||
| 113 | int has_cleanup; | 113 | int has_cleanup; |
| 114 | struct buffer dev_table_buf; | 114 | struct buffer dev_table_buf; |
| 115 | char srcversion[25]; | 115 | char srcversion[25]; |
| 116 | int is_dot_o; | ||
| 116 | }; | 117 | }; |
| 117 | 118 | ||
| 118 | struct elf_info { | 119 | struct elf_info { |
