lkml.org 
[lkml]   [2012]   [Mar]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH] modpost: Fix modpost's license checking V3
On 03/23/12 19:04, Frank Rowand wrote:
> On 07/13/11 23:51, Alessio Igor Bogani wrote:
>> The commit f02e8a6 sorts symbols placing each of them in its own elf section.
>> The sorting and merging into the canonical sections are done by the linker.
>> Unfortunately modpost to generate Module.symvers file parses vmlinux
>
> Yet another unfortunately: modpost parses vmlinux.o instead of vmlinux (vmlinux
> does not yet exist at this point of the build). vmlinux.o also does not have
> the many sections sorted and merged into the canonical sections. As a result,
> the Module.symvers created my modpost incorrectly reports the license of all
> exports as "(unknown)".
>
> Can you fix this also please?

The attached patch modifies your patch to also use export_from_secname()
for vmlinux and vmlinux.o.

This is a rather blind shot at fixing the problem, so please review
carefully. After applying the patch, Module.symvers reports the license
correctly for exports from vmlinux.o.

>
>
>> (already linked) 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.
>>
>> Thanks to Arnaud Lacombe <lacombar@gmail.com> and Anders Kaseorg
>> <andersk@ksplice.com> for providing useful suggestions about code.
>>
>> This work was supported by a hardware donation from the CE Linux Forum.
>>
>> Reported-by: Jan Beulich <jbeulich@novell.com>
>> Signed-off-by: Alessio Igor Bogani <abogani@kernel.org>
>> ---
>> scripts/mod/modpost.c | 29 ++++++++++++++++++++++++++++-
>> 1 files changed, 28 insertions(+), 1 deletions(-)
>
> < snip >
>
> -Frank Rowand

Signed-off-by: Frank Rowand <frank.rowand@am.sony.com>
---
scripts/mod/modpost.c | 2 1 + 1 - 0 !
1 file changed, 1 insertion(+), 1 deletion(-)

Index: b/scripts/mod/modpost.c
===================================================================
--- a/scripts/mod/modpost.c
+++ b/scripts/mod/modpost.c
@@ -589,7 +589,7 @@ static void handle_modversions(struct mo
unsigned int crc;
enum export export;

- if (!is_vmlinux(mod->name) && strncmp(symname, "__ksymtab", 9) == 0)
+ if (strncmp(symname, "__ksymtab", 9) == 0)
export = export_from_secname(info, get_secindex(info, sym));
else
export = export_from_sec(info, get_secindex(info, sym));


\
 
 \ /
  Last update: 2012-03-27 04:01    [W:0.144 / U:0.320 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site