diff options
Diffstat (limited to 'scripts/mod')
| -rw-r--r-- | scripts/mod/file2alias.c | 4 | ||||
| -rw-r--r-- | scripts/mod/modpost.c | 7 | ||||
| -rw-r--r-- | scripts/mod/modpost.h | 1 | 
3 files changed, 10 insertions, 2 deletions
diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c index 8e730ccc3f2b..44ddaa542db6 100644 --- a/scripts/mod/file2alias.c +++ b/scripts/mod/file2alias.c @@ -1100,6 +1100,10 @@ void handle_moddevtable(struct module *mod, struct elf_info *info,  	if (!sym->st_shndx || get_secindex(info, sym) >= info->num_sections)  		return; +	/* We're looking for an object */ +	if (ELF_ST_TYPE(sym->st_info) != STT_OBJECT) +		return; +  	/* All our symbols are of form <prefix>__mod_XXX_device_table. */  	name = strstr(symname, "__mod_");  	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)  	/* strip trailing .o */  	s = strrchr(p, '.');  	if (s != NULL) -		if (strcmp(s, ".o") == 0) +		if (strcmp(s, ".o") == 0) {  			*s = '\0'; +			mod->is_dot_o = 1; +		}  	/* add to list */  	mod->name = p; @@ -587,7 +589,8 @@ static void handle_modversions(struct module *mod, struct elf_info *info,  	unsigned int crc;  	enum export export; -	if (!is_vmlinux(mod->name) && strncmp(symname, "__ksymtab", 9) == 0) +	if ((!is_vmlinux(mod->name) || mod->is_dot_o) && +	    strncmp(symname, "__ksymtab", 9) == 0)  		export = export_from_secname(info, get_secindex(info, sym));  	else  		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 {  	int has_cleanup;  	struct buffer dev_table_buf;  	char	     srcversion[25]; +	int is_dot_o;  };  struct elf_info {  | 
