Alpha: Properly handle local weak undefined symbols.
The linker no longer overflows when relocating local weak undefined TLS symbols on Alpha.
The Alpha backend now handles local weak undefined TLS symbols correctly, avoiding relocation overflows by setting their value to 0. When all TLS symbols are weak, hidden, and undefined, the code now sets dtp_base and tp_base to 0, and no longer asserts that elf_hash_table (info)->tls_sec is not NULL. New test cases were added.
In Details
Fixes PR ld/34165. The Alpha port of the linker now correctly handles local weak undefined TLS symbols, setting their values to 0 to prevent relocation overflows. This commit touches elf-bfd.h and elf64-alpha.c, specifically elf64_alpha_relax_got_load and elf64_alpha_relocate_section.
For Context
This commit addresses a bug in the Alpha architecture's linker that occurs when dealing with Thread Local Storage (TLS) symbols that are weakly defined but not actually present in the code. The fix ensures that these symbols are handled correctly during relocation, preventing potential errors. TLS provides each thread with its own private storage.