mirror of
git://sourceware.org/git/libabigail.git
synced 2025-02-02 06:41:40 +00:00
457f5cb202
5 Commits
Author | SHA1 | Message | Date | |
---|---|---|---|---|
Dodji Seketeli
|
bad389f01a |
abipkgdiff: Avoid comparing binaries that are outside of the package
Some symlinks in some RPMs resolve to binaries outside of the package. In those cases, avoid considering them. * src/abg-tools-utils.cc (maybe_get_symlink_target_file_path): Do not require that the file path points to a symlink. A file path can point to a file that is not a symlink and yet the whole path can be in parent directory that is a symlink. In this case, realpath will correctly resolve to the correct target file. * tools/abipkgdiff.cc (maybe_update_package_content): A path to a binary that is not inside the RPM (because a symlink resolved to a file outside of the RPM) should not be added to the set of binaries to be analyzed. * tests/data/test-diff-pkg/symlink-dir-test1-report1.txt: Add new test file. * tests/data/test-diff-pkg-ctf/symlink-dir-test1-report1.txt: Likewise. * tests/data/Makefile.am: Add new test file to source distribution. * tests/test-diff-pkg.cc (in_out_specs): for the data/test-diff-pkg/symlink-dir-test1/dir{1,2}/symlinks test, the root dir of the package is data/test-diff-pkg/symlink-dir-test1/dir{1,2}. Use that to test that the symlinks are properly handled. Also, use the data/test-diff-pkg/symlink-dir-test1/dir{1,2}/symlinks as a root of an alternative package for which the symlinks resolve outside the package, under data/test-diff-pkg/symlink-dir-test1/dir{1,2}/targets. In this later case, the symlinked files should be ignored in the comparison. Likewise for data/test-diff-pkg-ctf/symlink-dir-test1/dir1/symlinks. Signed-off-by: Dodji Seketeli <dodji@redhat.com> |
||
Guillermo E. Martinez
|
8b832a9edf |
ctf-reader: Set alignment-in-bits property to 0
When comparing the IR generated with the CTF front-end against the one generated with the DWARF front-end, the report shows changes in type alignments: 1 Changed variable: [C] 'int a' was changed at test-abi.c:8:1: type of variable changed: type size hasn't changed type alignment changed from 32 to 0 For the sake of consistency, this patch makes the CTF front-end set the alignment to `0' for base types, function types and struct types similarly to what the DWARF front-end does. * src/abg-ctf-reader.cc (process_ctf_base_type) (process_ctf_function_type, process_ctf_struct_type): Adjust `align_in_bits' argument to `0'. * tests/data/test-diff-pkg-ctf/dirpkg-3-report-1.txt: Adjust test. * tests/data/test-diff-pkg-ctf/dirpkg-3-report-2.txt: Likewise. * tests/data/test-diff-pkg-ctf/gmp-6.x.x86_64-report-0.txt: 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-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-of-pointers.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-dynamic-array.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-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. Signed-off-by: Guillermo E. Martinez <guillermo.e.martinez@oracle.com> Signed-off-by: Dodji Seketeli <dodji@redhat.com> |
||
Guillermo E. Martinez
|
8fd02e0a10 |
Use the CTF reader by default when applicable
At the moment, the tools abidw, abidiff, abipkgdiff and kmidiff all use the DWARF front-end by default. When the "--ctf" option is added to the command line, they use the CTF front-end. This patch changes that behaviour in the way described below. If the "--ctf" command line option is passed to the tool and if the binary to analyze contains CTF debug info, then the CTF front-end is used. If the binary contains ONLY CTF debug info, then the CTF front-end is used, even if no "--ctf" option was provided. In all the other cases, the DWARF front-end is used. Of course, the CTF front-end is not used at all if the CTF functionality hasn't been enabled at configure time. This new behaviour is effective for user space and Linux kernel binaries. * doc/manuals/abidiff.rst: Adjust. * doc/manuals/abidw.rst: Likewise. * doc/manuals/abipkgdiff.rst: Likewise. * doc/manuals/kmidiff.rst: Likewise. * include/abg-elf-based-reader.h (initialize): Add member function. * include/abg-elf-reader.h (has_{dwarf,ctf}_debug_info): Add predicate functions. * include/abg-tools-utils.h (create_best_elf_based_reader): Add arguments. * src/abg-ctf-reader.cc (process_ctf_typedef, process_ctf_base_type) (process_ctf_function_type, process_ctf_sou_members, process_ctf_forward_type) (process_ctf_struct_type, process_ctf_union_type, process_ctf_array_type) (process_ctf_qualified_type, process_ctf_pointer_type, process_ctf_enum_type): Remove arguments. Using getters to access required information instead. (reader::cur_tu_): Add data member. (initialize): Add arguments. (cur_transl_unit): Add {get,set)ter. (slurp_elf_info): Clear `STATUS_DEBUG_INFO_NOT_FOUND' if corpus is `LINUX_KERNEL_BINARY_ORIGIN'. (reader::lookup_type): Remove. (reader::build_type): New member function. * src/abg-elf-reader.cc (reader::reader): Locate ctf debug info from binary file. (reader::reader): Reset base `fe_iface' constructor. (reader::has_{dwarf,ctf}_debug_info): New definitions. (reader::read_corpus): Set `STATUS_DEBUG_INFO_NOT_FOUND' according to corpus::origin. * src/abg-tools-utils.cc (dir_contains_ctf_archive): Define new member. (file_has_ctf_debug_info): Looks for kernel ctf debug information archive. (maybe_load_vmlinux_{dwarf,ctf}_corpus): Remove. (load_vmlinux_corpus): Define function to load IR from kernel regardless of the corpus::origin. (build_corpus_group_from_kernel_dist_under): Use create_best_elf_based_reader to select the front-end. (create_best_elf_based_reader): Adjust to allow fallback behaviour for different front-ends. * tests/data/Makefile.am: Add tests. * tests/data/test-diff-pkg-ctf/dirpkg-3-report-2.txt: Adjust. * tests/data/test-read-ctf/test-fallback.abi: New test case. * tests/data/test-read-ctf/test-fallback.c: Likewise. * tests/data/test-read-ctf/test-fallback.o: Likewise. * tests/data/test-read-dwarf/test-fallback.abi: Likewise. * tests/data/test-read-dwarf/test-fallback.c: Likewise. * tests/data/test-read-dwarf/test-fallback.o: Likewise. * tests/test-diff-pkg.cc: Adjust. * tests/test-read-common.cc (test_task::run_abidw): Use the `options:option' field. * tests/test-read-common.h (InOutSpec): Add new member. * tests/test-read-ctf.cc (in_out_specs): Add option field to test suite. Add new test case. * tests/test-read-dwarf.cc: Likewise. * tools/abidiff.cc (main): Use create_best_elf_based_reader. * tools/abidw.cc: Likewise. * tools/abipkgdiff.cc: Likewise. Signed-off-by: Guillermo E. Martinez <guillermo.e.martinez@oracle.com> Signed-off-by: Dodji Seketeli <dodji@redhat.com> |
||
Dodji Seketeli
|
f001c14eee |
tests-diff-{filter,pkg,pkg-ctf}: Fix tests broken by the previous commit
* tests/data/test-diff-filter/test41-report-0.txt: Adjust. * tests/data/test-diff-pkg-ctf/gmp-6.x.x86_64-report-0.txt: Adjust. * tests/data/test-diff-pkg/tbb-4.1-9.20130314.fc22.x86_64--tbb-4.3-3.20141204.fc23.x86_64-report-0.txt: Adjust. * tests/data/test-diff-pkg/tbb-4.1-9.20130314.fc22.x86_64--tbb-4.3-3.20141204.fc23.x86_64-report-1.txt: Adjust. Signed-off-by: Dodji Seketeli <dodji@redhat.com> |
||
Guillermo E. Martinez via Libabigail
|
5a36bb779d |
Add regression tests for abipkgdiff using ctf info
This patch is meant to execute the testsuite for abipkgdiff tool using sources with CTF debug info. * doc/manuals/abipkgdiff.rst: Document the fact that abipkgdiff now supports the CTF format. * tests/data/test-diff-pkg-ctf/cracklib-2.9.6-15-ol8.x86_64-report-0.txt: New test input. * tests/data/test-diff-pkg-ctf/cracklib-2.9.6-15-ol8u0.x86_64.rpm: Likewise. * tests/data/test-diff-pkg-ctf/cracklib-2.9.6-15-ol8u6.x86_64.rpm: Likewise. * tests/data/test-diff-pkg-ctf/dirpkg-0-dir1/dir.abignore: Likewise. * tests/data/test-diff-pkg-ctf/dirpkg-0-dir1/libobj-v0.so: Likewise. * tests/data/test-diff-pkg-ctf/dirpkg-0-dir1/obj-v0.c: Likewise. * tests/data/test-diff-pkg-ctf/dirpkg-0-dir2/libobj-v0.so: Likewise. * tests/data/test-diff-pkg-ctf/dirpkg-0-dir2/obj-v0.c: Likewise. * tests/data/test-diff-pkg-ctf/dirpkg-0-report-0.txt: Likewise. * tests/data/test-diff-pkg-ctf/dirpkg-1-dir1/libobj-v0.so: Likewise. * tests/data/test-diff-pkg-ctf/dirpkg-1-dir1/obj-v0.c: Likewise. * tests/data/test-diff-pkg-ctf/dirpkg-1-dir2/dir.abignore: Likewise. * tests/data/test-diff-pkg-ctf/dirpkg-1-dir2/libobj-v0.so: Likewise. * tests/data/test-diff-pkg-ctf/dirpkg-1-dir2/obj-v0.c: Likewise. * tests/data/test-diff-pkg-ctf/dirpkg-1-report-0.txt: Likewise. * tests/data/test-diff-pkg-ctf/dirpkg-1-report-1.txt: Likewise. * tests/data/test-diff-pkg-ctf/dirpkg-2-dir1/libobj-v0.so: Likewise. * tests/data/test-diff-pkg-ctf/dirpkg-2-dir1/obj-v0.c: Likewise. * tests/data/test-diff-pkg-ctf/dirpkg-2-dir2/.abignore: Likewise. * tests/data/test-diff-pkg-ctf/dirpkg-2-dir2/dir.abignore: Likewise. * tests/data/test-diff-pkg-ctf/dirpkg-2-dir2/libobj-v0.so: Likewise. * tests/data/test-diff-pkg-ctf/dirpkg-2-dir2/obj-v0.c: Likewise. * tests/data/test-diff-pkg-ctf/dirpkg-2-report-0.txt: Likewise. * tests/data/test-diff-pkg-ctf/dirpkg-3-dir1/libobj-v0.so: Likewise. * tests/data/test-diff-pkg-ctf/dirpkg-3-dir1/obj-v0.c: Likewise. * tests/data/test-diff-pkg-ctf/dirpkg-3-dir2/.abignore: Likewise. * tests/data/test-diff-pkg-ctf/dirpkg-3-dir2/libobj-v0.so: Likewise. * tests/data/test-diff-pkg-ctf/dirpkg-3-dir2/obj-v0.c: Likewise. * tests/data/test-diff-pkg-ctf/dirpkg-3-report-0.txt: Likewise. * tests/data/test-diff-pkg-ctf/dirpkg-3-report-1.txt: Likewise. * tests/data/test-diff-pkg-ctf/dirpkg-3-report-2.txt: Likewise. * tests/data/test-diff-pkg-ctf/dirpkg-3.suppr: Likewise. * tests/data/test-diff-pkg-ctf/elfutils-libelf-0.186-1.x86_64.rpm: Likewise. * tests/data/test-diff-pkg-ctf/elfutils-libelf-0.186-2.x86_64.rpm: Likewise. * tests/data/test-diff-pkg-ctf/elfutils-libelf-0.186-report-0.txt: Likewise. * tests/data/test-diff-pkg-ctf/elfutils-libelf-0.186-report-1.txt: Likewise. * tests/data/test-diff-pkg-ctf/gmp-6.1.2-8-ol8u0.x86_64.rpm: Likewise. * tests/data/test-diff-pkg-ctf/gmp-6.2.0-10-ol9u0.x86_64.rpm: Likewise. * tests/data/test-diff-pkg-ctf/gmp-6.x.x86_64-report-0.txt: Likewise. * tests/data/test-diff-pkg-ctf/isl-0.16.1-6.x86_64.rpm: Likewise. * tests/data/test-diff-pkg-ctf/isl-0.16.1-7.x86_64.rpm: Likewise. * tests/data/test-diff-pkg-ctf/isl-0.16.1-report-0.txt: Likewise. * tests/data/test-diff-pkg-ctf/isl-debuginfo-0.16.1-6.x86_64.rpm: Likewise. * tests/data/test-diff-pkg-ctf/isl-debuginfo-0.16.1-7.x86_64.rpm: Likewise. * tests/data/test-diff-pkg-ctf/libdwarf-20180129-4-no-ctf.x86_64.rpm: Likewise. * tests/data/test-diff-pkg-ctf/libdwarf-20180129-4.x86_64.rpm: Likewise. * tests/data/test-diff-pkg-ctf/libdwarf-20180129-5-no-ctf.x86_64.rpm: Likewise. * tests/data/test-diff-pkg-ctf/libdwarf-20180129-5.x86_64.rpm: Likewise. * tests/data/test-diff-pkg-ctf/symlink-dir-test1-report0.txt: Likewise. * tests/data/test-diff-pkg-ctf/symlink-dir-test1/dir1/symlinks/foo.o: Likewise. * tests/data/test-diff-pkg-ctf/symlink-dir-test1/dir1/symlinks/libfoo.so: Likewise. * tests/data/test-diff-pkg-ctf/symlink-dir-test1/dir1/targets/foo.c: Likewise. * tests/data/test-diff-pkg-ctf/symlink-dir-test1/dir1/targets/foo.o: Likewise. * tests/data/test-diff-pkg-ctf/symlink-dir-test1/dir1/targets/libfoo.so: Likewise. * tests/data/test-diff-pkg-ctf/symlink-dir-test1/dir2/symlinks/foo.o: Likewise. * tests/data/test-diff-pkg-ctf/symlink-dir-test1/dir2/symlinks/libfoo.so: Likewise. * tests/data/test-diff-pkg-ctf/symlink-dir-test1/dir2/targets/foo.c: Likewise. * tests/data/test-diff-pkg-ctf/symlink-dir-test1/dir2/targets/foo.o: Likewise. * tests/data/test-diff-pkg-ctf/symlink-dir-test1/dir2/targets/libfoo.so: Likewise. * tests/data/test-diff-pkg-ctf/tarpkg-0-dir1.ta: Likewise. * tests/data/test-diff-pkg-ctf/tarpkg-0-dir1.tar: Likewise. * tests/data/test-diff-pkg-ctf/tarpkg-0-dir1.tar.bz2: Likewise. * tests/data/test-diff-pkg-ctf/tarpkg-0-dir1.tar.gz: Likewise. * tests/data/test-diff-pkg-ctf/tarpkg-0-dir2.ta: Likewise. * tests/data/test-diff-pkg-ctf/tarpkg-0-dir2.tar: Likewise. * tests/data/test-diff-pkg-ctf/tarpkg-0-dir2.tar.bz2: Likewise. * tests/data/test-diff-pkg-ctf/tarpkg-0-dir2.tar.gz: Likewise. * tests/data/test-diff-pkg-ctf/tarpkg-0-report-0.txt: Likewise. * tests/data/test-diff-pkg-ctf/tarpkg-1-dir1.tar.gz: Likewise. * tests/data/test-diff-pkg-ctf/tarpkg-1-dir2.tar.gz: Likewise. * tests/data/test-diff-pkg-ctf/tarpkg-1-report-0.txt: Likewise. * tests/data/test-diff-pkg-ctf/test-rpm-report-0.txt: Likewise. * tests/data/test-diff-pkg-ctf/test-rpm-report-1.txt: Likewise. * tests/data/test-diff-pkg-ctf/test-rpm-report-2.txt: Likewise. * tests/data/test-diff-pkg-ctf/test-rpm-report-3.txt: Likewise. * tests/data/test-diff-pkg-ctf/test-rpm-report-4.txt: Likewise. * tests/data/test-diff-pkg-ctf/test-rpm-report-5.txt: Likewise. * tests/data/Makefile.am: Add the test material above to source distribution. * tests/test-diff-pkg.cc (in_out_spec): Add the test inputs above to this harness. Signed-off-by: Guillermo E. Martinez <guillermo.e.martinez@oracle.com> Signed-off-by: Dodji Seketeli <dodji@redhat.com> |