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

RISC-V ld tests select correct emulation for Zcmt, fixing RV64 object handling

RISC-V linker tests now use the correct LP64 emulation for RV64 objects, resolving issues with riscv32-elf defaults and improving sparse jump table inspection.

This change updates the RISC-V linker test suite to correctly select the emulation for Zcmt tests. Previously, riscv32-elf systems defaulted to ELF32, causing the linker to reject RV64 objects before tests could proceed. The update enforces LP64 for most RV64 tests and adjusts byte-order handling, while also refining how sparse jump tables are inspected using objdump -z to account for endianness differences.

In Details

The binutils/ld subsystem's RISC-V support has been updated to improve its testsuite's handling of different RISC-V ABIs and object formats. Specifically, tests targeting Zcmt (Control-flow Integrity) often use RV64 objects. On a riscv32-elf toolchain, the default linker emulation was ELF32, which rejected these RV64 objects. This commit modifies the test setup to explicitly select the LP64 ABI (for RV64) and ILP32 (for RV32) where appropriate, ensuring that the linker's default emulation matches the object file's architecture and ABI. Additionally, tests involving sparse jump tables have bee…

For Context
ld
The GNU linker, responsible for combining object files and libraries into an executable or shared library.
RISC-V
An open-standard instruction set architecture (ISA) based on reduced instruction set computing principles.
Zcmt
A RISC-V specific extension related to control-flow integrity (CFI) mechanisms.
emulation
In this context, refers to the specific ABI (Application Binary Interface) and memory model that the linker targets, such as LP64 (64-bit pointers, 64-bit integers) or ILP32 (32-bit pointers, 32-bit integers).
LP64
A common ABI for 64-bit RISC-V systems where pointers and long integers are 64 bits, and regular integers are 32 bits.
ILP32
An ABI for 32-bit RISC-V systems where integers, long integers, and pointers are all 32 bits.
RV64
Refers to RISC-V architecture operating in 64-bit mode.
RV32
Refers to RISC-V architecture operating in 32-bit mode.
objdump
A utility that displays information from object files, including disassembly of code sections.
sparse jump table
A data structure used for indirect jumps or calls, which may contain many entries that point to the same location or are intentionally left empty (zeroed).
Filed Under: binutilsldrisc-vtestsuiteabi