binutils Newspaper
OCTOBER 6, 2026
bfd — Ready to Land

bfd: add basic support for BTF debug info

Adds basic support for BPF Type Format (BTF) debugging information to BFD, including data structures and decoding functions.

This patch introduces initial support for BTF debug info into BFD. It includes necessary header files and C source code for handling BTF data structures and decoding functions. The changes are intended to align with GCC’s BTF definitions, which are based on Linux kernel specifications, enabling BFD to work with BTF-formatted debug information.

In the Thread 2 participants
  1. Jose E. Marchesi maintainer

    LGTMs the patch, contingent on no objections from global maintainers regarding BTF's relation to BPF.

    “The patch LGTM. Assuming that BTF falls within the BPF realm (which I think it is a fair assumption, but please wait for a day or so in case some global maintainer has some objection) this patch is OK.”
  2. David Faust proposer

    Submits a patch to add basic BTF support to BFD, including data structures and helper functions, based on GCC's BTF definitions.

    “This patch adds basic support for the BPF Type Format (BTF) to BFD. This includes definitions for data structures and helper functions for decoding the format. The added include/btf.h is copied from gcc and extended with prototypes for helper functions implemented in BFD. The intent is to keep the data structure names, definitions, macros, etc in sync with that of gcc's btf.h (which in turn is…”

Technical Tradeoffs

  • Includes new source and header files, increasing codebase size.

In Details

This patch adds BTF (BPF Type Format) support to BFD, the binary file descriptor library used by binutils. BTF is a compact DWARF-like metadata format used primarily for eBPF programs and increasingly for general kernel and userspace debugging. This change involves adding new source and header files to BFD, mirroring definitions from GCC's BTF implementation, and integrating them into BFD's build system.

For Context
BFD
Binary File Descriptor library, a layer of abstraction in GNU binutils for handling various object file formats.
BTF
BPF Type Format, a compact debugging data format used for eBPF programs and increasingly in the Linux kernel and userspace.
eBPF
Extended Berkeley Packet Filter, a technology that allows running sandboxed programs in the Linux kernel without changing kernel source code or loading modules.

Part of a Series

Filed Under: bfdbtfdebuggingbpf