From: Alan Modra Date: Thu, 27 Aug 2020 03:20:20 +0000 (+0930) Subject: arm-symbianelf segfault X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=2ac865acf01270240fecfb27180e65fc55513d83;p=binutils-gdb.git arm-symbianelf segfault Yes, the target is marked obsolete due to this and other segfaults, but this one is easy enough to fix. * elf32-arm.c (elf32_arm_final_link_relocate): Don't segfault on sym_sec not being output. --- diff --git a/bfd/ChangeLog b/bfd/ChangeLog index fb998c24986..18ded261a57 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,8 @@ +2020-08-27 Alan Modra + + * elf32-arm.c (elf32_arm_final_link_relocate): Don't segfault + on sym_sec not being output. + 2020-08-27 Alan Modra PR 26416 diff --git a/bfd/elf32-arm.c b/bfd/elf32-arm.c index 8fec76e4e1d..24991898f70 100644 --- a/bfd/elf32-arm.c +++ b/bfd/elf32-arm.c @@ -10595,7 +10595,9 @@ elf32_arm_final_link_relocate (reloc_howto_type * howto, osec = sym_sec->output_section; else osec = input_section->output_section; - symbol = elf_section_data (osec)->dynindx; + symbol = 0; + if (osec && elf_section_data (osec)) + symbol = elf_section_data (osec)->dynindx; if (symbol == 0) { struct elf_link_hash_table *htab = elf_hash_table (info);