libabigail/tests
Matthias Maennich 2ed1ca7031 corpus: make get_(undefined_)?_(var|fun)_symbols use the new symtab
Make the corresponding members an implementation detail of corpus::priv.
They get computed based on the new symtab whenever they are accessed
first with an atomic instantiation. That simplifies the implementation
and homogenizes the access to functions and variables. Sorting does not
need to be done as the symtab already gives a guarantee for that.

Due to improved alias detection in the new symtab reader, ensure we only
write symbol aliases to ksymtab symbols if having a ksymtab main symbol.

Test data needed to be adjusted as the new symtab reader is stricter in
regards to symbols listed in ksymtab. I.e. init_module is not an
exported symbol in the ksymtab of a kernel module.

	* src/abg-corpus-priv.h (corpus::priv::sorted_var_symbols): make
	  private, mutable and optional.
	  (corpus::sorted_undefined_var_symbols): Likewise.
	  (corpus::sorted_fun_symbols): Likewise.
	  (corpus::sorted_undefined_fun_symbols): Likewise.
	  (corpus::priv::get_sorted_fun_symbols): New method declaration.
	  (corpus::priv::get_sorted_undefined_fun_symbols): Likewise.
	  (corpus::priv::get_sorted_var_symbols): Likewise.
	  (corpus::priv::get_sorted_undefined_var_symbols): Likewise.
	* src/abg-corpus.cc
	  (corpus::elf_symbol_comp_functor): Delete struct.
	  (corpus::priv::get_sorted_fun_symbols): New method implementation.
	  (corpus::priv::get_sorted_undefined_fun_symbols): Likewise.
	  (corpus::priv::get_sorted_var_symbols): Likewise.
	  (corpus::priv::get_sorted_undefined_var_symbols): Likewise.
	  (corpus::get_sorted_fun_symbols): Proxy call to corpus::priv.
	  (corpus::get_sorted_undefined_fun_symbols): Likewise.
	  (corpus::get_sorted_var_symbols): Likewise.
	  (corpus::get_sorted_undefined_var_symbols): Likewise.
	* src/abg-writer.cc (write_elf_symbol_aliases): When emitting
	  aliases for a kernel symbol, ensure to only emit exported,
	  public aliases.
	* tests/data/test-read-dwarf/PR25007-sdhci.ko.abi: update test
	  data.

Reviewed-by: Giuliano Procida <gprocida@google.com>
Reviewed-by: Dodji Seketeli <dodji@seketeli.org>
Signed-off-by: Matthias Maennich <maennich@google.com>
2021-04-02 10:40:10 +02:00
..
data corpus: make get_(undefined_)?_(var|fun)_symbols use the new symtab 2021-04-02 10:40:10 +02:00
lib tests/catch.hpp: Add SPDX header back 2021-03-08 11:33:56 +01:00
.gitignore tests/.gitignore: ignore all files starting with runtest* 2020-05-13 11:26:28 +02:00
Makefile.am Bug 27512 - Remove broken zip-archive support 2021-03-19 10:52:57 +01:00
mockfedabipkgdiff.in Re-license the project to Apache v2 With LLVM Exception 2020-12-02 11:49:13 +01:00
print-diff-tree.cc Re-license the project to Apache v2 With LLVM Exception 2020-12-02 11:49:13 +01:00
runtestcanonicalizetypes.sh.in Re-license the project to Apache v2 With LLVM Exception 2020-12-02 11:49:13 +01:00
runtestdefaultsupprs.py.in Re-license the project to Apache v2 With LLVM Exception 2020-12-02 11:49:13 +01:00
runtestdefaultsupprspy3.sh.in Re-license the project to Apache v2 With LLVM Exception 2020-12-02 11:49:13 +01:00
runtestfedabipkgdiff.py.in Re-license the project to Apache v2 With LLVM Exception 2020-12-02 11:49:13 +01:00
runtestfedabipkgdiffpy3.sh.in Re-license the project to Apache v2 With LLVM Exception 2020-12-02 11:49:13 +01:00
runtestslowselfcompare.sh.in Bug 26769 - Fix missing types in abixml output 2020-11-23 13:02:34 +01:00
test-abicompat.cc Re-license the project to Apache v2 With LLVM Exception 2020-12-02 11:49:13 +01:00
test-abidiff-exit.cc Add qualifier / typedef / array / pointer test 2020-12-10 10:04:17 +01:00
test-abidiff.cc Re-license the project to Apache v2 With LLVM Exception 2020-12-02 11:49:13 +01:00
test-alt-dwarf-file.cc Re-license the project to Apache v2 With LLVM Exception 2020-12-02 11:49:13 +01:00
test-annotate.cc Re-license the project to Apache v2 With LLVM Exception 2020-12-02 11:49:13 +01:00
test-core-diff.cc Re-license the project to Apache v2 With LLVM Exception 2020-12-02 11:49:13 +01:00
test-cxx-compat.cc abg-cxx-compat: add simplified version of std::optional 2021-03-09 10:41:10 +01:00
test-diff2.cc Re-license the project to Apache v2 With LLVM Exception 2020-12-02 11:49:13 +01:00
test-diff-dwarf-abixml.cc Re-license the project to Apache v2 With LLVM Exception 2020-12-02 11:49:13 +01:00
test-diff-dwarf.cc Re-license the project to Apache v2 With LLVM Exception 2020-12-02 11:49:13 +01:00
test-diff-filter.cc Bug 27598 - abidiff mishandles union member functions 2021-03-31 18:21:28 +02:00
test-diff-pkg.cc dwarf-reader: Support more DWARF-5 type DIEs 2021-03-18 13:41:18 +01:00
test-diff-suppr.cc Bug 27267 - Better support for opaque enum types 2021-02-04 09:26:05 +01:00
test-dot.cc Re-license the project to Apache v2 With LLVM Exception 2020-12-02 11:49:13 +01:00
test-elf-helpers.cc Re-license the project to Apache v2 With LLVM Exception 2020-12-02 11:49:13 +01:00
test-ini.cc Re-license the project to Apache v2 With LLVM Exception 2020-12-02 11:49:13 +01:00
test-ir-walker.cc Re-license the project to Apache v2 With LLVM Exception 2020-12-02 11:49:13 +01:00
test-kmi-whitelist.cc Re-license the project to Apache v2 With LLVM Exception 2020-12-02 11:49:13 +01:00
test-lookup-syms.cc Re-license the project to Apache v2 With LLVM Exception 2020-12-02 11:49:13 +01:00
test-read-dwarf.cc Remove <memory> usages from abg_compat 2020-12-15 09:08:52 +01:00
test-read-write.cc Drop unneccessary includes of abg-cxx-compat.h 2020-12-15 09:23:44 +01:00
test-svg.cc Re-license the project to Apache v2 With LLVM Exception 2020-12-02 11:49:13 +01:00
test-symtab-reader.cc dwarf-reader split: create abg-symtab-reader.{h,cc} and test case 2021-03-10 18:54:55 +01:00
test-symtab.cc Integrate new symtab reader into corpus and read_context 2021-04-01 14:37:26 +02:00
test-tools-utils.cc Re-license the project to Apache v2 With LLVM Exception 2020-12-02 11:49:13 +01:00
test-types-stability.cc Bug 27165 - Better support multi-language binaries 2021-02-02 16:15:29 +01:00
test-utils.cc Re-license the project to Apache v2 With LLVM Exception 2020-12-02 11:49:13 +01:00
test-utils.h Re-license the project to Apache v2 With LLVM Exception 2020-12-02 11:49:13 +01:00
test-valgrind-suppressions.supp Shut down a helgrind false positive in the "system" libc call 2017-03-17 09:02:19 +01:00
update-test-output.py Re-license the project to Apache v2 With LLVM Exception 2020-12-02 11:49:13 +01:00