Prevent the linker from generaing a seg-fault when the user attempts to link
authorNick Clifton <nickc@redhat.com>
Wed, 12 Mar 2014 13:12:37 +0000 (13:12 +0000)
committerNick Clifton <nickc@redhat.com>
Wed, 12 Mar 2014 13:12:37 +0000 (13:12 +0000)
an ARM ELF binary into an AARCH64 ELF executable.

PR ld/16671
* elf32-arm.c (elf32_arm_add_symbol_hook): Check for ARM format
before testing for vxworks.

bfd/ChangeLog
bfd/elf32-arm.c

index 9872f98d25c6196cb30b982c084d9d39bccd125e..7ecaed681377dd2aa682b3d1043245b217688350 100644 (file)
@@ -1,3 +1,9 @@
+2014-03-12  Nick Clifton  <nickc@redhat.com>
+
+       PR ld/16671
+       * elf32-arm.c (elf32_arm_add_symbol_hook): Check for ARM format
+       before testing for vxworks.
+
 2014-03-12  Alan Modra  <amodra@gmail.com>
 
        * Makefile.in: Regenerate.
index 4692a0579b8fc7f74085e50db939605b6249b421..1aae31b4c908771c0e8080e71a3f01f25195ebb2 100644 (file)
@@ -15861,6 +15861,9 @@ elf32_arm_add_symbol_hook (bfd *abfd, struct bfd_link_info *info,
          || ELF_ST_BIND (sym->st_info) == STB_GNU_UNIQUE))
     elf_tdata (info->output_bfd)->has_gnu_symbols = TRUE;
 
+  if (elf32_arm_hash_table (info) == NULL)
+    return FALSE;
+
   if (elf32_arm_hash_table (info)->vxworks_p
       && !elf_vxworks_add_symbol_hook (abfd, info, sym, namep,
                                       flagsp, secp, valp))