libabigail/tests/data/test-read-write/test-crc.xml

11 lines
871 B
XML
Raw Normal View History

Bump abixml version to 2.3 An older version of libabigail won't be able to grok new abixml files containing the recently added support for pointer-to-member types. It's thus needed to bump the minor version number of the abixml format. The new version is thus 2.3. As a result, this patch also updates the version numbers shown in the various abixml files of the test suite. * configure.ac: Bump ABIXML_VERSION_MINOR to 3. * tests/data/test-annotate/PR29443-missing-xx.o.annotated.abi: Adjust. * tests/data/test-annotate/libtest23.so.abi: Likewise * tests/data/test-annotate/libtest24-drop-fns-2.so.abi: Likewise * tests/data/test-annotate/libtest24-drop-fns.so.abi: Likewise * tests/data/test-annotate/test-anonymous-members-0.o.abi: Likewise * tests/data/test-annotate/test-pointer-to-member-1.o.annotated.abi: Likewise * tests/data/test-annotate/test0.abi: Likewise * tests/data/test-annotate/test1.abi: Likewise * tests/data/test-annotate/test13-pr18894.so.abi: Likewise * tests/data/test-annotate/test14-pr18893.so.abi: Likewise * tests/data/test-annotate/test15-pr18892.so.abi: Likewise * tests/data/test-annotate/test17-pr19027.so.abi: Likewise * tests/data/test-annotate/test18-pr19037-libvtkRenderingLIC-6.1.so.abi: Likewise * tests/data/test-annotate/test19-pr19023-libtcmalloc_and_profiler.so.abi: Likewise * tests/data/test-annotate/test2.so.abi: Likewise * tests/data/test-annotate/test20-pr19025-libvtkParallelCore-6.1.so.abi: Likewise * tests/data/test-annotate/test21-pr19092.so.abi: Likewise * tests/data/test-annotate/test3.so.abi: Likewise * tests/data/test-annotate/test4.so.abi: Likewise * tests/data/test-annotate/test5.o.abi: Likewise * tests/data/test-annotate/test6.so.abi: Likewise * tests/data/test-annotate/test7.so.abi: Likewise * tests/data/test-annotate/test8-qualified-this-pointer.so.abi: Likewise * tests/data/test-read-btf/test0.o.abi: Likewise * tests/data/test-read-btf/test1.o.abi: Likewise * tests/data/test-read-ctf/PR27700/test-PR27700.abi: Likewise * tests/data/test-read-ctf/test-PR26568-1.o.abi: Likewise * tests/data/test-read-ctf/test-PR26568-2.o.abi: Likewise * tests/data/test-read-ctf/test-alias.o.abi: Likewise * tests/data/test-read-ctf/test-ambiguous-struct-A.o.hash.abi: Likewise * tests/data/test-read-ctf/test-ambiguous-struct-B.o.hash.abi: Likewise * tests/data/test-read-ctf/test-anonymous-fields.o.abi: Likewise * tests/data/test-read-ctf/test-array-mdimension.abi: Likewise * tests/data/test-read-ctf/test-array-of-pointers.abi: Likewise * tests/data/test-read-ctf/test-array-size.abi: Likewise * tests/data/test-read-ctf/test-bitfield-enum.abi: Likewise * tests/data/test-read-ctf/test-bitfield.abi: Likewise * tests/data/test-read-ctf/test-callback.abi: Likewise * tests/data/test-read-ctf/test-callback2.abi: Likewise * tests/data/test-read-ctf/test-conflicting-type-syms-a.o.hash.abi: Likewise * tests/data/test-read-ctf/test-conflicting-type-syms-b.o.hash.abi: Likewise * tests/data/test-read-ctf/test-const-array.abi: Likewise * tests/data/test-read-ctf/test-dynamic-array.o.abi: Likewise * tests/data/test-read-ctf/test-enum-many.o.hash.abi: Likewise * tests/data/test-read-ctf/test-enum-symbol.o.hash.abi: Likewise * tests/data/test-read-ctf/test-enum.o.abi: Likewise * tests/data/test-read-ctf/test-fallback.abi: Likewise * tests/data/test-read-ctf/test-forward-type-decl.abi: Likewise * tests/data/test-read-ctf/test-functions-declaration.abi: Likewise * tests/data/test-read-ctf/test-linux-module.abi: Likewise * tests/data/test-read-ctf/test-list-struct.abi: Likewise * tests/data/test-read-ctf/test0.abi: Likewise * tests/data/test-read-ctf/test0.hash.abi: Likewise * tests/data/test-read-ctf/test1.so.abi: Likewise * tests/data/test-read-ctf/test1.so.hash.abi: Likewise * tests/data/test-read-ctf/test2.so.abi: Likewise * tests/data/test-read-ctf/test2.so.hash.abi: Likewise * tests/data/test-read-ctf/test3.so.abi: Likewise * tests/data/test-read-ctf/test3.so.hash.abi: Likewise * tests/data/test-read-ctf/test4.so.abi: Likewise * tests/data/test-read-ctf/test4.so.hash.abi: Likewise * tests/data/test-read-ctf/test5.o.abi: Likewise * tests/data/test-read-ctf/test7.o.abi: Likewise * tests/data/test-read-ctf/test8.o.abi: Likewise * tests/data/test-read-ctf/test9.o.abi: Likewise * tests/data/test-read-dwarf/PR22015-libboost_iostreams.so.abi: Likewise * tests/data/test-read-dwarf/PR22122-libftdc.so.abi: Likewise * tests/data/test-read-dwarf/PR24378-fn-is-not-scope.abi: Likewise * tests/data/test-read-dwarf/PR25007-sdhci.ko.abi: Likewise * tests/data/test-read-dwarf/PR25042-libgdbm-clang-dwarf5.so.6.0.0.abi: Likewise * tests/data/test-read-dwarf/PR26261/PR26261-exe.abi: Likewise * tests/data/test-read-dwarf/PR27700/test-PR27700.abi: Likewise * tests/data/test-read-dwarf/PR28584/PR28584-smv.clang.o.abi: Likewise * tests/data/test-read-dwarf/PR29443-missing-xx.o.abi: Likewise * tests/data/test-read-dwarf/PR29692-kdelibs3-libkjava.so.1.0.0.abi: Likewise * tests/data/test-read-dwarf/libtest23.so.abi: Likewise * tests/data/test-read-dwarf/libtest24-drop-fns-2.so.abi: Likewise * tests/data/test-read-dwarf/libtest24-drop-fns.so.abi: Likewise * tests/data/test-read-dwarf/test-PR26568-1.o.abi: Likewise * tests/data/test-read-dwarf/test-PR26568-2.o.abi: Likewise * tests/data/test-read-dwarf/test-fallback.abi: Likewise * tests/data/test-read-dwarf/test-libaaudio.so.abi: Likewise * tests/data/test-read-dwarf/test-libandroid.so.abi: Likewise * tests/data/test-read-dwarf/test-pointer-to-member-1.o.abi: Likewise * tests/data/test-read-dwarf/test-suppressed-alias.o.abi: Likewise * tests/data/test-read-dwarf/test0.abi: Likewise * tests/data/test-read-dwarf/test0.hash.abi: Likewise * tests/data/test-read-dwarf/test1.abi: Likewise * tests/data/test-read-dwarf/test1.hash.abi: Likewise * tests/data/test-read-dwarf/test10-pr18818-gcc.so.abi: Likewise * tests/data/test-read-dwarf/test11-pr18828.so.abi: Likewise * tests/data/test-read-dwarf/test12-pr18844.so.abi: Likewise * tests/data/test-read-dwarf/test13-pr18894.so.abi: Likewise * tests/data/test-read-dwarf/test14-pr18893.so.abi: Likewise * tests/data/test-read-dwarf/test15-pr18892.so.abi: Likewise * tests/data/test-read-dwarf/test16-pr18904.so.abi: Likewise * tests/data/test-read-dwarf/test17-pr19027.so.abi: Likewise * tests/data/test-read-dwarf/test18-pr19037-libvtkRenderingLIC-6.1.so.abi: Likewise * tests/data/test-read-dwarf/test19-pr19023-libtcmalloc_and_profiler.so.abi: Likewise * tests/data/test-read-dwarf/test2.so.abi: Likewise * tests/data/test-read-dwarf/test2.so.hash.abi: Likewise * tests/data/test-read-dwarf/test20-pr19025-libvtkParallelCore-6.1.so.abi: Likewise * tests/data/test-read-dwarf/test21-pr19092.so.abi: Likewise * tests/data/test-read-dwarf/test22-pr19097-libstdc++.so.6.0.17.so.abi: Likewise * tests/data/test-read-dwarf/test3-alias-1.so.hash.abi: Likewise * tests/data/test-read-dwarf/test3-alias-2.so.hash.abi: Likewise * tests/data/test-read-dwarf/test3-alias-3.so.hash.abi: Likewise * tests/data/test-read-dwarf/test3-alias-4.so.hash.abi: Likewise * tests/data/test-read-dwarf/test3.so.abi: Likewise * tests/data/test-read-dwarf/test3.so.hash.abi: Likewise * tests/data/test-read-dwarf/test4.so.abi: Likewise * tests/data/test-read-dwarf/test4.so.hash.abi: Likewise * tests/data/test-read-dwarf/test5.o.abi: Likewise * tests/data/test-read-dwarf/test5.o.hash.abi: Likewise * tests/data/test-read-dwarf/test6.so.abi: Likewise * tests/data/test-read-dwarf/test6.so.hash.abi: Likewise * tests/data/test-read-dwarf/test7.so.abi: Likewise * tests/data/test-read-dwarf/test7.so.hash.abi: Likewise * tests/data/test-read-dwarf/test8-qualified-this-pointer.so.abi: Likewise * tests/data/test-read-dwarf/test8-qualified-this-pointer.so.hash.abi: Likewise * tests/data/test-read-dwarf/test9-pr18818-clang.so.abi: Likewise * tests/data/test-read-write/test-crc.xml: Likewise * tests/data/test-read-write/test26.xml: Likewise * tests/data/test-read-write/test27.xml: Likewise * tests/data/test-read-write/test28-without-std-fns-ref.xml: Likewise * tests/data/test-read-write/test28-without-std-vars-ref.xml: Likewise Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2023-12-01 10:37:49 +00:00
<abi-corpus version='2.3' path='tests/data/test-symtab/kernel-modversions/one_of_each.ko' architecture='elf-amd-x86_64'>
symtab: Add support for MODVERSIONS (CRC checksums) The Linux Kernel has a mechanism (MODVERSIONS) to checksum symbols based on their type. In a way similar to what libabigail does, but different. The CRC values for symbols can be extracted from the symtab either by following the __kcrctab_<symbol> entry or by using the __crc_<symbol> value directly. This patch adds support for extracting those CRC values and storing them as a property of elf_symbol. Subsequently, 'crc' gets emitted as an attribute of 'elf-symbol' in the XML representation. CRC comparisons are also added to the abidiff machinery such that if both representations of a comparison contain a CRC value, they will be compared and if any of the values is unset (i.e. == 0), equality is assumed. Differences will be reported in the format that the Kernel presents them e.g. via Module.symvers. It is likely, but not necessary, that a CRC difference comes along with an ABI difference reported by libabigail. Not everything that leads to a change of the CRC value an ABI breakage in the libabigail sense. In case a function or variable symbol changes in a harmless way, we would previously also consider a CRC change harmless (or more precise: not harmful). Explicitly testing for CRC changes when analyzing whether diff nodes need to be considered harmful, allows to still classify them harmful. Also add some test cases to ensure reading CRC values from kernel binaries works as expected. The empty-report files have been consolidated to one file: empty-report.txt. That also clarifies the expected outcome for the affected tests. * include/abg-ir.h (elf_symbol::elf_symbol): Add CRC parameter. (elf_symbol::create): Likewise. (elf_symbol::get_crc): New member method. (elf_symbol::set_crc): New member method. * src/abg-comp-filter.cc (crc_changed): New function. (categorize_harmful_diff_node): Also test for CRC changes. * src/abg-ir.cc (elf_symbol::priv::crc_): New data member. * src/abg-ir.cc (elf_symbol::priv::priv): Add CRC parameter. (elf_symbol::elf_symbol): Likewise. (elf_symbol::create): Likewise. (elf_symbol::textually_equals): Add CRC support. (elf_symbol::get_crc): New member method. (elf_symbol::set_crc): New member method. * src/abg-reader.cc (build_elf_symbol): Add CRC support. * src/abg-reporter-priv.cc (maybe_report_diff_for_symbol): Likewise. * src/abg-symtab-reader.cc (symtab::load): Likewise. * src/abg-writer.cc (write_elf_symbol): Likewise. * tests/data/Makefile.am: Add new test data files. * tests/data/test-abidiff-exit/test-crc-report.txt: New test file. * tests/data/test-abidiff-exit/test-crc-v0.abi: Likewise. * tests/data/test-abidiff-exit/test-crc-v1.abi: Likewise. * tests/data/test-abidiff/empty-report.txt: New file. * tests/data/test-abidiff/test-PR18166-libtirpc.so.report.txt: Deleted. * tests/data/test-abidiff/test-PR24552-report0.txt: Deleted. * tests/data/test-abidiff/test-crc-0.xml: New test file. * tests/data/test-abidiff/test-crc-1.xml: Likewise. * tests/data/test-abidiff/test-crc-2.xml: Likewise. * tests/data/test-abidiff/test-crc-report.txt: Likewise. * tests/data/test-abidiff/test-empty-corpus-report.txt: Deleted. * tests/data/test-read-dwarf/PR25007-sdhci.ko.abi: Add CRC values. * tests/data/test-read-write/test-crc.xml: New test data file. * tests/data/test-symtab/kernel-modversions/Makefile: New test source. * tests/data/test-symtab/kernel-modversions/one_of_each.c: Likewise. * tests/data/test-symtab/kernel-modversions/one_of_each.ko: Likewise. * tests/test-abidiff-exit.cc: Add new test case. * tests/test-abidiff.cc: Add new test case. * tests/test-read-write.cc: Likewise. * tests/test-symtab.cc (Symtab::KernelSymtabsWithCRC): New test case. Reviewed-by: Giuliano Procida <gprocida@google.com> Reviewed-by: Dodji Seketeli <dodji@seketeli.org> Signed-off-by: Matthias Maennich <maennich@google.com>
2020-06-30 22:37:14 +00:00
<elf-function-symbols>
<elf-symbol name='exported_function' type='func-type' binding='global-binding' visibility='default-visibility' is-defined='yes' crc='0xe52d5bcf'/>
<elf-symbol name='exported_function_gpl' type='func-type' binding='global-binding' visibility='default-visibility' is-defined='yes' crc='0xfda43846'/>
</elf-function-symbols>
<elf-variable-symbols>
<elf-symbol name='exported_variable' size='4' type='object-type' binding='global-binding' visibility='default-visibility' is-defined='yes' crc='0xee94d699'/>
<elf-symbol name='exported_variable_gpl' size='4' type='object-type' binding='global-binding' visibility='default-visibility' is-defined='yes' crc='0x41336c46'/>
</elf-variable-symbols>
</abi-corpus>