libabigail/tests
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
..
data Bug 19141 - Libabigail doesn't support common ELF symbols 2016-01-20 13:37:52 +01:00
Makefile.am Sort the tests run in tests/ by running the slowest ones first 2016-01-18 18:23:18 +01:00
print-diff-tree.cc Introduce the concept of environment 2015-09-07 23:35:29 +02:00
runtestcanonicalizetypes.sh.in Fix the new regression test for type canonicalizing 2015-02-19 11:44:19 +01:00
test-abicompat.cc Use worker threads pattern to speed up some tests 2016-01-18 18:23:18 +01:00
test-abidiff.cc Use worker threads pattern to speed up some tests 2016-01-18 18:23:18 +01:00
test-alt-dwarf-file.cc Use worker threads pattern to speed up some tests 2016-01-18 18:23:18 +01:00
test-core-diff.cc Use worker threads pattern to speed up some tests 2016-01-18 18:23:18 +01:00
test-diff2.cc Update copyright years 2015-01-07 17:52:10 +01:00
test-diff-dwarf-abixml.cc Use worker threads pattern to speed up some tests 2016-01-18 18:23:18 +01:00
test-diff-dwarf.cc Use worker threads pattern to speed up some tests 2016-01-18 18:23:18 +01:00
test-diff-filter.cc Use worker threads pattern to speed up some tests 2016-01-18 18:23:18 +01:00
test-diff-pkg.cc Use worker threads pattern to speed up some tests 2016-01-18 18:23:18 +01:00
test-diff-suppr.cc Use worker threads pattern to speed up some tests 2016-01-18 18:23:18 +01:00
test-dot.cc Correct DOT merge. 2013-07-23 23:13:55 +02:00
test-ir-walker.cc Introduce the concept of environment 2015-09-07 23:35:29 +02:00
test-lookup-syms.cc Use worker threads pattern to speed up some tests 2016-01-18 18:23:18 +01:00
test-read-dwarf.cc Use worker threads pattern to speed up some tests 2016-01-18 18:23:18 +01:00
test-read-write.cc Use worker threads pattern to speed up some tests 2016-01-18 18:23:18 +01:00
test-svg.cc Add svg generation. 2013-07-23 23:13:54 +02:00
test-types-stability.cc Bug 19141 - Libabigail doesn't support common ELF symbols 2016-01-20 13:37:52 +01:00
test-utils.cc Use worker threads pattern to speed up some tests 2016-01-18 18:23:18 +01:00
test-utils.h Use worker threads pattern to speed up some tests 2016-01-18 18:23:18 +01:00
test-write-read-archive.cc Fix archive writing support 2015-04-24 19:59:19 +02:00
update-test-read-dwarf-output.py Add a script to update the reference output of runtestreaddwarf 2015-10-17 16:20:58 +02:00