aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf32-arm.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2020-08-27 12:50:20 +0930
committerAlan Modra <amodra@gmail.com>2020-08-27 21:56:33 +0930
commit2ac865acf01270240fecfb27180e65fc55513d83 (patch)
treea41a5cc2fd982f226f9052381e320f94f6ff8154 /bfd/elf32-arm.c
parentc415c83bd98e683d2be0709f476315d46906a371 (diff)
downloadgdb-2ac865acf01270240fecfb27180e65fc55513d83.zip
gdb-2ac865acf01270240fecfb27180e65fc55513d83.tar.gz
gdb-2ac865acf01270240fecfb27180e65fc55513d83.tar.bz2
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.
Diffstat (limited to 'bfd/elf32-arm.c')
-rw-r--r--bfd/elf32-arm.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/bfd/elf32-arm.c b/bfd/elf32-arm.c
index 8fec76e..2499189 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);