binutils Newspaper
NOVEMBER 30, 2026
Date
/
Architectures
Components
Topics
News & Policy
Other
bpf

BPF assembler accepts varied spellings for addr_space_cast

BPF assembler now handles different hex and decimal spellings for address space operands in addr_space_cast, fixing kernel BPF selftest assembly failures.

The BPF assembler in binutils previously failed to assemble kernel BPF selftests when using the addr_space_cast instruction with hex-formatted address spaces. This change modifies the assembler to accept various spellings of these address spaces by parsing them as numbers. This ensures compatibility with newer GCC versions that support addr_space_cast and resolves assembly errors that occurred due to literal string matching.

In Details

The gas component's BPF backend now correctly parses numeric operands for the addr_space_cast instruction, specifically handling the address space arguments. Previously, it treated hex values as literal strings, causing assembly failures. This fix introduces a %DIGIT tag to the BPF opcode definitions and updates the assembler and disassembler to compare these operands by value, aligning with GCC's support for addr_space_cast.

Filed Under: binutilsbpfassemblerkernel