diff options
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/mod/modpost.c | 15 | ||||
-rw-r--r-- | scripts/mod/modpost.h | 2 |
2 files changed, 15 insertions, 2 deletions
diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c index 1f1b1549f33f..f91dd4565b81 100644 --- a/scripts/mod/modpost.c +++ b/scripts/mod/modpost.c | |||
@@ -1684,6 +1684,19 @@ static void check_sec_ref(struct module *mod, const char *modname, | |||
1684 | } | 1684 | } |
1685 | } | 1685 | } |
1686 | 1686 | ||
1687 | static char *remove_dot(char *s) | ||
1688 | { | ||
1689 | char *end; | ||
1690 | int n = strcspn(s, "."); | ||
1691 | |||
1692 | if (n > 0 && s[n] != 0) { | ||
1693 | strtoul(s + n + 1, &end, 10); | ||
1694 | if (end > s + n + 1 && (*end == '.' || *end == 0)) | ||
1695 | s[n] = 0; | ||
1696 | } | ||
1697 | return s; | ||
1698 | } | ||
1699 | |||
1687 | static void read_symbols(char *modname) | 1700 | static void read_symbols(char *modname) |
1688 | { | 1701 | { |
1689 | const char *symname; | 1702 | const char *symname; |
@@ -1722,7 +1735,7 @@ static void read_symbols(char *modname) | |||
1722 | } | 1735 | } |
1723 | 1736 | ||
1724 | for (sym = info.symtab_start; sym < info.symtab_stop; sym++) { | 1737 | for (sym = info.symtab_start; sym < info.symtab_stop; sym++) { |
1725 | symname = info.strtab + sym->st_name; | 1738 | symname = remove_dot(info.strtab + sym->st_name); |
1726 | 1739 | ||
1727 | handle_modversions(mod, &info, sym, symname); | 1740 | handle_modversions(mod, &info, sym, symname); |
1728 | handle_moddevtable(mod, &info, sym, symname); | 1741 | handle_moddevtable(mod, &info, sym, symname); |
diff --git a/scripts/mod/modpost.h b/scripts/mod/modpost.h index 51207e4d5f8b..168b43dc0a59 100644 --- a/scripts/mod/modpost.h +++ b/scripts/mod/modpost.h | |||
@@ -127,7 +127,7 @@ struct elf_info { | |||
127 | Elf_Section export_gpl_sec; | 127 | Elf_Section export_gpl_sec; |
128 | Elf_Section export_unused_gpl_sec; | 128 | Elf_Section export_unused_gpl_sec; |
129 | Elf_Section export_gpl_future_sec; | 129 | Elf_Section export_gpl_future_sec; |
130 | const char *strtab; | 130 | char *strtab; |
131 | char *modinfo; | 131 | char *modinfo; |
132 | unsigned int modinfo_len; | 132 | unsigned int modinfo_len; |
133 | 133 | ||