binutils Newspaper
NOVEMBER 30, 2026
sim/bpf — Proposed

sim/bpf: remove unused bpf_program_section variable

Remove unused bpf_program_section variable from BPF simulator.

Simon Marchi proposes removing the unused bpf_program_section variable from the BPF simulator. Building with a recent Clang compiler resulted in an error due to this unused variable being flagged. The feature that would have used this variable was never implemented.

In the Thread 1 participant
  1. Simon Marchi proposer

    Proposes removing the unused `bpf_program_section` variable which causes a build error with recent Clang versions.

    “Building the BPF simulator with a recent clang fails with: /home/smarchi/src/binutils-gdb/sim/bpf/bpf-sim.c:367:14: error: variable 'bpf_program_section' set but not used [-Werror,-Wunused-but-set-global] The --bpf-set-program option stores its argument in this variable, but nothing ever reads it, the feature was never implemented. Remove the variable.”

In Details

This patch removes an unused global variable bpf_program_section from sim/bpf/bpf-sim.c. This variable was intended to store the section name for the BPF program to be run, but the associated functionality was never implemented, leading to a build error with strict warning flags like -Werror,-Wunused-but-set-global.

Part of a Series

Filed Under: cleanupbuildbpf