aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/mod
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/mod')
-rw-r--r--scripts/mod/file2alias.c9
-rw-r--r--scripts/mod/modpost.c7
-rw-r--r--scripts/mod/modpost.h1
3 files changed, 14 insertions, 3 deletions
diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c
index 8e730ccc3f2b..5759751a1f61 100644
--- a/scripts/mod/file2alias.c
+++ b/scripts/mod/file2alias.c
@@ -336,10 +336,13 @@ static int do_hid_entry(const char *filename,
336 struct hid_device_id *id, char *alias) 336 struct hid_device_id *id, char *alias)
337{ 337{
338 id->bus = TO_NATIVE(id->bus); 338 id->bus = TO_NATIVE(id->bus);
339 id->group = TO_NATIVE(id->group);
339 id->vendor = TO_NATIVE(id->vendor); 340 id->vendor = TO_NATIVE(id->vendor);
340 id->product = TO_NATIVE(id->product); 341 id->product = TO_NATIVE(id->product);
341 342
342 sprintf(alias, "hid:b%04X", id->bus); 343 sprintf(alias, "hid:");
344 ADD(alias, "b", id->bus != HID_BUS_ANY, id->bus);
345 ADD(alias, "g", id->group != HID_GROUP_ANY, id->group);
343 ADD(alias, "v", id->vendor != HID_ANY_ID, id->vendor); 346 ADD(alias, "v", id->vendor != HID_ANY_ID, id->vendor);
344 ADD(alias, "p", id->product != HID_ANY_ID, id->product); 347 ADD(alias, "p", id->product != HID_ANY_ID, id->product);
345 348
@@ -1100,6 +1103,10 @@ void handle_moddevtable(struct module *mod, struct elf_info *info,
1100 if (!sym->st_shndx || get_secindex(info, sym) >= info->num_sections) 1103 if (!sym->st_shndx || get_secindex(info, sym) >= info->num_sections)
1101 return; 1104 return;
1102 1105
1106 /* We're looking for an object */
1107 if (ELF_ST_TYPE(sym->st_info) != STT_OBJECT)
1108 return;
1109
1103 /* All our symbols are of form <prefix>__mod_XXX_device_table. */ 1110 /* All our symbols are of form <prefix>__mod_XXX_device_table. */
1104 name = strstr(symname, "__mod_"); 1111 name = strstr(symname, "__mod_");
1105 if (!name) 1112 if (!name)
diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
index 3f01fd908730..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));
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
118struct elf_info { 119struct elf_info {