mirror of
git://sourceware.org/git/libabigail.git
synced 2024-12-17 07:24:34 +00:00
The Git repository of the Libabigail Project
ca08bae742
An anonymous struct/union is, by definition an entity that is not named (unless a naming typedef is provided for it). It turns out that in C++ binaries, there are anonymous types that are logically equivalent (as far as ABI is concerned) because they have the same members and layout, but turn out to be evaluated as being different because they are defined in different name spaces. And because they are not named, showing them as being different just because of their name space doesn't bring anything but spurious error reporting. Consider the DWARF representing this: struct S { union { int a; int b; } member; }; where the 'member' is of type S::<anonymous-union>. Probably due to LTO, we see some DWARF that represents the type of 'member' as just <anonymous-union>, in some translation units. I could not generate that DWARF from a small test case, myself. But it comes from the binary 'usr/bin/lto-dump', from the https://bugzilla.redhat.com/show_bug.cgi?id=1925886 problem report. So in that case, we want the S::<anonymous-union> to compare equal to the <anonymous-union>, otherwise, this produces spurious type changes, especially when doing self comparison. This is what this patch does. * include/abg-fwd.h (is_anonymous_type): Constify this function. * src/abg-ir.cc (equals): In the overload for decl_base, do not take scope of anonymous types into account. In the overload for array_type_def do not peel of typedefs. This is not directly related to anonymous types, but it make comparison more robust against naming typedefs used for anonymous types in array elements. (get_type_name): Do not take into account the scope of anonymous types when building internal representation of types. Note that the internal representation is what is used for canonicalization. This means that all anonymous types are compared against each others during type canonicalization. * src/abg-reader.cc (build_class_decl): Do not try to re-use anonymous types, just like we already do for DWARF. * tests/data/test-annotate/test17-pr19027.so.abi: Adjust. * 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-diff-filter/test31-pr18535-libstdc++-report-0.txt: Likewise. * tests/data/test-diff-filter/test31-pr18535-libstdc++-report-1.txt: Likewise. * tests/data/test-read-dwarf/PR22122-libftdc.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/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/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/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 <dodji@redhat.com> |
||
---|---|---|
autoconf-archive | ||
bash-completion | ||
doc | ||
include | ||
m4 | ||
relicensing-scripts | ||
scripts | ||
src | ||
tests | ||
tools | ||
.clang-format | ||
.gitignore | ||
abigail.m4 | ||
AUTHORS | ||
ChangeLog | ||
COMMIT-LOG-GUIDELINES | ||
COMPILING | ||
configure.ac | ||
CONTRIBUTING | ||
default.abignore | ||
gen-changelog.py | ||
install-sh | ||
libabigail.pc.in | ||
license-change-2020.txt | ||
LICENSE.txt | ||
ltmain.sh | ||
Makefile.am | ||
NEWS | ||
README | ||
release-text-template.txt | ||
update-copyright.sh | ||
VISIBILITY |
This is the Application Binary Interface Generic Analysis and Instrumentation Library. It aims at constructing, manipulating, serializing and de-serializing ABI-relevant artifacts. The set of artifacts that we are intersted is made of quantities like types, variable, fonctions and declarations of a given library or program. For a given library or program this set of quantities is called an ABI corpus. This library aims at (among other things) providing a way to compare two ABI Corpora (apparently the plural of corpus is copora, heh, that's cool), provide detailed information about their differences, and help build tools to infer interesting conclusions about these differences. You are welcome to contribute to this project after reading the files CONTRIBUTING and COMMIT-LOG-GUIDELINES files in the source tree. Communicating with the maintainers of this project -- including sending patches to be include to the source code -- happens via email at libabigail@sourceware.org.