The Git repository of the Libabigail Project
Go to file
Dodji Seketeli 12641b1130 Add support for BTF
This adds support for the BTF debug information format.  It provides a
new BTF front-end which can be instantiated by the function
tools::create_best_elf_based_reader().

For now, the BTF front-end supports the basic types (integers,
pointers, qualified types, typedefs, struct and unions and function
pointers) for functions and variables as emitted for the C language by
GCC.  It seems to be able to support the BTF debug information emitted
for the vmlinux kernel by the pahole tool as well.

When configured with the --enable-btf option, the WITH_BTF
pre-processor macro is defined, enabling the BTF support.  That option
is turned on by default if the /usr/include/bpf/btf.h header is found
on the system.  To disable this, one can use the --disable-btf option.

The abidw and abidiff programs have been adapted to use the BTF
front-end when provided with the '--btf' option, or if BTF debug
information is the only one present in the binary.

	* configure.ac: If the header /usr/include/bpf/btf.h exists, then
	define the WITH_BTF pre-processor macro, unless --disable-btf was
	provided.
	* doc/manuals/abidiff.rst: Document the new --btf option.
	* doc/manuals/abidw.rst: Likewise.
	* doc/manuals/kmidiff.rst: Likewise.
	* doc/manuals/abipkgdiff.rst: Likewise.
	* include/abg-btf-reader.h: New header file.  Contains the
	declaration of the new btf::reader class.
	* src/abg-btf-reader.cc: New source file.  Contains the
	definitions of the new btf::reader class.
	* include/Makefile.am: Add the new include/abg-btf-reader.h header
	file to source distribution.
	* include/abg-corpus.h (enum origin): Add a new BTF_ORIGIN
	enumerator.
	* include/abg-tools-utils.h (file_has_btf_debug_info): Declare new
	function.
	* src/abg-tools-utils.cc (file_has_btf_debug_info): Define new
	function.
	(create_best_elf_based_reader): Adapt to support BTF input.  If
	the user requested the BTF front-end, instantiate it.  Otherwise,
	if the input file has only BTF debug info, instantiate the BTF
	front end.
	* include/abg-elf-reader.h (elf::reader::find_btf_section):
	Declare new member function.
	(elf::reader::{function, variable}_symbol_is_exported): Add new
	overloads.
	* src/abg-elf-reader.cc (reader::priv::btf_section): New data
	member.
	(reader::find_btf_section): Define new member function.
	* src/Makefile.am: Add the new abg-ctf-reader.cc file to source
	distribution.
	* tools/abidw.cc (options::use_btf): New data member.
	(display_usage): Add a help string for the new --btf option.
	(parse_command_line): Support the new --btf option.
	(load_corpus_and_write_abixml):  If the user asked to use the btf
	front-end then use that one.
	* tools/abidiff.cc (options::use_btf): New data member.
	(options::options): Initialize it.
	(display_usage):: Add a help string to the new --btf options.
	(parse_command_line): Support the new --btf options.
	(main): If the user asked to use the btf front-end, then use that
	one.
	* tools/abidw.cc (options::use_btf): New data member.
	(options::options): Initialize it.
	(parse_command_line): Add a help string to the new --btf options.
	(load_corpus_and_write_abixml): If the user asked to use the btf
	front-end, then use that one.
	* tools/kmidiff.cc (options::use_btf): New data member.
	(options::options): Initialize it.
	(display_usage): Add a help string to the new --btf options.
	(parse_command_line): Add a help string to the new --btf options.
	(main): If the user asked to use the btf front-end, then use that
	one.
	* tools/abipkgdiff.cc (options::use_btf): New data member.
	(options::options): Initialize it.
	(display_usage): Add a help string to the new --btf options.
	(parse_command_line): Add a help string to the new --btf options.
	(compare, compare_to_self)
	(compare_prepared_linux_kernel_packages): If the user asked to use
	the btf front-end, then use that one.
	* tests/data/test-read-btf/test{0,1}.o: New binary test input
	file.
	* tests/data/test-read-btf/test{0,1}.c: Source code of the binary
	input file above.
	* tests/data/test-read-btf/test{0,1}.o.abi: Reference ABIXML
	output.
	* tests/data/test-abidiff-exit/btf/test0-report-{1,2}.txt: New
	test reference output.
	* tests/data/test-abidiff-exit/btf/test0-v{0,1}.o: New binary test
	input.
	* tests/data/test-abidiff-exit/btf/test0-v{0,1}.c: The source
	files of the binary inputs above.
	* tests/test-read-btf.cc: New test file to run the btf/abixml
	tests.
	* tests/Makefile.am: Add the new test files to the source
	distribution.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2023-01-06 21:05:53 +01:00
.github Adding missing newline to build-container workflow 2022-05-17 09:46:16 +02:00
autoconf-archive Replace individual license references with SPDX Identifiers 2020-12-02 11:44:13 +01:00
bash-completion Re-license the project to Apache v2 With LLVM Exception 2020-12-02 11:49:13 +01:00
doc Add support for BTF 2023-01-06 21:05:53 +01:00
docker Add github actions to support workflows 2022-05-17 00:13:40 +02:00
include Add support for BTF 2023-01-06 21:05:53 +01:00
m4 Delete ltsugar.m4 and pkg.m4 files from m4/ 2015-01-06 09:54:45 +01:00
relicensing-scripts Bug 27512 - Remove broken zip-archive support 2021-03-19 10:52:57 +01:00
scripts Re-license the project to Apache v2 With LLVM Exception 2020-12-02 11:49:13 +01:00
src Add support for BTF 2023-01-06 21:05:53 +01:00
tests Add support for BTF 2023-01-06 21:05:53 +01:00
tools Add support for BTF 2023-01-06 21:05:53 +01:00
.clang-format Tweak clang-format configuration 2021-10-19 12:59:18 +02:00
.gitignore .gitignore: Add libabigail-?.* *.orig files 2019-05-22 14:34:23 +02:00
.mailmap Add '.mailmap' 2021-12-17 20:12:20 +01:00
abigail.m4 Re-license the project to Apache v2 With LLVM Exception 2020-12-02 11:49:13 +01:00
ABIXML-FORMAT-VERSIONS Bug 28450 - Fix cloned member function handling in DWARF 2021-11-12 18:31:28 +01:00
AUTHORS
ChangeLog ChangeLog: Update for 2.2 release 2022-12-19 18:46:45 +01:00
COMMIT-LOG-GUIDELINES Update the COMMIT-LOG-GUIDELINES file 2016-05-22 23:20:12 +02:00
COMPILING Improve some grammar 2022-02-25 11:24:20 +01:00
configure.ac Add support for BTF 2023-01-06 21:05:53 +01:00
CONTRIBUTING Improve some grammar 2022-02-25 11:24:20 +01:00
default.abignore Re-license the project to Apache v2 With LLVM Exception 2020-12-02 11:49:13 +01:00
gen-changelog.py Replace individual license references with SPDX Identifiers 2020-12-02 11:44:13 +01:00
install-sh Replace individual license references with SPDX Identifiers 2020-12-02 11:44:13 +01:00
libabigail.pc.in
license-change-2020.txt Add a license-change-2020.txt file 2020-12-02 11:50:22 +01:00
LICENSE.txt Add the LICENSE.txt file 2020-12-02 11:49:33 +01:00
ltmain.sh Replace individual license references with SPDX Identifiers 2020-12-02 11:44:13 +01:00
Makefile.am Use xz as the default tarball compression format 2022-11-18 13:06:09 +01:00
NEWS NEWS: Update for 2.2 release 2022-12-19 18:46:45 +01:00
README Improve some grammar 2022-02-25 11:24:20 +01:00
README-DOCKER.md Add github actions to support workflows 2022-05-17 00:13:40 +02:00
release-text-template.txt Update the release text template after 1.0 2017-11-22 15:55:43 +01:00
update-copyright.sh Update copyright year for 2023 2023-01-01 18:19:30 +01:00
VISIBILITY Improve some grammar 2022-02-25 11:24:20 +01:00

This is the Application Binary Interface Generic Analysis and
Instrumentation Library.

It aims at constructing, manipulating, serializing and de-serializing
ABI-relevant artifacts.

The set of artifacts that we are intersted is made of quantities like
types, variable, functions and declarations of a given library or
program.  For a given library or program this set of quantities is
called an ABI corpus.

This library aims at (among other things) providing a way to compare
two ABI Corpora (apparently the plural of corpus is copora, heh,
that's cool), provide detailed information about their differences,
and help build tools to infer interesting conclusions about these
differences.

You are welcome to contribute to this project after reading the files
CONTRIBUTING and COMMIT-LOG-GUIDELINES files in the source tree.

Communicating with the maintainers of this project -- including
sending patches to be include to the source code -- happens via email
at libabigail@sourceware.org.