binutils Newspaper
OCTOBER 6, 2026
Date
/
Architectures
Components
Topics
News & Policy
Other
binutils/bfd Breaking Change

Revert RISC-V attribute handling for empty input files

Reverts a change that ignored attributes in empty RISC-V input files.

This commit reverts a previous change that modified how RISC-V linker handles attributes in empty input files. The reverted change aimed to ignore attributes in such files, but this reversion suggests it caused unintended consequences or regressions, possibly related to how linker scripts or symbol resolution behave with empty object files.

In Details

This commit reverts a change in bfd/elfxx-riscv.c that modified the logic for processing input BFDs during linking. The original change aimed to ignore attributes in empty input files, but this revert implies that the condition !has_load_contents || null_input_bfd || only_data_sections was too broad or incorrect, potentially affecting the linker's ability to correctly process symbol attributes or section information from valid, albeit minimal, object files.

For Context
attributes
Metadata associated with symbols or sections in an object file, providing additional information to the linker or runtime loader.
BFD
The Binary Descriptor Format, a library used by GNU Binutils to provide a common interface to various object file formats.
linker script
A file that tells the linker how to arrange sections from input object files into the output file, defining memory addresses and symbol placement.
Filed Under: riscvlinkerrevert