libabigail/tests
Dodji Seketeli 95c53c89f3 dwarf-reader: Avoid having several functions with the same symbol
In the DWARF debug info, a C++ class can be represented by pieces
throughout a given binary.

In this picture, a given virtual member function can be represented
several times; each time in one different piece of the C++ class.  In
a given piece of the class, a virtual member function can be
represented with its ELF symbol set.  In another one, the same virtual
member function can be represented without that ELF symbol set.  And
there can also be pieces of the class that don't have a given virtual
function.

To handle this, the DWARF reader constructs one class from all its
pieces scattered around.  It adds each virtual member function to the
class as it comes across them while scanning the DWARF.

Then there is a pass at the end of the process that sets ELF symbols
to the (virtual) member functions that need it.

The problem with that pass is that it sometimes sets the same ELF
symbol to more than one virtual member function.  Those virtual member
functions all have the same mangled name that correspond to the ELF
symbol; but only one of them is meant to be associated with the ELF
symbol.  In essence, that one is the one that is exported by the ELF
binary.

This patch teaches the pass that sets the ELF symbols of function to
avoid setting the same ELF symbol to more than one function.

The patch also avoids build_function_decl to set symbol to a function
if that symbol was already set to an existing function.

This patch thus fixes a class of issues what arise when comparing a
binary against its own ABIXML representation.  Those several functions
having the same ELF symbol would cause spurious changes in that
context.

	* src/abg-dwarf-reader.cc
	(read_context::symbol_already_belongs_to_a_function): Define new
	member function.
	(read_context::fixup_functions_with_no_symbols): Use the new
	symbol_already_belongs_to_a_function function to avoid setting a
	symbol that already belongs to a function.
	* tests/data/test-read-dwarf/PR22122-libftdc.so.abi: Adjust.
	* tests/data/test-read-dwarf/test10-pr18818-gcc.so.abi: Likewise.
	* tests/data/test-read-dwarf/test16-pr18904.so.abi: Likewise.
	* tests/data/test-read-dwarf/test22-pr19097-libstdc++.so.6.0.17.so.abi:
	Likewise.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2020-11-27 16:56:25 +01:00
..
data dwarf-reader: Avoid having several functions with the same symbol 2020-11-27 16:56:25 +01:00
lib
.gitignore tests/.gitignore: ignore all files starting with runtest* 2020-05-13 11:26:28 +02:00
Makefile.am Bug 26769 - Fix missing types in abixml output 2020-11-23 13:02:34 +01:00
mockfedabipkgdiff.in
print-diff-tree.cc
runtestcanonicalizetypes.sh.in
runtestdefaultsupprs.py.in
runtestdefaultsupprspy3.sh.in
runtestfedabipkgdiff.py.in
runtestfedabipkgdiffpy3.sh.in
runtestslowselfcompare.sh.in Bug 26769 - Fix missing types in abixml output 2020-11-23 13:02:34 +01:00
test-abicompat.cc
test-abidiff-exit.cc Make abidiff and abidw support several --headers-dir{1,2} options 2020-09-18 10:27:18 +02:00
test-abidiff.cc
test-alt-dwarf-file.cc
test-annotate.cc
test-core-diff.cc
test-cxx-compat.cc cxx-compat: add test suite for cxx-compat 2020-05-13 11:55:12 +02:00
test-diff2.cc
test-diff-dwarf-abixml.cc
test-diff-dwarf.cc
test-diff-filter.cc Bug PR26739 - Handle qualified typedef array types 2020-11-12 10:53:40 +01:00
test-diff-pkg.cc Bug 26780 - Fix array subrange bounds (de)serialization 2020-11-27 13:50:47 +01:00
test-diff-suppr.cc tests: parallelize diff-suppr test 2020-04-20 15:02:39 +02:00
test-dot.cc
test-elf-helpers.cc abg-dwarf-reader split: create abg-elf-helpers.{h,cc} and test case 2020-04-22 11:39:45 +02:00
test-ini.cc
test-ir-walker.cc
test-kmi-whitelist.cc Simplify generation of symbol whitelist regex. 2020-05-04 11:17:49 +02:00
test-lookup-syms.cc dwarf-reader: Fix bloom filter access in GNU_HASH section 2020-03-20 13:35:00 +01:00
test-read-dwarf.cc dwarf-reader: Ignore zero length location expressions from DW_AT_location 2020-11-02 18:07:01 +01:00
test-read-write.cc configure: add more diagnostic options when ABIGAIL_DEVEL is set 2020-05-18 10:39:36 +02:00
test-svg.cc
test-symtab.cc tests: Add kernel symtab test suite 2020-05-27 11:00:51 +02:00
test-tools-utils.cc Make decl_names_equal more accurate 2020-08-04 14:51:13 +02:00
test-types-stability.cc test-types-stability: parallelize test case alternatives 2020-05-04 15:34:42 +02:00
test-utils.cc
test-utils.h
test-valgrind-suppressions.supp
test-write-read-archive.cc
update-test-output.py update-test-output.py: Update syntax 2020-11-01 14:30:00 +01:00