mirror of
git://sourceware.org/git/libabigail.git
synced 2025-01-22 17:23:05 +00:00
95c53c89f3
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> |
||
---|---|---|
.. | ||
data | ||
lib | ||
.gitignore | ||
Makefile.am | ||
mockfedabipkgdiff.in | ||
print-diff-tree.cc | ||
runtestcanonicalizetypes.sh.in | ||
runtestdefaultsupprs.py.in | ||
runtestdefaultsupprspy3.sh.in | ||
runtestfedabipkgdiff.py.in | ||
runtestfedabipkgdiffpy3.sh.in | ||
runtestslowselfcompare.sh.in | ||
test-abicompat.cc | ||
test-abidiff-exit.cc | ||
test-abidiff.cc | ||
test-alt-dwarf-file.cc | ||
test-annotate.cc | ||
test-core-diff.cc | ||
test-cxx-compat.cc | ||
test-diff2.cc | ||
test-diff-dwarf-abixml.cc | ||
test-diff-dwarf.cc | ||
test-diff-filter.cc | ||
test-diff-pkg.cc | ||
test-diff-suppr.cc | ||
test-dot.cc | ||
test-elf-helpers.cc | ||
test-ini.cc | ||
test-ir-walker.cc | ||
test-kmi-whitelist.cc | ||
test-lookup-syms.cc | ||
test-read-dwarf.cc | ||
test-read-write.cc | ||
test-svg.cc | ||
test-symtab.cc | ||
test-tools-utils.cc | ||
test-types-stability.cc | ||
test-utils.cc | ||
test-utils.h | ||
test-valgrind-suppressions.supp | ||
test-write-read-archive.cc | ||
update-test-output.py |