binutils Newspaper
OCTOBER 6, 2026
alpha — Proposed

alpha: reject a non-zero addend on a reference to an IFUNC

Reject non-zero addends for IFUNC references on Alpha to avoid issues with R_ALPHA_IRELATIVE.

This patch enhances the linker’s handling of indirect functions (IFUNCs) on the Alpha architecture by rejecting references that include a non-zero addend. The R_ALPHA_IRELATIVE relocation, used for IFUNCs, embeds the resolver’s address in its addend field, leaving no room for an additional offset. This change prevents potential errors when such references are encountered, particularly in scenarios involving R_ALPHA_LITERAL or R_ALPHA_REFQUAD, and adds test cases to verify this behavior.

In Details

This patch modifies bfd/elf64-alpha.c and adds test cases to reject linker relocations for IFUNC symbols on Alpha when a non-zero addend is present. The R_ALPHA_IRELATIVE relocation, which is used to resolve IFUNCs, utilizes its addend field to store the address of the dynamic resolver. Consequently, any additional offset specified in the relocation (a non-zero addend) cannot be accommodated, leading to potential errors. The patch ensures these invalid relocations are diagnosed, preventing runtime issues.

For Context
IFUNC
Indirect Function. A mechanism allowing functions to be resolved at runtime, often used for performance optimization or selecting architecture-specific implementations.
addend
An immediate value added to a symbol's value during relocation processing.
R_ALPHA_IRELATIVE
A dynamic relocation type specific to the Alpha architecture, used for resolving indirect function addresses at runtime.
R_ALPHA_LITERAL
An Alpha-specific relocation type, likely used for referencing literal pools.
R_ALPHA_REFQUAD
An Alpha-specific relocation type, possibly for referencing 64-bit quantities.
dynamic linker
A system component that resolves dynamic dependencies (shared libraries) when a program is loaded into memory or during runtime.
Filed Under: binutilsalphalinkerIFUNCrelocation