summaryrefslogtreecommitdiffstats
path: root/ABIXML-FORMAT-VERSIONS
diff options
context:
space:
mode:
authorDodji Seketeli <dodji@redhat.com>2021-11-04 10:59:32 +0100
committerDodji Seketeli <dodji@redhat.com>2021-11-12 18:31:28 +0100
commit861e4670b611b2f95d69f68bb1edaa15ab5f3aa5 (patch)
tree1ce8fdffc050ff5352845731400a251110c9cf8b /ABIXML-FORMAT-VERSIONS
parentabg-ctf-reader: use the right string table for CTF data (diff)
downloadlibabigail-861e4670b611b2f95d69f68bb1edaa15ab5f3aa5.tar.gz
libabigail-861e4670b611b2f95d69f68bb1edaa15ab5f3aa5.tar.bz2
libabigail-861e4670b611b2f95d69f68bb1edaa15ab5f3aa5.tar.xz
Bug 28450 - Fix cloned member function handling in DWARF
When the DWARF reader encounters a function DIE 'f' that has a DW_AT_specification that points to a member function, the current implementation creates a function IR for the member function. The problem is that the member function has no ELF symbol associated to it. The ELF symbol is associated to 'f', not to the member function. The DWARF reader then wrongly drops the member function on the floor because it has no ELF symbol function associated. So that member function specification never gets its concrete function represented in the IR. This patch fixes the issue by detecting that the member function is the "specification" for 'f' and that the ELF symbol associated to it might not be there. In that case, if the ELF symbol is on the 'f' DIE itself, we get it from there. The patch makes more member functions to be represented so it uncovers a latent issue which is explained below. Today, some compilers can emit redundant DWARF constructs like "const reference" or "const void". A reference is always const so the const is superfluous. A similar thing can be said about "const void". maybe_strip_qualification detects those constructs and rewrites the IR into a "no-op qualified reference", or a "no-op qualified void". The no-op was needed in the previous incarnations of the DWARF reader because it was expecting a 'qualified type' IR to be associated to a qualified type DIE. Note, however, that that expectation has been generally relaxed since then. The problem is that the comparison engine, when building the diff IR needs to strip those no-op qualified types off, to avoid having spurious change diagnostics. That stripping introduces some challenges because the tree is more or less un-mutable at that point (after type canonicalization) so the stripping can only be partial. This patch removes the no-op qualified types altogether, rather than trying harder to handle them down the line. In other words, a const reference is now represented as a reference and a const void as a void. This makes things much simpler. The problem however is that the in-memory IR (and thus the emitted ABIXML) doesn't have any no-op qualified type anymore. So comparing an old ABIXML that contains those no-op qualified types against its origin ELF corpus can yield some spurious diagnostics. To fix it, one needs to re-generate the ABIXML file. This patch bumps the ABIXML version to 2.1 and introduces a new ABIXML-FORMAT-VERSIONS file that documents the format changes. * ABIXML-FORMAT-VERSIONS: New file that documents the version changes of the ABIXML-FORMAT-VERSIONS. * include/abg-fwd.h (look_through_no_op_qualified_type): Remove this function declaration. (strip_useless_const_qualification): Declare new function declaration. * src/abg-comparison.cc (compute_diff_for_types): Avoid stripping off no-op-qualified types as these beasts don't exist anymore. (redundancy_marking_visitor::visit_end): Allow a variable which type has local changes to be considered redundant if its type is itself redundant. * src/abg-config.cc (config::config): Bump the abixml version from 2.0 to 2.1. * src/abg-dwarf-reader.cc (maybe_strip_qualification): Factorize out the new strip_useless_const_qualification function from here. (build_or_get_fn_decl_if_not_suppressed): If the function is created but doesn't have an ELF symbol associated to it, then update it so that the ELF symbol can be associated. Otherwise, potential_member_fn_should_be_dropped might later drop that function on the floor because it doesn't have any ELF symbol associated. * src/abg-ir.cc (strip_useless_const_qualification): Define this, which is has been factorized out of maybe_strip_qualification. (look_through_no_op_qualified_type): Remove this definition. (equals): In the overload for reference_type_def, do not peel typedefs off from the reference before comparison. This is now useless as the comparison infrastructure got a lot better. In the overload for references, stop using look_through_no_op_qualified_type as this function doesn't exist anymore. * src/abg-tools-utils.cc (abidiff_status_has_error): Detect when there is a usage error as well. * tests/data/test-types-stability/PR28450-libepetra.so.13.0: Add new testing binary to the repository. * tests/data/Makefile.am: Add the new testing binary above to source distribution. * tests/test-types-stability.cc (elf_paths): Add the new test to this test harness. * tests/test-diff-dwarf-abixml.cc (main): Add better error messages. * tests/data/test-abidiff-exit/test-member-size-report0.txt: Adjust. * tests/data/test-annotate/libtest23.so.abi: Likewise. * tests/data/test-annotate/libtest24-drop-fns-2.so.abi: Likewise. * tests/data/test-annotate/libtest24-drop-fns.so.abi: Likewise. * tests/data/test-annotate/test-anonymous-members-0.o.abi: Likewise. * tests/data/test-annotate/test0.abi: Likewise. * tests/data/test-annotate/test1.abi: Likewise. * tests/data/test-annotate/test13-pr18894.so.abi: Likewise. * tests/data/test-annotate/test14-pr18893.so.abi: Likewise. * tests/data/test-annotate/test15-pr18892.so.abi: Likewise. * tests/data/test-annotate/test17-pr19027.so.abi: Likewise. * tests/data/test-annotate/test18-pr19037-libvtkRenderingLIC-6.1.so.abi: Likewise. * tests/data/test-annotate/test19-pr19023-libtcmalloc_and_profiler.so.abi: Likewise. * tests/data/test-annotate/test20-pr19025-libvtkParallelCore-6.1.so.abi: Likewise. * tests/data/test-annotate/test6.so.abi: Likewise. * tests/data/test-annotate/test7.so.abi: Likewise. * tests/data/test-annotate/test8-qualified-this-pointer.so.abi: Likewise. * tests/data/test-diff-dwarf-abixml/test0-pr19026-libvtkIOSQL-6.1.so.1.abi: Likewise. * tests/data/test-diff-dwarf/test0-report.txt: Likewise. * tests/data/test-diff-dwarf/test28-vtable-changes-report-0.txt: Likewise. * tests/data/test-diff-dwarf/test42-PR21296-clanggcc-report0.txt: Likewise. * tests/data/test-diff-filter/test0-report.txt: Likewise. * tests/data/test-diff-filter/test01-report.txt: Likewise. * tests/data/test-diff-filter/test10-report.txt: Likewise. * tests/data/test-diff-filter/test30-pr18904-rvalueref-report0.txt: Likewise. * tests/data/test-diff-filter/test30-pr18904-rvalueref-report1.txt: Likewise. * tests/data/test-diff-filter/test30-pr18904-rvalueref-report2.txt: Likewise. * tests/data/test-diff-filter/test31-pr18535-libstdc++-report-0.txt: Likewise. * tests/data/test-diff-filter/test31-pr18535-libstdc++-report-1.txt: Likewise. * tests/data/test-diff-filter/test35-pr18754-no-added-syms-report-0.txt: Likewise. * tests/data/test-diff-filter/test35-pr18754-no-added-syms-report-1.txt: Likewise. * tests/data/test-diff-filter/test41-report-0.txt: Likewise. * tests/data/test-diff-filter/test9-report.txt: Likewise. * tests/data/test-diff-pkg/libsigc++-2.0-0c2a_2.4.0-1_amd64--libsigc++-2.0-0v5_2.4.1-1ubuntu2_amd64-report-0.txt: Likewise. * tests/data/test-diff-pkg/tbb-4.1-9.20130314.fc22.x86_64--tbb-4.3-3.20141204.fc23.x86_64-report-0.txt: Likewise. * tests/data/test-diff-pkg/tbb-4.1-9.20130314.fc22.x86_64--tbb-4.3-3.20141204.fc23.x86_64-report-1.txt: Likewise. * tests/data/test-diff-suppr/test24-soname-report-1.txt: Likewise. * tests/data/test-diff-suppr/test24-soname-report-10.txt: Likewise. * tests/data/test-diff-suppr/test24-soname-report-12.txt: Likewise. * tests/data/test-diff-suppr/test24-soname-report-14.txt: Likewise. * tests/data/test-diff-suppr/test24-soname-report-16.txt: Likewise. * tests/data/test-diff-suppr/test24-soname-report-4.txt: Likewise. * tests/data/test-diff-suppr/test31-report-1.txt: Likewise. * tests/data/test-read-dwarf/PR22015-libboost_iostreams.so.abi: Likewise. * tests/data/test-read-dwarf/PR22122-libftdc.so.abi: Likewise. * tests/data/test-read-dwarf/libtest23.so.abi: Likewise. * tests/data/test-read-dwarf/libtest24-drop-fns-2.so.abi: Likewise. * tests/data/test-read-dwarf/libtest24-drop-fns.so.abi: Likewise. * tests/data/test-read-dwarf/test-libaaudio.so.abi: Likewise. * tests/data/test-read-dwarf/test-libandroid.so.abi: Likewise. * tests/data/test-read-dwarf/test0.abi: Likewise. * tests/data/test-read-dwarf/test0.hash.abi: Likewise. * tests/data/test-read-dwarf/test1.abi: Likewise. * tests/data/test-read-dwarf/test1.hash.abi: Likewise. * tests/data/test-read-dwarf/test10-pr18818-gcc.so.abi: Likewise. * tests/data/test-read-dwarf/test11-pr18828.so.abi: Likewise. * tests/data/test-read-dwarf/test12-pr18844.so.abi: Likewise. * tests/data/test-read-dwarf/test14-pr18893.so.abi: Likewise. * tests/data/test-read-dwarf/test15-pr18892.so.abi: Likewise. * tests/data/test-read-dwarf/test16-pr18904.so.abi: Likewise. * tests/data/test-read-dwarf/test17-pr19027.so.abi: Likewise. * tests/data/test-read-dwarf/test18-pr19037-libvtkRenderingLIC-6.1.so.abi: Likewise. * tests/data/test-read-dwarf/test19-pr19023-libtcmalloc_and_profiler.so.abi: Likewise. * tests/data/test-read-dwarf/test2.so.abi: Likewise. * tests/data/test-read-dwarf/test2.so.hash.abi: Likewise. * tests/data/test-read-dwarf/test20-pr19025-libvtkParallelCore-6.1.so.abi: Likewise. * tests/data/test-read-dwarf/test21-pr19092.so.abi: Likewise. * tests/data/test-read-dwarf/test22-pr19097-libstdc++.so.6.0.17.so.abi: Likewise. * tests/data/test-read-dwarf/test3-alias-1.so.hash.abi: Likewise. * tests/data/test-read-dwarf/test3-alias-2.so.hash.abi: Likewise. * tests/data/test-read-dwarf/test3-alias-3.so.hash.abi: Likewise. * tests/data/test-read-dwarf/test3-alias-4.so.hash.abi: Likewise. * tests/data/test-read-dwarf/test3.so.abi: Likewise. * tests/data/test-read-dwarf/test3.so.hash.abi: Likewise. * tests/data/test-read-dwarf/test4.so.abi: Likewise. * tests/data/test-read-dwarf/test4.so.hash.abi: Likewise. * tests/data/test-read-dwarf/test5.o.abi: Likewise. * tests/data/test-read-dwarf/test5.o.hash.abi: Likewise. * tests/data/test-read-dwarf/test6.so.abi: Likewise. * tests/data/test-read-dwarf/test6.so.hash.abi: Likewise. * tests/data/test-read-dwarf/test7.so.abi: Likewise. * tests/data/test-read-dwarf/test7.so.hash.abi: Likewise. * tests/data/test-read-dwarf/test8-qualified-this-pointer.so.abi: Likewise. * tests/data/test-read-dwarf/test8-qualified-this-pointer.so.hash.abi: Likewise. * tests/data/test-read-dwarf/test9-pr18818-clang.so.abi: Likewise. * tests/data/test-read-write/test-crc.xml: Likewise. * tests/data/test-read-write/test26.xml: Likewise. * tests/data/test-read-write/test27.xml: Likewise. * tests/data/test-read-write/test28-without-std-fns-ref.xml: Likewise. * tests/data/test-read-write/test28-without-std-vars-ref.xml: Likewise. Signed-off-by: Dodji Seketeli <dodji@redhat.com>
Diffstat (limited to 'ABIXML-FORMAT-VERSIONS')
-rw-r--r--ABIXML-FORMAT-VERSIONS67
1 files changed, 67 insertions, 0 deletions
diff --git a/ABIXML-FORMAT-VERSIONS b/ABIXML-FORMAT-VERSIONS
new file mode 100644
index 00000000..811771aa
--- /dev/null
+++ b/ABIXML-FORMAT-VERSIONS
@@ -0,0 +1,67 @@
12.1 version
2===========
3
4This occurred in libabigail 2.1. The IR doesn't contain no-op
5qualified types anymore. These were the ancient way to represent
6qualified type that were edited by libabigail to avoid spurious
7diagnostics. E.g, const references or const void type. In those
8cases, we were replacing these by qualified types that were no-ops.
9Those no-ops qualified types further needed to be stripped off in the
10diff IR to avoid emitting spurious changes. It turned out stripping
11out those no-op qualified types was causing some difficulties in the
12algorithms that propagate type diff node categorization.
13
14For instance, variable diff type node would have the categorization of
15its diff->type_diff() be different from what we could see from the
16change observed between its diff->first_subject()->get_type() and
17diff->second_subject()->get_type(). This is because diff->type_diff()
18strips the no-op qualified types to create a new diff IR node, whereas
19looking at the difference between diff->first_subject->get_type() and
20diff->second_subject()->get_type() gives a different perspective.
21
22So looking at the "changes" carried by 'diff' could yield a result
23suggesting that there was a change to be diagnosed, carried by the
24difference between diff->first_subject()->get_type() and
25diff->second_subject()->get_type() -- a difference between two no-ops
26qualified types -- whereas actually looking at diff->type_diff() (that
27should be equivalent) yields a different information because it's
28stripped off of the no-op qualified type.
29
30Just removing the no-op qualified types removed all those issues
31altogether. So in concrete terms, when we see a const reference, it's
32replaced by a reference (because a reference is always const) and
33when we see a const void, it's replaced by void. As simple as that.
34
35But then the emitted ABIXML won't carry any no-op qualified type
36anymore. Older versions of ABIXML might still carry those, and so
37abidiff-ing those against their original binary might yield some
38spurious diagnostics. Hence the minor version bump.
39
40relevant commit:
41----------------
42commit 8a4f72005bc96fecf63414784cf94857eddbd124
43Author: Dodji Seketeli <dodji@redhat.com>
44Date: Thu Nov 4 10:59:32 2021 +0100
45
46 Bug 28450 - Fix cloned member function handling in DWARF
472.0 version
48===========
49
50This occured in libabigail 2.0. The interpretation of
51DW_AT_bit_offset (DWARF 5) changed so the value of the
52'layout-offset-in-bits' property of the 'data-member' element might
53now have changed in an incompatible way.
54
55relevant commit:
56----------------
57commit 23046152e0843bc2f141e37dcce047305c3f4379
58Author: Dodji Seketeli <dodji@redhat.com>
59Date: Thu Oct 22 16:04:08 2020 +0200
60
61 Bump ABIXML format version to 2.0
62
63
641.0 version
65===========
66
67This was the initial version of abixml.