From 4bdaf30bbbe31994510764b48164fe2dd20ba8bb Mon Sep 17 00:00:00 2001 From: Dodji Seketeli Date: Thu, 24 Nov 2022 17:26:35 +0100 Subject: Depending on how the DWARF DIEs are encountered, it can happen that the reader mistakenly adds the same member function several times. This is because due to DIE canonicalization, when we encounter the class DIE C' that is equivelent to a class C that we have already encountered, C' is dropped on the floor and C is kept. But then, the member functions of C' should not added to C, rather, if they are already present in C, we shouldn't add them anymore. This is what build_or_get_fn_decl_if_not_suppressed is supposed to do, but fails to do in a subtle way. This patch fixes it. * src/abg-dwarf-reader.cc (build_or_get_fn_decl_if_not_suppressed): Fix the code that is supposed to avoid duplicating a member function. * tests/data/test-annotate/test14-pr18893.so.abi: Adjust. * 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/test21-pr19092.so.abi: Likewise. * tests/data/test-read-dwarf/PR22122-libftdc.so.abi: Likewise. * tests/data/test-read-dwarf/test-libandroid.so.abi: Likewise. * tests/data/test-read-dwarf/test10-pr18818-gcc.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/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/test9-pr18818-clang.so.abi: Likewise. Signed-off-by: Dodji Seketeli Applied to the master branch. --- src/abg-dwarf-reader.cc | 4 + .../data/test-annotate/test14-pr18893.so.abi | 7644 ++-- .../data/test-annotate/test15-pr18892.so.abi | 2421 +- .../data/test-annotate/test17-pr19027.so.abi | 923 +- ...st18-pr19037-libvtkRenderingLIC-6.1.so.abi | 12473 ++++-- ...19-pr19023-libtcmalloc_and_profiler.so.abi | 15673 +++---- ...st20-pr19025-libvtkParallelCore-6.1.so.abi | 8629 ++-- .../data/test-annotate/test21-pr19092.so.abi | 246 +- .../test-read-dwarf/PR22122-libftdc.so.abi | 1480 +- .../test-read-dwarf/test-libandroid.so.abi | 472 +- .../test-read-dwarf/test10-pr18818-gcc.so.abi | 65 - .../test-read-dwarf/test12-pr18844.so.abi | 3162 +- .../test-read-dwarf/test14-pr18893.so.abi | 5889 ++- .../test-read-dwarf/test15-pr18892.so.abi | 2210 +- .../test-read-dwarf/test16-pr18904.so.abi | 2048 +- .../test-read-dwarf/test17-pr19027.so.abi | 821 +- ...st18-pr19037-libvtkRenderingLIC-6.1.so.abi | 10231 +++-- ...19-pr19023-libtcmalloc_and_profiler.so.abi | 13230 +++--- ...st20-pr19025-libvtkParallelCore-6.1.so.abi | 8157 ++-- .../test-read-dwarf/test21-pr19092.so.abi | 199 +- .../test22-pr19097-libstdc++.so.6.0.17.so.abi | 37377 ++++++++-------- .../test9-pr18818-clang.so.abi | 202 +- 22 files changed, 71442 insertions(+), 62114 deletions(-) The patch is too big for the mailing list so I am attaching a gziped version of it.