pe_ILF_make_a_symbol_reloc segfault
authorAlan Modra <amodra@gmail.com>
Tue, 15 Feb 2022 12:00:09 +0000 (22:30 +1030)
committerAlan Modra <amodra@gmail.com>
Wed, 16 Feb 2022 11:35:24 +0000 (22:05 +1030)
pei-aarch64-little apparently lacks support for BFD_RELOC_RVA.

* peicode.h (pe_ILF_make_a_symbol_reloc): Don't segfault on
NULL howto.

bfd/peicode.h

index bbf44813a7596d889981eee1bcf6684569121e0f..0346bc2174ec37d31b1872a7a1e7ee864700d71f 100644 (file)
@@ -489,7 +489,7 @@ pe_ILF_make_a_symbol_reloc (pe_ILF_vars *           vars,
 
   internal->r_vaddr  = address;
   internal->r_symndx = sym_index;
-  internal->r_type   = entry->howto->type;
+  internal->r_type   = entry->howto ? entry->howto->type : 0;
 
   vars->relcount ++;