From: Alan Modra Date: Thu, 2 Sep 2021 22:48:15 +0000 (+0930) Subject: ubsan: alpha: member access within null pointer X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=f2cfdb748606b3e634050b8f7030e5e7783a4232;p=binutils-gdb.git ubsan: alpha: member access within null pointer * elf64-alpha.c (elf64_alpha_relax_with_lituse): Avoid UB. --- diff --git a/bfd/elf64-alpha.c b/bfd/elf64-alpha.c index 6f5eeadf256..6427406fb19 100644 --- a/bfd/elf64-alpha.c +++ b/bfd/elf64-alpha.c @@ -3191,7 +3191,8 @@ elf64_alpha_relax_with_lituse (struct alpha_relax_info *info, } /* Can't relax dynamic symbols. */ - if (alpha_elf_dynamic_symbol_p (&info->h->root, info->link_info)) + if (info->h != NULL + && alpha_elf_dynamic_symbol_p (&info->h->root, info->link_info)) return true; changed_contents = info->changed_contents;