2009-12-15 Tristan Gingold <gingold@adacore.com>
[binutils-gdb.git] / bfd / elfcore.h
index 9c51422624da37024320b5e45776992afd490a9e..c51c575606d7db86a1b456d2c3d23b2014a36e95 100644 (file)
@@ -159,6 +159,8 @@ elf_core_file_p (bfd *abfd)
          if ((*target_ptr)->flavour != bfd_target_elf_flavour)
            continue;
          back = xvec_get_elf_backend_data (*target_ptr);
+         if (back->s->arch_size != ARCH_SIZE)
+           continue;
          if (back->elf_machine_code == i_ehdrp->e_machine
              || (back->elf_machine_alt1 != 0
                  && i_ehdrp->e_machine == back->elf_machine_alt1)
@@ -188,7 +190,7 @@ elf_core_file_p (bfd *abfd)
 
   /* Allocate space for the program headers.  */
   amt = sizeof (*i_phdrp) * i_ehdrp->e_phnum;
-  i_phdrp = bfd_alloc (abfd, amt);
+  i_phdrp = (Elf_Internal_Phdr *) bfd_alloc (abfd, amt);
   if (!i_phdrp)
     goto fail;