binutils Newspaper
JULY 29, 2026
Date
/
Architectures
Components
Topics
News & Policy
Other
risc-v

RISC-V: Detect conflicting extensions during linker arch attribute merges

Linker now correctly rejects merges of RISC-V object files with conflicting architecture extensions.

The RISC-V linker has been updated to detect and reject merges of object files that would result in conflicting architecture extensions. Previously, the linker validated individual inputs but not the combined result, potentially allowing incompatible extensions to coexist. The change adds checks for implied extensions and conflicts after merging, also including new test cases for such scenarios.

In Details

When merging multiple RISC-V object files, the linker combines their riscv_arch attributes. This process now correctly identifies conflicts arising from the merged set, including those implied by combinations of extensions from different inputs (e.g., 'c' + 'd' implying 'zcd' which conflicts with 'zcmp'). This prevents the creation of binaries with incompatible instruction sets.

For Context
RISC-V arch attribute
Metadata embedded in object files that specifies the RISC-V architecture extensions enabled for that compilation unit. The linker uses these attributes to ensure compatibility when combining object files.
linker
A program that takes one or more object files (produced by the compiler) and combines them into a single executable or library. It resolves symbol references between files and applies relocations.
conflicting extensions
In RISC-V, certain architecture extensions are mutually exclusive or incompatible. For example, a compressed instruction set extension might conflict with a specific floating-point extension if they use overlapping encoding space or have contradictory requirements.
Filed Under: RISC-VlinkerABI