GCC Newspaper
OCTOBER 6, 2026
Date
/
Architectures
Components
Topics
News & Policy
Other
alpha

alpha: Enable GNU indirect-function support for alpha-linux

Enables ELF function pointers (ifunc) for the Alpha architecture on Linux.

This commit enables support for GNU indirect functions (__attribute__((ifunc))) on the Alpha architecture when targeting Linux. It sets the necessary configuration flags and ensures that the target’s assembler and linker infrastructure correctly handle the emission of indirect function symbols and their associated relocations, specifically R_ALPHA_IRELATIVE.

In Details

The Alpha backend now enables HAVE_GNU_INDIRECT_FUNCTION=1 and targetm.has_ifunc_p() returns true for alpha*-*-linux*. This allows the use of __attribute__((ifunc)). The generic ifunc machinery in varasm.cc handles symbol emission. Alpha's elf.h provides the necessary assembler directives. A new linker feature test, adapted from the RISC-V implementation, is used to verify that the linker emits R_ALPHA_IRELATIVE relocations, as opposed to R_ALPHA_JMP_SLOT, before defaulting to ifunc support. This change relies on a compatible glibc dynamic linker for runtime support.

For Context
GNU indirect-function (`__attribute__((ifunc))`
A GCC extension that allows functions to have multiple implementations, with the final implementation chosen at runtime by the dynamic linker based on system features or configuration. This is often used for optimized library functions.
Alpha
A 64-bit RISC instruction set architecture originally developed by Digital Equipment Corporation (DEC).
ELF (Executable and Linkable Format)
A standard file format for object files, executable files, shared libraries, and core dumps on Unix-like operating systems. It defines how code, data, and relocation information are organized.
Relocation
Information in an object file that describes how to modify addresses and other references when the file is linked with other object files or loaded into memory. R_ALPHA_IRELATIVE and R_ALPHA_JMP_SLOT are specific relocation types for the Alpha architecture.
HAVE_GNU_INDIRECT_FUNCTION
A GCC configuration macro that indicates whether the target architecture and ABI support GNU indirect functions.
Filed Under: AlphaELFlinkerruntime