From: Alan Modra Date: Wed, 27 May 2026 12:07:31 +0000 (+0930) Subject: Re: alpha: Properly handle local weak undefined symbols X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;h=5dd77fc95236da16036d9cbbe0e6f53f0ad7ac3b;p=thirdparty%2Fbinutils-gdb.git Re: alpha: Properly handle local weak undefined symbols asan complains "runtime error: member access within null pointer" for &h->root with NULL h, which is annoying since &h->root is the same address as h, causing alpha-linux-gnu +FAIL: TLS -fpic -shared alpha-linux-gnu +FAIL: TLS -fpic and -fno-pic exec alpha-linux-gnu +FAIL: TLS -fpic and -fno-pic exec -relax * elf64-alpha.c (elf64_alpha_relocate_section): Fix asan complaint. --- diff --git a/bfd/elf64-alpha.c b/bfd/elf64-alpha.c index 594bfe9a80e..8cc70610c59 100644 --- a/bfd/elf64-alpha.c +++ b/bfd/elf64-alpha.c @@ -4648,7 +4648,7 @@ elf64_alpha_relocate_section (bfd *output_bfd, struct bfd_link_info *info, input_bfd, h->root.root.root.string); ret_val = false; } - else if (elf_link_local_undefweak_p (&h->root, info)) + else if (elf_link_local_undefweak_p (h ? &h->root : NULL, info)) /* NB: The local undefined TLS symbol address isn't usable since it isn't mapped to any TLS storage. Set it to 0 to avoid relocation overflow. */ @@ -4676,7 +4676,7 @@ elf64_alpha_relocate_section (bfd *output_bfd, struct bfd_link_info *info, value = 0; else { - if (elf_link_local_undefweak_p (&h->root, info)) + if (elf_link_local_undefweak_p (h ? &h->root : NULL, info)) /* NB: The local undefined TLS symbol address isn't usable since it isn't mapped to any TLS storage. Set it to 0 to avoid relocation overflow. */