libabigail/tests
Matthias Maennich 578ba12139 symtab-reader: add support for binaries compiled with CFI
Control-Flow-Integrity (CFI) when enabled in clang built binaries
introduces an indirection when looking up ELF symbols. For DSO, the
symbol table (.dynsym) will still contain the symbols, but additional
symbols with suffix .cfi will be added to the full .symtab.
Unfortunately, the DWARF debug information refers to CFI symbols by
address to the .cfi suffixed variants as they point to the actual
implementation.

When the dwarf reader is determining whether to suppress variable or
function declarations, it does so by identifying if there is an
associated ELF symbol at the given address read from DWARF. Unless we
know about the alternative address, this will fail and the type
information will be suppressed.

Hence add the .cfi symbol values to the lookup map to associate their
address with the corresponding publicly exported symbol.

	* src/abg-symtab-reader.cc (symtab::load_): use new
	add_alternative_address_lookups method.
	(add_alternative_address_lookups): New method.
	* src/abg-symtab-reader.h (add_alternative_address_lookups): new
	function declaration.
	* tests/data/test-read-dwarf/test-libaaudio.so: New test data.
	* tests/data/test-read-dwarf/test-libaaudio.so.abi: New test data.
	* tests/data/Makefile.am: Add the two new tests input to source
	distribution.
	* tests/test-read-dwarf.cc: New test case.

Reported-by: Dan Albert <danalbert@google.com>
Reviewed-by: Giuliano Procida <gprocida@google.com>
Signed-off-by: Matthias Maennich <maennich@google.com>
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2021-07-15 17:47:33 +02:00
..
data symtab-reader: add support for binaries compiled with CFI 2021-07-15 17:47:33 +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 symtab: Add support for MODVERSIONS (CRC checksums) 2021-04-02 16:13:13 +02:00
test-abidiff.cc reader: Handle 'abi-corpus' element being possibly empty 2021-05-03 17:13:31 +02:00
test-alt-dwarf-file.cc rhbz1951526 - SELF CHECK FAILED for 'gimp-2.10' 2021-06-09 18:43:02 +02: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 abixml reader: Fix recursive type definition handling 2021-05-25 12:39:57 +02: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 symtab-reader: add support for binaries compiled with CFI 2021-07-15 17:47:33 +02:00
test-read-write.cc symtab: Add support for MODVERSIONS (CRC checksums) 2021-04-02 16:13:13 +02: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 symtab: Add support for MODVERSIONS (CRC checksums) 2021-04-02 16:13:13 +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 27980 - Fix updating of type scope upon type canonicalization 2021-06-18 14:47:04 +02: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
update-test-output.py Re-license the project to Apache v2 With LLVM Exception 2020-12-02 11:49:13 +01:00