libabigail/tests
Dodji Seketeli 11f5dbaab2 Bug 19885 - Cannot associates a function DIE to a symbol on powerpc64
On powerpc 64 ELFv1, the address of a function is different from the
address of the entry point of that function.  The value of a en ELF
symbol represents the address of the function, whereas the
DW_AT_low_pc DWARF attribute of a function DIE points to the entry
point address of the function.  So to get the symbol a function's
DW_AT_low_pc points to, one needs to get the address of the function
*from* the address of its entry point.

More precisely, on ppc64, the address of a function is the address of
a function descriptor.  The function descriptor is a set of three 64
bits addresses.  The first element of the triplet is the function
entry pointer address.  So to get the symbol a given function entry
point address belongs to, one must get to the function descriptor
which contains said function entry point address.  And function
descriptors are in the ".opd" special section.

Unfortunately, Libabigail's  ELF/DWARF reader has no knowledge of all
this.  So it cannot get the symbol of a given function DWARF
description.  So it considers all functions as having no ELF symbols.
So it shows no ABI change pertaining to function sub-types on ppc64.

This patch makes Libabigail support function descriptors on ppc64 so
it can detect changes on function sub-types there.

	* src/abg-dwarf-reader.cc (read_context::{opd_section_,
	fun_entry_addr_sym_map_}): New data members.
	(read_context::read_context): Initialize the new opd_section_ data
	member.
	(read_context::{find_opd_section,
	lookup_ppc64_elf_fn_entry_pointer_address,
	fun_entry_addr_sym_map_sptr, fun_entry_addr_sym_map,
	elf_architecture_is_ppc64, elf_architecture_is_big_endian}): New
	member functions.
	(read_context::lookup_elf_fn_symbol_from_address): Adjust to use
	the new read_context::fun_entry_addr_sym_map() function.
	(read_context::load_symbol_maps): Populate the function entry
	addresses -> symbol map, for ppc64 ELFv1.
	(read_context::load_elf_properties): Renamed
	read_context::load_remaining_elf_data into this.
	(read_corpus_from_elf): Load elf properties before trying to load
	elf symbols information.
	* tests/data/test-diff-filter/libtest32-struct-change-v0.so: New
	binary test input, compiled for ppc64le.
	* tests/data/test-diff-filter/libtest32-struct-change-v1.so: Likewise.
	* tests/data/test-diff-filter/test32-ppc64le-struct-change-report0.txt:
	New test reference output.
	* tests/data/test-diff-filter/test32-ppc64le-struct-change-v0.c:
	Source code of the new binary test input above.
	* tests/data/test-diff-filter/test32-ppc64le-struct-change-v1.c:
	Likewise.
	* tests/data/Makefile.am: Add the new test material above to
	source distribution.
	* tests/test-diff-filter.cc (in_out_spec): Make this test harness
	run over the new test input binaries above.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2016-03-30 20:17:42 +02:00
..
data Bug 19885 - Cannot associates a function DIE to a symbol on powerpc64 2016-03-30 20:17:42 +02:00
Makefile.am Bug 19596 - Incorrect exit status for incompatible ABI change 2016-02-10 21:31:53 +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 Fix synthesizing of reference type 2016-02-04 11:26:22 +01:00
test-abidiff-exit.cc Bug 19596 - Suppressed removed symbol changes still considered incompatible 2016-03-04 01:02:46 +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 proper WIFEXITED and WEXITSTATUS macros to get exit code 2016-02-10 22:06:01 +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 Bug 19885 - Cannot associates a function DIE to a symbol on powerpc64 2016-03-30 20:17:42 +02:00
test-diff-pkg.cc Bug 19867 - abipkgdiff skips symbolic links 2016-03-25 13:52:02 +01:00
test-diff-suppr.cc Bug 19619 - failing to suppress added aliased function reports for C++ 2016-02-13 08:47:41 +01:00
test-dot.cc
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
test-types-stability.cc Bug 19204 - libabigail aborts on DWARF referencing non-existing DIE 2016-01-21 10:48:32 +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