modpost: Fix modpost's license checking V3
authorAlessio Igor Bogani <abogani@kernel.org>
Thu, 14 Jul 2011 06:51:16 +0000 (08:51 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 13 Apr 2012 15:14:07 +0000 (08:14 -0700)
commite189ac814b74b6604ee5b727f711b3294044cc32
treede5247ea687e27d9a263d6dc6173a7805ec6dc67
parent41ae97bd8c2166184bf0552b7c41868b74344039
modpost: Fix modpost's license checking V3

commit 62a2635610dbc83c5e8d724e00941eee4d18c186 upstream.

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
(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>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
scripts/mod/modpost.c