libabigail/include
Dodji Seketeli b00976517f Support symbol_name_not_regexp in [suppress_{function, variable}]
In the suppress_function and suppress_variable directives of the
suppression specification language, we lack the
'symbol_name_not_regexp' properties, that would allow users to specify
which (function/variable) symbols to *keep* as opposed to specifying
which symbols to suppress.

This patch adds that feature.  That will later allow us to make the
linux kernel symbol white lists[1] functionality use this feature;
that is, upon analysing the content of a kernel symbol whitelist which
lists a symbol named "foo", Libabigail would automatically generate a
suppression specification which contains, e.g a 'suppress_function"
directive that has this new 'symbol_name_not_regexp' property which
value is set to "foo".

Note that the patch makes sure that feature is supported when
analyzing both abixml and DWARF formats.

[1]: You can learn about what a Linux Kernel symbols white list is by
reading about it at
https://sourceware.org/libabigail/manual/kmidiff.html#environment.

	* doc/manuals/libabigail-concepts.rst: Document the new
	symbol_name_not_regexp properties for the
	suppress_{function,variable} directives.
	* include/abg-suppression.h
	({function,variable}_suppression::{g,s}et_symbol_name_not_regex_str):
	Declare new member functions.
	* src/abg-dwarf-reader.cc
	(read_context::is_elf_symbol_suppressed): Define new member functions.
	(read_context::{load_symbol_maps_from_symtab_section,
	populate_symbol_map_from_ksymtab,
	populate_symbol_map_from_ksymtab_reloc}): Drop suppressed symbols
	when reading symbol tables.
	({function,variable}_is_suppressed): Consider that in C, the
	linkage name is _by default_ the same as the function/variable
	name. Remove local variable.
	* include/abg-ir.h (elf_symbol_is_{function,variable}): Add ...
	* src/abg-ir.cc (elf_symbol_is_{function,variable}): ... new
	functions.
	* src/abg-reader.cc (build_elf_symbol): Take an additional boolean
	to detect and drop suppressed symbols.
	(build_elf_symbol_db): Adjust the call to build_elf_symbol to make
	it detect and drop suppressed symbols.
	(read_corpus_from_input): Be mindful that the set of symbols for a
	given corpus can be empty because of suppression specifications.
	* src/abg-suppression-priv.h
	({function,variable}_suppression::priv::symbol_name_not_regex[_str_]):
	Add new data members.
	(function,variable}_suppression::priv::get_symbol_name_not_regex):
	Add new member functions.
	({function,variable}_is_suppressed): Guard against empty name.
	(is_elf_symbol_suppressed): Define new function template.
	* src/abg-suppression.cc
	({function,variable}_suppression::{g,s}et_symbol_name_not_regex_str):
	Define new member functions.
	({function,variable}_suppression::suppresses_function)
	(suppression_matches_{function,variable}_sym_name)
	(read_{function,variable}_suppression): Support the new
	"symbol_name_not_regex" property.
	* tests/data/test-diff-suppr/test44-suppr-sym-name-not-regexp-report-1.txt:
	New test reference report.
	* tests/data/test-diff-suppr/test44-suppr-sym-name-not-regexp-report-2.txt:
	Likewise.
	* tests/data/test-diff-suppr/test44-suppr-sym-name-not-regexp-v{0,1}.c:
	Sources of the new test input.
	* tests/data/test-diff-suppr/test44-suppr-sym-name-not-regexp-v{0,1}.o:
	New test input binaries.
	* tests/data/test-diff-suppr/test44-suppr-sym-name-not-regexp-v{0,1}.o.abi:
	New test input abixml files.
	* tests/data/test-diff-suppr/test44-suppr-sym-name-not-regexp.suppr.txt:
	Next test suppression specification.
	* tests/data/Makefile.am: Add the new test material above to
	source distribution.
	* tests/test-diff-suppr.cc (in_out_specs): Add the input tests
	above to the test harness.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2019-11-08 11:01:54 +01:00
..
abg-comp-filter.h Bug 24731 - Wrongly reporting union members order change 2019-06-26 11:09:43 +02:00
abg-comparison.h Bug 24787 - Filter out enum changes into compatible integer types 2019-07-19 18:22:12 +02:00
abg-config.h Update copyright for 2019 2019-01-07 14:54:47 +01:00
abg-corpus.h Implement fast comparison of Linux Kernel types when applicable 2019-07-17 19:35:38 +02:00
abg-cxx-compat.h Add compatibility layer for C++11 mode 2019-07-09 18:05:28 +02:00
abg-diff-utils.h Add compatibility layer for C++11 mode 2019-07-09 18:05:28 +02:00
abg-dwarf-reader.h Avoid over-suppressing fns & vars when analysing the Kernel 2019-02-19 17:42:56 +01:00
abg-fwd.h Serialize canonical types to avoid testing if types have been emitted 2019-09-17 17:52:26 +02:00
abg-hash.h Update copyright for 2019 2019-01-07 14:54:47 +01:00
abg-ini.h Add compatibility layer for C++11 mode 2019-07-09 18:05:28 +02:00
abg-interned-str.h Add compatibility layer for C++11 mode 2019-07-09 18:05:28 +02:00
abg-ir.h Support symbol_name_not_regexp in [suppress_{function, variable}] 2019-11-08 11:01:54 +01:00
abg-libxml-utils.h Add compatibility layer for C++11 mode 2019-07-09 18:05:28 +02:00
abg-libzip-utils.h Add compatibility layer for C++11 mode 2019-07-09 18:05:28 +02:00
abg-reader.h Separate public types of first binary from those of the second 2019-01-16 12:27:45 +01:00
abg-reporter.h Add compatibility layer for C++11 mode 2019-07-09 18:05:28 +02:00
abg-sptr-utils.h Add compatibility layer for C++11 mode 2019-07-09 18:05:28 +02:00
abg-suppression.h Support symbol_name_not_regexp in [suppress_{function, variable}] 2019-11-08 11:01:54 +01:00
abg-tools-utils.h Add timing to the verbose logs of abidw 2019-07-19 10:46:42 +02:00
abg-traverse.h add missing virtual destructors 2019-04-16 16:11:01 +02:00
abg-version.h.in Add --version option to several libabigail tools 2015-11-16 12:54:10 +01:00
abg-viz-common.h Update copyright for 2019 2019-01-07 14:54:47 +01:00
abg-viz-dot.h viz-dot: remove unused members from dot 2019-04-16 16:11:01 +02:00
abg-viz-svg.h Update copyright for 2019 2019-01-07 14:54:47 +01:00
abg-workers.h Add compatibility layer for C++11 mode 2019-07-09 18:05:28 +02:00
abg-writer.h abg-writer: drop deprecated API 2019-05-22 14:33:45 +02:00
Makefile.am Add compatibility layer for C++11 mode 2019-07-09 18:05:28 +02:00