The direct fix for this segfault is to test for a non-NULL bed in
_bfd_elf_link_keep_memory, but also there isn't much point in running
code for LTO if the output is binary.
PR 32067
* elflink.c (_bfd_elf_link_keep_memory): Test for non-NULL bed.
(elf_link_add_object_symbols): Don't run the loop setting
non_ir_ref_regular if the output hash table is not ELF.
this is opt-in by each backend. */
const struct elf_backend_data *bed
= get_elf_backend_data (info->output_bfd);
- if (bed->use_mmap)
+ if (bed != NULL && bed->use_mmap)
return false;
#endif
bfd *abfd;
&& !bfd_link_relocatable (info)
&& (abfd->flags & BFD_PLUGIN) == 0
&& !just_syms
- && extsymcount)
+ && extsymcount != 0
+ && is_elf_hash_table (&htab->root))
{
int r_sym_shift;