ubsan: alpha: member access within null pointer

* elf64-alpha.c (elf64_alpha_relax_with_lituse): Avoid UB.
This commit is contained in:
Alan Modra 2021-09-03 08:18:15 +09:30
parent 174fe10cb6
commit f2cfdb7486

View File

@ -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;