kallsyms: fix /proc/kallmodsyms to not be misled by external symbols
The population of /proc/kallmodsyms is thrown off by external symbols: not only
does it include them in /proc/kallmodsyms even if they have no corresponding
definition, because the relevant definition is not configured in (leading to a
huge number of useless symbols), but it assumes that if the symbol appears
in one built-in module, the symbol is defined there, even if it was declared
'extern'.
This can lead to lunacies such as saved_command_line appearing to come from the
openprom module and stuff like that. More generally, it can lead to symbols
apparently moving around if extern references to them are added or modules are
added to the kernel configuration, which is clearly unacceptable.
Orabug:
21172433
Signed-off-by: Nick Alcock <nick.alcock@oracle.com>
Reviewed-by: Todd Vierling <todd.vierling@oracle.com>