The Git repository of the Libabigail Project
Go to file
Dodji Seketeli e2e253e5b1 Bug 27980 - Fix updating of type scope upon type canonicalization
Once a type T is canonicalized, its scope is updated so that the
vector returned by scope_decl::get_canonical_types() now contains the
new canonical type of T.  This works, obviously, even when the scope
is itself a type.

This works well on binaries compiled using C only because, currently,
libabigail de-duplicates the DIEs of types.  This means that if the
scope of T is a non-anonymous type, the class of equivalence of that
scope contains just one element.  So updating the scope of T implies
updating just one scope.

On binaries where some files are compiled using C++ however, type DIEs
are not de-duplicated.  This is just because that feature hasn't yet
been implemented in libabigail.  Anyway, in that case, if the scope of
T is a non-anonymous type, the class of equivalence of that scope
contains more than one element.  So updating the scope of T implies
updating the scope of all the elements of the class of equivalence T.
In practise, that means updating the canonical type (scope) of T.

Libabigail fails to update the canonical type (scope) of T.  Later at
abixml emitting time, just emitting the canonical types of the scope
of T is not enough to emit the canonical type of T.  And that's how
the abixml emitter forgets to emit some types as reported in the bug
https://sourceware.org/bugzilla/show_bug.cgi?id=27980.

This patch fixes that issue.

I also noticed that when emitting abixml for unions, the emitter
fails to emit the canonical member types of the union, unlike what is
done for class types.  So that is fixed as well.

The binary provided in the bug report is added to the regression
testsuite.

	* src/abg-ir.cc (canonicalize): Update the
	scope_decl::get_canonical_types() of canonical type of the
	containing type of the newly canonicalized type.
	* src/abg-writer.cc (write_union_decl): Write the canonical types
	contained in the current union scope, just like we do for classes.
	* tests/data/test-read-dwarf/test16-pr18904.so.abi: Adjust.
	* tests/data/test-types-stability/pr27980-libc.so: New binary
	input file.
	* tests/data/Makefile.am: Add the test input file above to source
	distribution.
	* tests/test-types-stability.cc (elf_paths): Add the new test
	input file to this test harness.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2021-06-18 14:47:04 +02:00
autoconf-archive Replace individual license references with SPDX Identifiers 2020-12-02 11:44:13 +01:00
bash-completion Re-license the project to Apache v2 With LLVM Exception 2020-12-02 11:49:13 +01:00
doc doc: Fix typo 2021-06-10 15:14:41 +02:00
include Fix recursive array type definition 2021-06-09 19:44:52 +02:00
m4
relicensing-scripts Bug 27512 - Remove broken zip-archive support 2021-03-19 10:52:57 +01:00
scripts Re-license the project to Apache v2 With LLVM Exception 2020-12-02 11:49:13 +01:00
src Bug 27980 - Fix updating of type scope upon type canonicalization 2021-06-18 14:47:04 +02:00
tests Bug 27980 - Fix updating of type scope upon type canonicalization 2021-06-18 14:47:04 +02:00
tools Fix trivial typo when printing version string 2021-06-10 15:27:35 +02:00
.clang-format clang-format: Minor correction to not break parameters on the first line 2021-04-01 09:51:20 +02:00
.gitignore .gitignore: Add libabigail-?.* *.orig files 2019-05-22 14:34:23 +02:00
abigail.m4 Re-license the project to Apache v2 With LLVM Exception 2020-12-02 11:49:13 +01:00
AUTHORS
ChangeLog Update the Changelog for 1.8 2020-12-01 15:13:57 +01:00
COMMIT-LOG-GUIDELINES Update the COMMIT-LOG-GUIDELINES file 2016-05-22 23:20:12 +02:00
COMPILING Fix typo in COMPILING. 2020-02-03 13:49:54 +01:00
configure.ac Detect failed self comparison in type canonicalization of abixml 2021-05-25 12:16:25 +02:00
CONTRIBUTING Use C++11 for the code base 2020-12-03 14:04:23 +01:00
default.abignore Re-license the project to Apache v2 With LLVM Exception 2020-12-02 11:49:13 +01:00
gen-changelog.py Replace individual license references with SPDX Identifiers 2020-12-02 11:44:13 +01:00
install-sh Replace individual license references with SPDX Identifiers 2020-12-02 11:44:13 +01:00
libabigail.pc.in
license-change-2020.txt Add a license-change-2020.txt file 2020-12-02 11:50:22 +01:00
LICENSE.txt Add the LICENSE.txt file 2020-12-02 11:49:33 +01:00
ltmain.sh Replace individual license references with SPDX Identifiers 2020-12-02 11:44:13 +01:00
Makefile.am Teach Automake that COPYING* files are gone from sources 2020-12-02 17:42:47 +01:00
NEWS Update NEWS file for 1.8 2020-12-01 15:19:12 +01:00
README Fix wording in README 2015-09-05 10:30:00 +02:00
release-text-template.txt Update the release text template after 1.0 2017-11-22 15:55:43 +01:00
update-copyright.sh Re-license the project to Apache v2 With LLVM Exception 2020-12-02 11:49:13 +01:00
VISIBILITY Control symbols exported from libabigail.so 2016-07-27 12:51:02 +02:00

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.