libabigail/tests/data/test-diff-dwarf/test36-ppc64-aliases-v1.cc
Dodji Seketeli 2529f84ae0 Bug 19964 - Cannot load function aliases on ppc64
Registering alias of functions on ppc64 seems to be broken since this
commit:

    11f5dba Bug 19885 - Cannot associates a function DIE to a symbol on powerpc64

This is because the ppc64-specific code tries to register a symbol
alias that was already registered as an alias by the arch-agnostic
code.

This patch fixes that.

	* src/abg-dwarf-reader.cc (read_context::load_symbol_maps): While
	filling the ppc64-specific "function-entry-address => symbol" map,
	if we stumble accross a function-entry-address that belongs to an
	alias of 'symbol', then assume the alias must have been registered
	as an alias already, by the platform-agnostic code.  Do not try to
	register the alias again.
	* tests/data/Makefile.am: Add the new test input binaries to the
	source distribution.
	* tests/data/test-diff-dwarf/libtest36-ppc64-aliases-v0.so: New
	binary test input.
	* tests/data/test-diff-dwarf/libtest36-ppc64-aliases-v1.so: Likewise.
	* tests/data/test-diff-dwarf/test36-ppc64-aliases-report-0.txt:
	New test reference output.
	* tests/data/test-diff-dwarf/test36-ppc64-aliases-v0.cc: Source
	code for the new binary test input above.
	* tests/data/test-diff-dwarf/test36-ppc64-aliases-v1.cc: Likewise.
	* tests/test-diff-dwarf.cc: Add the new test input to the list of
	test inputs considered by this test harness.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2016-04-25 14:48:11 +02:00

29 lines
327 B
C++

// This source code must be compiled on a ppc64 machine!!
// The compilation command must be:
//
// g++ -g -Wall -O2 -shared -o libtest36-ppc64-aliases-v1.so test36-ppc64-aliases-v1.cc
struct S
{
S();
S(int);
~S();
int m0;
int m1;
};
S::S()
: m0()
{}
S::S(int s)
: m0(s), m1(s)
{}
S::~S()
{}
void
foo(S&)
{}