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

Alpha linker rejects IFUNC address in read-only data for static links

Alpha static linking now rejects taking an IFUNC address from read-only data, as it cannot be made writable at runtime.

This commit modifies the Alpha linker to reject attempts to take an IFUNC address from read-only data in static executables. Unlike dynamic linking where segments can be made writable, static executables mapped by the kernel cannot have their read-only segments modified at runtime. Other targets typically provide a PLT stub address in such cases, but Alpha lacks a PLT entry for non-dynamic functions, leading to an error report instead.

In Details

In static linking on Alpha, taking the address of an IFUNC located in a read-only section is disallowed. This is because the R_ALPHA_IRELATIVE relocation, which is required to update the IFUNC address, needs to modify the target word. At runtime, the kernel maps segments as read-only. While the dynamic linker can later make these segments writable (DT_TEXTREL), a static executable cannot. Since Alpha does not have a PLT entry for non-dynamic functions, it cannot provide a PLT stub address as a fallback. This commit adds a check in bfd/elf64-alpha.c to detect and reject this scenario.

For Context
IFUNC
Indirect Function. A mechanism that allows a function call to be resolved at runtime to one of potentially several implementations, typically based on system features or hardware capabilities. This is also known as GNU_IFUNC.
static link
A type of linking where all necessary code and data from libraries are copied directly into the final executable. This results in a larger executable but does not require external shared libraries at runtime.
R_ALPHA_IRELATIVE
An ELF relocation type specific to the Alpha architecture, used for indirect function calls. It indicates that the relocation value should be the address of the symbol plus an addend, which is typically used to calculate the address of the IFUNC resolver.
DT_TEXTREL
A flag in the ELF dynamic section indicating that the text segment (code segment) is writable. This is usually required for dynamic linking on systems where the text segment is initially mapped as read-only.
PLT stub
Procedure Linkage Table (PLT) stub. A small piece of code in a shared executable that acts as an intermediary for function calls. It resolves the actual function address at runtime the first time it's called.
Filed Under: alphalinkerifuncstatic linkingrelocations