libabigail/include
Dodji Seketeli 640b3a2f59 Bug 19141 - Libabigail doesn't support common ELF symbols
Libabigail's internal representation of elf symbols fails to account
for common symbols in relocatable files.  There can be several common
symbols of the same name (defined in a section of SHN_COMMON kind).
In that case, Libabigail wrongly considers these multiple instances of
the same common symbol as being alias, and that breaks some
basic assumptions about aliases.  Oops.

This patch adds support for the common symbols (and the fact that
relocatable files can have several instances of the same common
symbol) and amends the ELF reader to make it properly represent those.
	* include/abg-ir.h (elf_symbol::elf_symbol): Take a new flag to
	say if the symbol is common.
	(elf_symbol::{is_common_symbol, has_other_common_instances,
	get_next_common_instance, add_common_instance}): New member functions.
	* src/abg-ir.cc (elf_symbol::priv::{is_common_,
	next_common_instance_): New data members.
	(elf_symbol::priv::priv): Adjust.
	(elf_symbol::{elf_symbol, create}): Take a new flag to say if the
	symbol is common.
	(textually_equals): Adjust to account for symbol common-ness.
	(elf_symbol::{is_common_symbol, has_other_common_instances,
	get_next_common_instance, add_common_instance}): Define new member
	functions.
	(elf_symbol::add_alias): Drive-by fix; compare symbols using
	pointer value.  Value comparison is not necessary.
	* src/abg-dwarf-reader.cc (lookup_symbol_from_sysv_hash_tab)
	(lookup_symbol_from_gnu_hash_tab, lookup_symbol_from_symtab)
	(read_context::lookup_elf_symbol_from_index): Adjust the creation
	of the symbol to account for common-ness.
	(read_context::load_symbol_maps): Recognize instances of a given
	common symbol and represent them as such.  Do not mistake this
	with symbol aliases.
	* src/abg-reader.cc (build_elf_symbol): Adjust the creation of the
	symbol to account for common-ness.
	* src/abg-writer.cc (write_elf_symbol): Adjust symbol
	serialization to account common-ness.
	* tests/data/test-types-stability/pr19141-get5d.o: Add new test
	binary input.
	* tests/data/test-types-stability/pr19142-topo.o: Likewise.
	* tests/data/Makefile.am: Add the new test inputs to source distribution.
	* tests/test-types-stability.cc (elf_paths): The the new test
	inputs into account.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2016-01-20 13:37:52 +01:00
..
abg-comp-filter.h Bug 17649 Avoid endless looping on diff graph with cycles 2015-02-21 15:16:48 +01:00
abg-comparison.h Add the option of printing the file, line and column information about a type being reported. 2015-12-15 12:32:55 +01:00
abg-config.h Add --version option to several libabigail tools 2015-11-16 12:54:10 +01:00
abg-corpus.h Bug 19037 - Make ABI corpus support several functions with same symbol 2015-10-06 13:32:12 +02:00
abg-diff-utils.h Constify some diff-utils functor operators 2015-09-21 10:46:06 +02:00
abg-dwarf-reader.h Bug 19138 - Failure to relate variables address from DWARF and ELF 2016-01-08 22:38:58 +01:00
abg-fwd.h [PERF] Pass a bunch of perf-sensitive smart pointers by reference 2015-12-11 11:19:57 +01:00
abg-hash.h Update copyright years 2015-01-07 17:52:10 +01:00
abg-ini.h Support source_location_not_in and source_location_not_regexp suppressions 2015-09-16 20:54:40 +02:00
abg-ir.h Bug 19141 - Libabigail doesn't support common ELF symbols 2016-01-20 13:37:52 +01:00
abg-libxml-utils.h Update copyright years 2015-01-07 17:52:10 +01:00
abg-libzip-utils.h Update copyright years 2015-01-07 17:52:10 +01:00
abg-reader.h Introduce the concept of environment 2015-09-07 23:35:29 +02:00
abg-sptr-utils.h Update copyright years 2015-01-07 17:52:10 +01:00
abg-tools-utils.h Bug 19434 - invalid character in attribute value 2016-01-18 18:23:19 +01:00
abg-traverse.h Canonicalize types either early or late after TU reading 2015-02-18 21:32:37 +01:00
abg-version.h.in Add --version option to several libabigail tools 2015-11-16 12:54:10 +01:00
abg-viz-common.h Update copyright years 2015-01-07 17:52:10 +01:00
abg-viz-dot.h Update copyright years 2015-01-07 17:52:10 +01:00
abg-viz-svg.h Update copyright years 2015-01-07 17:52:10 +01:00
abg-workers.h Use worker threads pattern to speed up some tests 2016-01-18 18:23:18 +01:00
abg-writer.h Update copyright years 2015-01-07 17:52:10 +01:00
Makefile.am Use worker threads pattern to speed up some tests 2016-01-18 18:23:18 +01:00