libabigail/include
Guillermo E. Martinez ca4f4d894c abipkgdiff: Fix kernel package detection when comparing kABIs
Using abipkgdiff to analyze kABIs from Oracle Linux packages with CTF
debug format, abipkgdiff is not able to identify kernel packages
because the naming of OL kernel packages differs from the naming used
on other RPM-based distributions.

As abipkgdiff fails to see that it's looking at a Linux kernel
package, the binaries are analyzed as user space binaries and that is
not what we want.

This patch addresses the issue by looking for the "vmlinuz" binary
inside the package to determine that it's a kernel package.  In other
words, tools_utils::file_is_kernel_package is changed to look for
"vmlinuz" inside the package, rather than look for a particular
pattern in the package name of the package.

Additionally, when the kernel package contains CTF debug information,
the `vmlinux.ctfa' file is not necessarily shipped the debuginfo
package.  This patch thus adjusts the search path of that file in that
case.

        * include/abg-tools-utils.h (rpm_contains_file): Declare new
        function.
        * src/abg-ctf-reader.cc (ctf::reader::find_ctfa_file): Use
        `find_file_under_dir' utility function to locate `vmlinux.ctfa'
        file.
        (ctf::reader::process_ctf_archive): Adjust dictionary name
        according to module name, removing characters after dot.
        * src/abg-tools-utils.cc (file_has_ctf_debug_info): Use
        `find_file_under_dir' utility function to locate `vmlinux.ctfa'
        file.
        (rpm_contains_file): Define new function.
        (file_is_kernel_package): Use the new `rpm_contains_file' to look
	for the `vmlinuz' file inside the RPM package.  For Debian
	packages however, we don't keep looking at the naming pattern as
	we don't yet have a deb_contains_file function.  Also, this
	function now takes the full path to the RPM.
        (build_corpus_group_from_kernel_dist_under): for CTF, add the
        `root' directory of the extracted package to the set of
        directories under which we should look for debug info.
	* tools/abipkgdiff.cc (maybe_handle_kabi_whitelist_pkg)
	(create_maps_of_package_content, compare_prepared_package, main):
	Adjust call to file_is_kernel_package as it now takes the full
	path to the package.

Signed-off-by: Guillermo E. Martinez <guillermo.e.martinez@oracle.com>
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2023-02-28 12:42:05 +01:00
..
abg-btf-reader.h Update the copyright notice for the BTF reader 2023-01-06 21:40:44 +01:00
abg-comp-filter.h Bug 29811 - Better categorize harmless unknown array size changes 2023-01-01 18:21:56 +01:00
abg-comparison.h Update copyright year for 2023 2023-01-01 18:19:30 +01:00
abg-config.h Update copyright year for 2023 2023-01-01 18:19:30 +01:00
abg-corpus.h Add support for BTF 2023-01-06 21:05:53 +01:00
abg-ctf-reader.h Update copyright year for 2023 2023-01-01 18:19:30 +01:00
abg-cxx-compat.h Update copyright year for 2023 2023-01-01 18:19:30 +01:00
abg-diff-utils.h Update copyright year for 2023 2023-01-01 18:19:30 +01:00
abg-dwarf-reader.h Update copyright year for 2023 2023-01-01 18:19:30 +01:00
abg-elf-based-reader.h Update copyright year for 2023 2023-01-01 18:19:30 +01:00
abg-elf-reader.h Add support for BTF 2023-01-06 21:05:53 +01:00
abg-fe-iface.h fe-iface: Add missing virtual destructor 2023-02-01 17:19:27 +01:00
abg-fwd.h Update copyright year for 2023 2023-01-01 18:19:30 +01:00
abg-hash.h Update copyright year for 2023 2023-01-01 18:19:30 +01:00
abg-ini.h Update copyright year for 2023 2023-01-01 18:19:30 +01:00
abg-interned-str.h Update copyright year for 2023 2023-01-01 18:19:30 +01:00
abg-ir.h ir: Add missing virtual methods overloads 2023-02-21 14:57:20 +01:00
abg-libxml-utils.h Update copyright year for 2023 2023-01-01 18:19:30 +01:00
abg-reader.h Update copyright year for 2023 2023-01-01 18:19:30 +01:00
abg-regex.h Update copyright year for 2023 2023-01-01 18:19:30 +01:00
abg-reporter.h Update copyright year for 2023 2023-01-01 18:19:30 +01:00
abg-sptr-utils.h Update copyright year for 2023 2023-01-01 18:19:30 +01:00
abg-suppression.h Update copyright year for 2023 2023-01-01 18:19:30 +01:00
abg-tools-utils.h abipkgdiff: Fix kernel package detection when comparing kABIs 2023-02-28 12:42:05 +01:00
abg-traverse.h Update copyright year for 2023 2023-01-01 18:19:30 +01:00
abg-version.h.in abidw: Add --abixml-version 2021-11-12 18:31:28 +01:00
abg-viz-common.h Update copyright year for 2023 2023-01-01 18:19:30 +01:00
abg-viz-dot.h Update copyright year for 2023 2023-01-01 18:19:30 +01:00
abg-viz-svg.h Update copyright year for 2023 2023-01-01 18:19:30 +01:00
abg-workers.h Update copyright year for 2023 2023-01-01 18:19:30 +01:00
abg-writer.h Update copyright year for 2023 2023-01-01 18:19:30 +01:00
Makefile.am Add support for BTF 2023-01-06 21:05:53 +01:00