ubsan: alpha: member access within null pointer

Alan Modra amodra@gmail.com
Fri Sep 3 06:58:59 GMT 2021


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

-- 
Alan Modra
Australia Development Lab, IBM


More information about the Binutils mailing list