aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorFrank Rowand <frank.rowand@am.sony.com>2012-04-09 17:59:03 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-04-13 08:14:07 -0700
commitd13149924c357cbdb4ce577f17ace9bee927d4ed (patch)
tree33134d92a492bf3d7c34beaac46d4d9d7838520e /scripts
parente189ac814b74b6604ee5b727f711b3294044cc32 (diff)
downloadkernel_samsung_tuna-d13149924c357cbdb4ce577f17ace9bee927d4ed.zip
kernel_samsung_tuna-d13149924c357cbdb4ce577f17ace9bee927d4ed.tar.gz
kernel_samsung_tuna-d13149924c357cbdb4ce577f17ace9bee927d4ed.tar.bz2
modpost: Fix modpost license checking of vmlinux.o
commit 258f742635360175564e9470eb060ff4d4b984e7 upstream. Commit f02e8a6596b7 ("module: Sort exported symbols") sorts symbols placing each of them in its own elf section. This sorting and merging into the canonical sections are done by the linker. Unfortunately modpost to generate Module.symvers file parses vmlinux.o (which is not linked yet) and all modules object files (which aren't linked yet). These aren't sanitized by the linker yet. That breaks modpost that can't detect license properly for modules. This patch makes modpost aware of the new exported symbols structure. [ This above is a slightly corrected version of the explanation of the problem, copied from commit 62a2635610db ("modpost: Fix modpost's license checking V3"). That commit fixed the problem for module object files, but not for vmlinux.o. This patch fixes modpost for vmlinux.o. ] Signed-off-by: Frank Rowand <frank.rowand@am.sony.com> Signed-off-by: Alessio Igor Bogani <abogani@kernel.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/mod/modpost.c7
-rw-r--r--scripts/mod/modpost.h1
2 files changed, 6 insertions, 2 deletions
diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
index 628ea4c..e3cd345 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 2031119..51207e4 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 {