binutils Newspaper
JUNE 15, 2026
alpha Proposed

Alpha: Handle local weak undefined symbol value separately

The Alpha backend now handles TLS relocations against local weak undefined symbols separately, since their value is always 0.

This patch modifies the binutils elf64-alpha.c file to handle Thread Local Storage (TLS) relocations against local weak undefined symbols separately. The value of such symbols is always 0. The patch adds a new function elf64_alpha_local_undefweak_p and modifies elf64_alpha_relocate_section to implement this change. Test cases are added to ld/testsuite to verify the new functionality.

In the Thread 1 participant
  1. H.J. Lu <hjl.tools@gmail.com> proposer

    Proposes handling TLS relocations against local weak undefined symbols separately in the Alpha architecture, as their value is always 0.

    “Since local weak undefined symbol value is always 0, handle TLS relocations against local weak undefined symbols separately.”

In Details

This patch addresses a specific relocation scenario in the Alpha architecture's ELF implementation within binutils. Local weak undefined symbols are symbols that are not defined in the current object file but may be defined in another. The linker needs to handle these symbols specially during relocation. TLS relocations involve adjusting addresses for thread-local storage.

For Context

When creating an executable, the linker combines different pieces of code and data. During this process, it resolves symbols, which are names that refer to specific locations in memory. Sometimes, a symbol might be declared but not defined in a particular file (undefined symbol). Weak symbols provide a way to resolve conflicts when multiple definitions of the same symbol exist. TLS refers to thread-local storage, a mechanism for giving each thread its own private data.

Filed Under: binutilsldalphaelftls