daily update
[deliverable/binutils-gdb.git] / bfd / elfcore.h
index 2a795a9c8bf675e26c61a6e084ae69bec043116e..c206af5f6c3b73bd4b8693f2861567b7aa8a1bd4 100644 (file)
@@ -220,18 +220,20 @@ elf_core_file_p (abfd)
       elf_swap_phdr_in (abfd, &x_phdr, i_phdrp + phindex);
     }
 
-  /* Process each program header.  */
-  for (phindex = 0; phindex < i_ehdrp->e_phnum; ++phindex)
+  /* Set the machine architecture.  Do this before processing the
+     program headers since we need to know the architecture type
+     when processing the notes of some systems' core files.  */
+  if (! bfd_default_set_arch_mach (abfd, ebd->arch, 0))
     {
-      if (! bfd_section_from_phdr (abfd, i_phdrp + phindex, (int) phindex))
+      /* It's OK if this fails for the generic target.  */
+      if (ebd->elf_machine_code != EM_NONE)
        goto fail;
     }
 
-  /* Set the machine architecture.  */
-  if (! bfd_default_set_arch_mach (abfd, ebd->arch, 0))
+  /* Process each program header.  */
+  for (phindex = 0; phindex < i_ehdrp->e_phnum; ++phindex)
     {
-      /* It's OK if this fails for the generic target.  */
-      if (ebd->elf_machine_code != EM_NONE)
+      if (! bfd_section_from_phdr (abfd, i_phdrp + phindex, (int) phindex))
        goto fail;
     }
 
This page took 0.024062 seconds and 4 git commands to generate.