scripts/kallsyms was failing to identify variables local to modules as being in
those modules, which is unfortunate because a large number of DTrace module
references are to data symbols.
This is easily enough fixed by recording variable references as well as function
references, which was all we were tracking before this. Alas, this breaks our
heuristic that symbols whose names are seen more than once must be outside all
modules, because external variable references can be seen multiple times inside
a single module even when the thing they are a reference to is also inside that
module. The fix to this is to differentiate between 'names seen in this module'
and 'names seen in prior modules', recording newly-seen names in the former list
and moving them en masse to the latter when we switch from scanning one module
to scanning another. We can then define a symbol as being 'not in any module'
iff it is seen while present in the names-seen-in-prior-modules list: a symbol
that is seen repeatedly but only inside a single module's object file is still
considered to be part of that module under this scheme.
Signed-off-by: Nick Alcock <nick.alcock@oracle.com>