aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/mod
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/mod')
-rw-r--r--scripts/mod/file2alias.c19
-rw-r--r--scripts/mod/modpost.c9
2 files changed, 26 insertions, 2 deletions
diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c
index 5180405c1a84..d8ee38aede26 100644
--- a/scripts/mod/file2alias.c
+++ b/scripts/mod/file2alias.c
@@ -341,6 +341,22 @@ static int do_of_entry (const char *filename, struct of_device_id *of, char *ali
341 return 1; 341 return 1;
342} 342}
343 343
344static int do_vio_entry(const char *filename, struct vio_device_id *vio,
345 char *alias)
346{
347 char *tmp;
348
349 sprintf(alias, "vio:T%sS%s", vio->type[0] ? vio->type : "*",
350 vio->compat[0] ? vio->compat : "*");
351
352 /* Replace all whitespace with underscores */
353 for (tmp = alias; tmp && *tmp; tmp++)
354 if (isspace (*tmp))
355 *tmp = '_';
356
357 return 1;
358}
359
344/* Ignore any prefix, eg. v850 prepends _ */ 360/* Ignore any prefix, eg. v850 prepends _ */
345static inline int sym_is(const char *symbol, const char *name) 361static inline int sym_is(const char *symbol, const char *name)
346{ 362{
@@ -422,6 +438,9 @@ void handle_moddevtable(struct module *mod, struct elf_info *info,
422 else if (sym_is(symname, "__mod_of_device_table")) 438 else if (sym_is(symname, "__mod_of_device_table"))
423 do_table(symval, sym->st_size, sizeof(struct of_device_id), 439 do_table(symval, sym->st_size, sizeof(struct of_device_id),
424 do_of_entry, mod); 440 do_of_entry, mod);
441 else if (sym_is(symname, "__mod_vio_device_table"))
442 do_table(symval, sym->st_size, sizeof(struct vio_device_id),
443 do_vio_entry, mod);
425 444
426} 445}
427 446
diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
index 9b9f94c915d2..09ffca54b373 100644
--- a/scripts/mod/modpost.c
+++ b/scripts/mod/modpost.c
@@ -359,11 +359,16 @@ handle_modversions(struct module *mod, struct elf_info *info,
359 /* ignore __this_module, it will be resolved shortly */ 359 /* ignore __this_module, it will be resolved shortly */
360 if (strcmp(symname, MODULE_SYMBOL_PREFIX "__this_module") == 0) 360 if (strcmp(symname, MODULE_SYMBOL_PREFIX "__this_module") == 0)
361 break; 361 break;
362#ifdef STT_REGISTER 362/* cope with newer glibc (2.3.4 or higher) STT_ definition in elf.h */
363#if defined(STT_REGISTER) || defined(STT_SPARC_REGISTER)
364/* add compatibility with older glibc */
365#ifndef STT_SPARC_REGISTER
366#define STT_SPARC_REGISTER STT_REGISTER
367#endif
363 if (info->hdr->e_machine == EM_SPARC || 368 if (info->hdr->e_machine == EM_SPARC ||
364 info->hdr->e_machine == EM_SPARCV9) { 369 info->hdr->e_machine == EM_SPARCV9) {
365 /* Ignore register directives. */ 370 /* Ignore register directives. */
366 if (ELF_ST_TYPE(sym->st_info) == STT_REGISTER) 371 if (ELF_ST_TYPE(sym->st_info) == STT_SPARC_REGISTER)
367 break; 372 break;
368 } 373 }
369#endif 374#endif