The Git repository of the Libabigail Project
Go to file
Dodji Seketeli b987db9bcb Bug 29912 - Better support an ELF symbol alias that designates several functions
When an ELF symbol alias designates two different functions,
Libabigail can be confused as to which function to consider.

This confusion indirectly leads to showing spurious changes in the
return type of some functions when an ELF symbol designates more than
one function.

In other words, when an ELF symbol designates two (or more) functions,
the comparison engine needs a way to tell the two functions apart.  It
needs an other way to identify the functions.

This patch fixes the confusion by using the pretty representation of
the functions in those cases.

Please note that to replicate the issue reported in this bug, here is
the command I used:

    $ fedabipkgdiff --debug --self-compare -a --from fc37 smesh

	* include/abg-corpus.h (corpus::lookup_functions): Return a set of
	functions rather than a vector of functions where a function can
	be present more than once.  This allows to determine if a symbol
	designates more than one function.
	(corpus::exported_decls_builder::priv_): Make this public so that
	some outside code can access it.
	(corpus::exported_decls_builder::fn_id_maps_to_several_fns):
	Declare new function.
	(corpus::exported_decls_builder::maybe_add_fn_to_exported_fns):
	Remove useless const here.
	* include/abg-fwd.h (get_function_id_or_pretty_representation):
	Declare new function.
	* include/abg-ir.h
	(elf_symbol::get_alias_with_default_symbol_version): Declare new
	member function.
	* src/abg-comparison.cc
	(corpus_diff::priv::ensure_lookup_tables_populated): Use the new
	get_function_id_or_pretty_representation rather than
	function_decl::get_id() to identify a function.
	* src/abg-corpus-priv.h (str_fn_ptr_set_map_type): Define this new
	typedef of unordered_map<string, std::unordered_set<function_decl*> >.
	(corpus::exported_decls_builder::priv::id_fns_map_): Change the
	type of this to the new str_fn_ptr_set_map_type.
	(corpus::exported_decls_builder::priv::{id_fns_map, fn_id_is_in_id_fns_map,
	fn_is_in_fns, fn_is_in_id_fns_map}): Adjust to using a set of
	functions rather than a vector.
	(corpus::exported_decls_builder::fn_is_in_fns_by_repr): Define new
	static function.
	(corpus::exported_decls_builder::add_fn_to_exported): Remove
	useless const.
	* src/abg-corpus.cc
	(corpus::exported_decls_builder::fn_id_maps_to_several_fns):
	Define new function.
	(corpus::exported_decls_builder::maybe_add_fn_to_exported_fns):
	Remove useless const.
	(corpus::lookup_functions): Return a set of functions rather than
	a vector of functions where a function can be present more than
	once.  This allows to determine if a symbol designates more than
	one function.
	* src/abg-dwarf-reader.cc
	(reader::symbol_already_belongs_to_a_function): Adjust.
	* src/abg-fe-iface.cc (fe_iface::maybe_add_fn_to_exported_decls):
	Adjust.
	* src/abg-ir.cc (get_function_id_or_pretty_representation): Define
	new function.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2023-03-20 15:16:57 +01:00
.github Adding missing newline to build-container workflow 2022-05-17 09:46:16 +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 comparison: Add a mode to not apply filters on interface sub-graphs 2023-03-02 18:31:43 +01:00
docker Add github actions to support workflows 2022-05-17 00:13:40 +02:00
include Bug 29912 - Better support an ELF symbol alias that designates several functions 2023-03-20 15:16:57 +01:00
m4 Delete ltsugar.m4 and pkg.m4 files from m4/ 2015-01-06 09:54:45 +01:00
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 29912 - Better support an ELF symbol alias that designates several functions 2023-03-20 15:16:57 +01:00
tests comparison, suppression: Support [allow_type] directive 2023-03-02 18:31:43 +01:00
tools dwarf-reader,abidiff: Fix compilation with --enable-debug-type-canonicalization 2023-03-13 16:57:53 +01:00
.clang-format Tweak clang-format configuration 2021-10-19 12:59:18 +02:00
.gitignore .gitignore: Add libabigail-?.* *.orig files 2019-05-22 14:34:23 +02:00
.mailmap Add '.mailmap' 2021-12-17 20:12:20 +01:00
abigail.m4 Re-license the project to Apache v2 With LLVM Exception 2020-12-02 11:49:13 +01:00
ABIXML-FORMAT-VERSIONS Bug 28450 - Fix cloned member function handling in DWARF 2021-11-12 18:31:28 +01:00
AUTHORS Initial AUTHORS and README 2013-02-28 13:25:20 +01:00
ChangeLog ChangeLog: Update for 2.2 release 2022-12-19 18:46:45 +01:00
COMMIT-LOG-GUIDELINES Update the COMMIT-LOG-GUIDELINES file 2016-05-22 23:20:12 +02:00
COMPILING Improve some grammar 2022-02-25 11:24:20 +01:00
configure.ac configure: Bump the CURRENT library number 2023-02-10 13:18:19 +01:00
CONTRIBUTING Improve some grammar 2022-02-25 11:24:20 +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 Make libxml2 a private dependency wrt pkconfig 2013-08-22 17:41:29 +02:00
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 Use xz as the default tarball compression format 2022-11-18 13:06:09 +01:00
NEWS NEWS: Update for 2.2 release 2022-12-19 18:46:45 +01:00
README Improve some grammar 2022-02-25 11:24:20 +01:00
README-DOCKER.md Add github actions to support workflows 2022-05-17 00:13:40 +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 Update copyright year for 2023 2023-01-01 18:19:30 +01:00
VISIBILITY Improve some grammar 2022-02-25 11:24:20 +01: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, 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.