libabigail/tests
Dodji Seketeli d7faae38f6 Fix aborting when reading .foo symbols from a ppc64 binary
On ppc64, the value of a function symbol is *usually* the pointer to
the function.  That function pointer value refers to an index inside
the ".opd" (Official Procedure Descriptor) section.  That section is a
record of tripplets values.  One of these values is the address of the
entry point of the function.  A debug information entry for a
function, in DWARF, refers to the entry point of the function; not to
the function pointer address.

So libabigail builds a table that associates a function entry point
address to its function pointer address.

So, if a function is named "foo", it has an entry in the symbol table
for the symbol name "foo"; the value of that symbol is the function
pointer address of foo, which refers to an offset in the ".opd"
section.

But then it turns out that there is also going to be an entry in the
symbol table for an artificial symbol named ".foo".  Pleast note the
dot before the suffix "foo".  The value of the ".foo" symbol is the
address of the entry point of the function "foo"; it's an address in
the ".text" section this time.

Libabigail's ELF symbols reading code was (wrongly) expecting all
entries in the symbol table that refer to function to have values that
are offset in the ".opd" section.  It wasn't expecting the ".foo"
symbols whose value are an address in the ".text" section.

This patch fixes the ELF symbol reading code to make it be aware of
the ".foo" symbols too.

	* abg-dwarf-reader.cc (read_context::find_opd_section): Fix
	comment.
	(read_context::load_symbol_maps): If for a given function entry
	point (that we got by looking at the ".opd" section for a given
	function pointer value) we already had an entry in the
	function_entry_address -> symbol, maybe it means that the previous
	entry that we had was from an entry in the symbol table which
	value was directly the entry point address of a function.  In that
	case, if the name of the symbol is "foo", the name of the symbol
	which value is directly the entry point address is ".foo".  What
	we do in this case is that we just keep the reference to the "foo"
	symbol in the function_entry_address -> symbol map.
	(read_context::address_is_in_opd_section): Define new member
	function.
	* tests/data/test-diff-pkg/gmp-4.3.1-10.el6.ppc64.rpm: New test input.
	* tests/data/test-diff-pkg/gmp-4.3.1-7.el6_2.2.ppc64.rpm: Likewise.
	* tests/data/test-diff-pkg/gmp-debuginfo-4.3.1-10.el6.ppc64.rpm: Likewise.
	* tests/data/test-diff-pkg/gmp-debuginfo-4.3.1-7.el6_2.2.ppc64.rpm: Likewise.
	* tests/data/test-diff-pkg/gmp-4.3.1-7.el6_2.2.ppc64--gmp-4.3.1-10.el6.ppc64-report-0.txt:
	New test reference output.
	* tests/data/Makefile.am: Add the new test input and reference
	output to source distribution.
	* tests/test-diff-pkg.cc (in_out_specs): Add the new test inputs
	and reference output to the set of inputs that are compared.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2016-12-09 01:07:05 +01:00
..
data Fix aborting when reading .foo symbols from a ppc64 binary 2016-12-09 01:07:05 +01:00
Makefile.am Control symbols exported from libabigail.so 2016-07-27 12:51:02 +02:00
mockfedabipkgdiff.in Make fedabipkgdiff consistent with Libabigail's other tests 2016-07-15 19:41:08 +02:00
print-diff-tree.cc
runtestcanonicalizetypes.sh.in Bug 20180 - Support system-wide suppression specifications 2016-05-30 18:39:49 +02:00
runtestdefaultsupprs.py.in Fix python interpreter path for el6 2016-06-28 09:12:40 +02:00
runtestfedabipkgdiff.py.in Make fedabipkgdiff consistent with Libabigail's other tests 2016-07-15 19:41:08 +02:00
test-abicompat.cc Implement a [suppress_file] suppression directive 2016-05-08 12:39:26 +02:00
test-abidiff-exit.cc Bug 20180 - Support system-wide suppression specifications 2016-05-30 18:39:49 +02: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
test-diff-dwarf-abixml.cc Bug 20180 - Support system-wide suppression specifications 2016-05-30 18:39:49 +02:00
test-diff-dwarf.cc Bug 20887 - Show relative change of offsets 2016-12-02 21:29:28 +01:00
test-diff-filter.cc Better recognize qualified void type 2016-07-07 14:04:10 +02:00
test-diff-pkg.cc Fix aborting when reading .foo symbols from a ppc64 binary 2016-12-09 01:07:05 +01:00
test-diff-suppr.cc A suppressed diff node implies suppressing all equivalent nodes too 2016-11-26 11:54:19 +01:00
test-dot.cc
test-ir-walker.cc
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 Drop suppressed ABI artifacts from the IR 2016-09-21 18:35:08 +02:00
test-read-write.cc Drop suppressed ABI artifacts from the IR 2016-09-21 18:35:08 +02: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-valgrind-suppressions.supp Support running "make check-valgrind" 2016-05-22 23:20:12 +02:00
test-write-read-archive.cc
update-test-output.py Rename tests/update-test-read-dwarf-output.py 2016-12-02 12:59:32 +01:00