libabigail/tests/data/test-diff-dwarf/PR25058-liblttng-ctl.so
Dodji Seketeli 2f7248f340 PR25058 - Support decl DIEs referring to symbols using DW_AT_ranges
Usually, function DIEs (DW_TAG_subprogram) refer to the address of the
underlying ELF symbol by using the DW_AT_low_pc attribute.  However,
there are cases where it does so by using the DW_AT_ranges attribute.
In those cases, the first address of the sequence defined in the value
of that attribute is the address of the ELF symbol.

The problem is that the DWARF reader of Libabigail fails to get the
address of the underlying ELF symbol when the DW_AT_low_pc attribute
is missing.  Rather, it should then look at the value of the
DW_AT_ranges attribute instead.

This is what this patch does.

	* src/abg-dwarf-reader.cc
	(read_context::get_first_address_from_DW_AT_ranges): Define new
	member function.
	(read_context::get_function_address): Use the new
	read_context::get_first_address_from_DW_AT_ranges here.
	* tests/data/test-diff-dwarf/PR25058-liblttng-ctl-report-1.txt:
	New reference test output.
	* tests/data/test-diff-dwarf/PR25058-liblttng-ctl.so: New test
	input binary.
	* tests/data/test-diff-dwarf/PR25058-liblttng-ctl2.10.so: New test
	input binary.
	* tests/data/Makefile.am: Add the new test materials above to
	source distribution.
	* tests/test-diff-dwarf.cc (in_out_specs): Add the new input test
	input binary files to this test harness.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2019-10-03 17:42:30 +02:00

2.1 MiB