libabigail/tests/data/test-read-dwarf
Dodji Seketeli 2bbe75a08a Fixup virtual member functions with linkage and no underlying symbol
This is from the problem report at
https://sourceware.org/bugzilla/show_bug.cgi?id=19707.

GCC 5.3.1, when invoked with -g -O2 emits some debug info where some
virtual member functions with linkage name have no reference to any
underlying symbol.  When that binary is compared to its counterpart
compiled with -g, the member function in question does have an
underlying symbol and thus the comparison of the enclosing types yield
a spurious change report like:

    method virtual void unity::scopes::ScopeBase::stop() didn't have any
    linkage name, and it now has: '_ZN5unity6scopes9ScopeBase4stopEv'

This patch introduces a pass in the DWARF reader which fixes up
virtual member function with linkage and no underlying symbol.  If
there is a symbol with a name equals to the linkage name, the virtual
member function has its underlying symbol set to that symbol.

This fixes the spurious change report.

	* src/abg-dwarf-reader.cc (die_function_decl_map_type): New
	typedef.
	(read_context::die_function_with_no_symbol_map_): New data member.
	(read_context::die_function_decl_with_no_symbol_map): New
	accessor.
	(read_context::fixup_functions_with_no_symbols): New member
	function.
	(finish_member_function_reading): Take a read_context.  Schedule
	virtual member functions with linkage and no underlying symbol to
	be fixed up after all the debug info is read.
	(build_function_decl): After a virtual member function_decl has
	been updated, if it has its underlying symbol and was scheduled
	for fixup, then de-schedule it.
	(build_class_type_and_add_to_ir, build_ir_node_from_die): Adjust
	call to finish_member_function_reading.
	(read_corpus_from_elf): Move the pure ELF (symbol and other mundane
	information) information reading ...
	(read_debug_info_into_corpus): ...  here.  Make it happen *before*
	actual reading of DWARF information.  We need symbol information
	to be present and fully set before we start reading debug info.
	This is so that we can know when a virtual member function doesn't
	need to be fixed up.  Also, perform the fixup after the debug
	information was read.
	* tests/data/test-read-dwarf/test22-pr19097-libstdc++.so.6.0.17.so.abi: Adjust.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2016-02-25 16:49:39 +01:00
..
test0 Tweak dwarf reading test to detect more namespace linking-fu 2014-01-13 17:36:20 +01:00
test0.abi Bug 19173 - Abidiff doesn't detect symbol size change in library 2015-11-07 23:22:18 +01:00
test0.cc Tweak dwarf reading test to detect more namespace linking-fu 2014-01-13 17:36:20 +01:00
test1 Add regression tests for dwarf reading 2014-01-07 15:51:52 +01:00
test1.abi Bug 19336 - Better handle redundantly qualified reference types 2015-12-08 14:11:22 +01:00
test1.cc Add regression tests for dwarf reading 2014-01-07 15:51:52 +01:00
test2-0.cc Initial support for DW_TAG_partial_unit 2014-05-19 17:26:40 +02:00
test2-1.cc Initial support for DW_TAG_partial_unit 2014-05-19 17:26:40 +02:00
test2.h Initial support for DW_TAG_partial_unit 2014-05-19 17:26:40 +02:00
test2.so Initial support for DW_TAG_partial_unit 2014-05-19 17:26:40 +02:00
test2.so.abi Use cache type hash values only after type canonicalization is done 2015-09-07 23:35:30 +02:00
test3.c Keep symbol's multiple aliases within single attribute separated by comma 2014-06-20 11:56:49 +02:00
test3.so Keep symbol's multiple aliases within single attribute separated by comma 2014-06-20 11:56:49 +02:00
test3.so.abi On changed fn, show symbol info when name is different from linkage name in C 2015-07-19 19:52:01 +02:00
test4.c Handle C99 restrict qualifier and DWARFv3 DW_TAG_restrict_type. 2014-06-23 15:55:37 +02:00
test4.so Handle C99 restrict qualifier and DWARFv3 DW_TAG_restrict_type. 2014-06-23 15:55:37 +02:00
test4.so.abi On changed fn, show symbol info when name is different from linkage name in C 2015-07-19 19:52:01 +02:00
test5.cc Support reading void* type from DWARF 2014-06-23 17:31:26 +02:00
test5.o Support reading void* type from DWARF 2014-06-23 17:31:26 +02:00
test5.o.abi On changed fn, show symbol info when name is different from linkage name in C 2015-07-19 19:52:01 +02:00
test6.cc Consider symbols with STB_GNU_UNIQUE binding as public 2014-07-08 14:18:36 +02:00
test6.so Consider symbols with STB_GNU_UNIQUE binding as public 2014-07-08 14:18:36 +02:00
test6.so.abi Bug 19173 - Abidiff doesn't detect symbol size change in library 2015-11-07 23:22:18 +01:00
test7.cc Support C and C++ array type. 2014-08-22 13:07:41 +02:00
test7.so Support C and C++ array type. 2014-08-22 13:07:41 +02:00
test7.so.abi Bug 19336 - Better handle redundantly qualified reference types 2015-12-08 14:11:22 +01:00
test8-qualified-this-pointer.cc Yet another fix to the DWARF method "static-ness" detection heuristic 2014-10-16 23:49:41 +02:00
test8-qualified-this-pointer.so Yet another fix to the DWARF method "static-ness" detection heuristic 2014-10-16 23:49:41 +02:00
test8-qualified-this-pointer.so.abi On changed fn, show symbol info when name is different from linkage name in C 2015-07-19 19:52:01 +02:00
test9-pr18818-clang.so Bug 18818 - abidw aborts on a class with a non-complete base class 2015-08-14 16:22:14 +02:00
test9-pr18818-clang.so.abi Bug 19638 - DWARF reader fails to link clone function to its declaration 2016-02-17 16:30:01 +01:00
test10-pr18818-gcc.so Bug 18818 - abidw aborts on a class with a non-complete base class 2015-08-14 16:22:14 +02:00
test10-pr18818-gcc.so.abi Bug 19638 - DWARF reader fails to link clone function to its declaration 2016-02-17 16:30:01 +01:00
test11-pr18828.so Bug 18828 - Handle force-resolving of multiple declarations-only of the same type 2015-08-15 00:26:39 +02:00
test11-pr18828.so.abi Bug 19336 - Better handle redundantly qualified reference types 2015-12-08 14:11:22 +01:00
test12-pr18844.so Bug 18844 - assert failure in abidw at abg-dwarf-reader.cc:6537 2015-08-18 12:33:57 +02:00
test12-pr18844.so.abi Bug 19638 - DWARF reader fails to link clone function to its declaration 2016-02-17 16:30:01 +01:00
test13-pr18894.so Bug 18894 - Fix representation of enumerators in abixml format 2015-08-29 17:17:48 +02:00
test13-pr18894.so.abi Adjust regression tests reference output for the current patch set 2015-10-17 16:18:36 +02:00
test14-pr18893.so Bug 18893 - type degradation from dwarf to abixml on libGLU.so 2015-08-30 17:11:36 +02:00
test14-pr18893.so.abi Bug 19336 - Better handle redundantly qualified reference types 2015-12-08 14:11:22 +01:00
test15-pr18892.so Bug 18892 - type degradation from DWARF to abixml on libtsan.so 2015-08-30 17:56:19 +02:00
test15-pr18892.so.abi Bug 19336 - Better handle redundantly qualified reference types 2015-12-08 14:11:22 +01:00
test16-pr18904.so More type degradation fixes (from DWARF to abixml) 2015-09-02 14:15:58 +02:00
test16-pr18904.so.abi Bug 19638 - DWARF reader fails to link clone function to its declaration 2016-02-17 16:30:01 +01:00
test17-pr19027.so Bug 19027 - ABI asymmetry with enums over INT_MAX 2015-10-01 11:40:52 +02:00
test17-pr19027.so.abi Bug 19336 - Better handle redundantly qualified reference types 2015-12-08 14:11:22 +01:00
test18-pr19037-libvtkRenderingLIC-6.1.so Bug 19037 - Make ABI corpus support several functions with same symbol 2015-10-06 13:32:12 +02:00
test18-pr19037-libvtkRenderingLIC-6.1.so.abi Bug 19638 - DWARF reader fails to link clone function to its declaration 2016-02-17 16:30:01 +01:00
test19-pr19023-libtcmalloc_and_profiler.so Bug 19023 - Type canonicalization is sensitive to struct-ness 2015-10-07 00:41:32 +02:00
test19-pr19023-libtcmalloc_and_profiler.so.abi Bug 19638 - DWARF reader fails to link clone function to its declaration 2016-02-17 16:30:01 +01:00
test20-pr19025-libvtkParallelCore-6.1.so Bug 19025 - abixml writer forgets to emit some member types 2015-10-08 13:50:49 +02:00
test20-pr19025-libvtkParallelCore-6.1.so.abi Bug 19638 - DWARF reader fails to link clone function to its declaration 2016-02-17 16:30:01 +01:00
test21-pr19092.so Bug 19092 - abidw aborts on types that violate the ODR 2015-10-15 16:22:14 +02:00
test21-pr19092.so.abi Bug 19173 - Abidiff doesn't detect symbol size change in library 2015-11-07 23:22:18 +01:00
test22-pr19097-libstdc++.so.6.0.17.so Adjust regression tests reference output for the current patch set 2015-10-17 16:18:36 +02:00
test22-pr19097-libstdc++.so.6.0.17.so.abi Fixup virtual member functions with linkage and no underlying symbol 2016-02-25 16:49:39 +01:00