summaryrefslogtreecommitdiffstats
path: root/scripts/mod/modpost.c
diff options
context:
space:
mode:
authorAndi Kleen <ak@linux.intel.com>2014-02-08 09:01:12 +0100
committerH. Peter Anvin <hpa@linux.intel.com>2014-02-13 20:24:58 -0800
commit7d02b490e93c199a15b3c4bce1c393588c1300ca (patch)
tree3f899f31df5ee2a23e1df73a9b18a36af02677e4 /scripts/mod/modpost.c
parent77ab21adae509c5540956729e2d03bc1a59bc82a (diff)
downloadlinux-7d02b490e93c199a15b3c4bce1c393588c1300ca.tar.bz2
Kbuild, lto: Drop .number postfixes in modpost
LTO turns all global symbols effectively into statics. This has the side effect that they all have a .NUMBER postfix to make them unique. In modpost drop this postfix because it confuses it. Signed-off-by: Andi Kleen <ak@linux.intel.com> Link: http://lkml.kernel.org/r/1391846481-31491-8-git-send-email-ak@linux.intel.com Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Diffstat (limited to 'scripts/mod/modpost.c')
-rw-r--r--scripts/mod/modpost.c15
1 files changed, 14 insertions, 1 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,
}
}
+static char *remove_dot(char *s)
+{
+ char *end;
+ int n = strcspn(s, ".");
+
+ if (n > 0 && s[n] != 0) {
+ strtoul(s + n + 1, &end, 10);
+ if (end > s + n + 1 && (*end == '.' || *end == 0))
+ s[n] = 0;
+ }
+ return s;
+}
+
static void read_symbols(char *modname)
{
const char *symname;
@@ -1722,7 +1735,7 @@ static void read_symbols(char *modname)
}
for (sym = info.symtab_start; sym < info.symtab_stop; sym++) {
- symname = info.strtab + sym->st_name;
+ symname = remove_dot(info.strtab + sym->st_name);
handle_modversions(mod, &info, sym, symname);
handle_moddevtable(mod, &info, sym, symname);