Bug 25095 - Apply symbol white lists to ELF symbols
authorDodji Seketeli <dodji@redhat.com>
Fri, 18 Oct 2019 09:16:38 +0000 (11:16 +0200)
committerDodji Seketeli <dodji@redhat.com>
Fri, 8 Nov 2019 10:04:11 +0000 (11:04 +0100)
commit6148ec50101e54473975a02d504acf84cc100361
treeb06912644ea474e5300b54681a95e26c6b8d43d8
parentb00976517fb3f622e7a6e44204b3f1161e9e2952
Bug 25095 - Apply symbol white lists to ELF symbols

Right now, the symbol names that are part of a Linux Kernel ABI
white list are matched against function and variable names that appear
in the DWARF information.

In other words, when Libabigail processes the Linux Kernel ABI
whitelist, it generates a suppression specifications which keeps
functions and variables (as described by DWARF) whose names match the
symbol names specified in the white list.  All other functions and
variables are dropped.  But that doesn't apply to ELF symbols.
Libabigail generates no suppression at all for ELF symbols.  It only
considers variables and functions described in the debug information.

With this patch, Libabiagil now generates a suppression specification
which keeps functions and variables whose ELF symbol name match the
symbol names specified in the whitelist.  The suppression
specification also drops ELF symbols whose name don't match the names
specified in the white list.

Note that this patch uses the previous commit which description is:
    "Support symbol_name_not_regexp in [suppress_{function, variable}]"

* src/abg-tools-utils.cc (gen_suppr_spec_from_kernel_abi_whitelist):
Generate a suppression specification which considers the name of
the symbol associated to a function/variable, rather than just the
name of said function/variable.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
src/abg-tools-utils.cc