Avoid over-suppressing fns & vars when analysing the Kernel
When analyzing the Linux Kernel (with e.g abidw) and providing a
symbol whitelist the DWARF reader performs a speed optimization which
is that it does not read the symbol table of the kernel binary.
To know if a function is to be suppressed (because it doesn't belong
to the whitelist, for instance) dwarf_reader::function_is_suppressed
actually tries to see if the address of the function corresponds to
the address of an ELF symbol that is publicly exported, before looking
at if the function was suppressed by a suppression specification.
But then, when a whitelist is provided and the speed optimization of
not reading the symbol table is at play, there is no information about
ELF symbol addressed around. So dwarf_reader::function_is_suppressed
almost always supposes that the function is suppressed.
This patch fixes that by not trying to look at the address of the
function/variable when the symbol table optimization is on.
* include/abg-dwarf-reader.h (get_ignore_symbol_table): Take a
const read_context&.
* src/abg-dwarf-reader.cc (get_ignore_symbol_table): Likewise.
(function_is_suppressed): When the symbol table optimization is in
flight -- that is, when no symbol table has been loaded -- do not
try to see if a given function symbol was exported at the ELF
level or not. Just look at if the function was suppressed or not.
(variable_is_suppressed): Likewise for variables.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>