mirror of
git://sourceware.org/git/libabigail.git
synced 2025-01-03 07:52:04 +00:00
The Git repository of the Libabigail Project
202820ea7a
There are cases where a member function C::f has a defined & exported ELF symbol in a translation unit TU-2, whereas it has no associated symbol in another translation unit TU-1. The class C from TU-1 and the class C from TU-2 have the same canonical type because they are equivalent. Now, suppose it's C from TU-2 that is the canonical type; that means the canonical type of C from TU-1 is C from TU-2. Today, the only types that are emitted in an ABIXML file are canonical types. So if we want the C::f which has a publicly defined & exported elf symbol to be emitted in the ABIXML file, then the C::f that is defined & exported in the ABI corpus should be the C::f from the canonical class type C i.e, the C::f from TU-2. In other words, the exported C::f should be the member function of the canonical type class C. That means that determining which C::f to export in the ABI corpus should be done *after* type canonicalization. Today however, determining which C::f to export is done during the construction of the IR, in the DWARF reader. That leads to cases where the exported C::f is the one that has no defined & exported ELF symbol. As virtual member functions (in particular) are involved in class type comparison, that could lead to spurious type changes left and right. Oops. This patch implements the export of member functions after type canonicalization in the DWARF reader. Note that CTF and BTF readers are not impacted as they only support the C language which doesn't have member functions. * src/abg-dwarf-reader.cc (reader::fixup_functions_with_no_symbols): Do not export the virtual member function here. (build_ir_node_from_die): For DW_TAG_subprogram DIEs, likewise. * src/abg-ir.cc (maybe_adjust_canonical_type): Walk the member functions of the canonical type and export them in the ABI corpus if they have a defined and exported elf symbol. * tests/data/test-read-dwarf/test9-pr18818-clang.so.abi: Adjust. Signed-off-by: Dodji Seketeli <dodji@redhat.com> |
||
---|---|---|
.github | ||
autoconf-archive | ||
bash-completion | ||
doc | ||
docker | ||
include | ||
m4 | ||
relicensing-scripts | ||
scripts | ||
src | ||
tests | ||
tools | ||
.clang-format | ||
.gitignore | ||
.mailmap | ||
abigail.m4 | ||
ABIXML-FORMAT-VERSIONS | ||
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 | ||
README-DOCKER.md | ||
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, functions 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.