+#define irix_core_core_file_matches_executable_p generic_core_file_matches_executable_p
+#define irix_core_core_file_pid _bfd_nocore_core_file_pid
+
+static asection *make_bfd_asection
+ (bfd *, const char *, flagword, bfd_size_type, bfd_vma, file_ptr);
+
+/* Helper function for irix_core_core_file_p:
+ 32-bit and 64-bit versions. */
+
+#ifdef CORE_MAGIC64
+static int
+do_sections64 (bfd *abfd, struct coreout *coreout)
+{
+ struct vmap64 vmap;
+ char *secname;
+ int i, val;
+
+ for (i = 0; i < coreout->c_nvmap; i++)
+ {
+ val = bfd_bread (&vmap, (bfd_size_type) sizeof vmap, abfd);
+ if (val != sizeof vmap)
+ break;
+
+ switch (vmap.v_type)
+ {
+ case VDATA:
+ secname = ".data";
+ break;
+ case VSTACK:
+ secname = ".stack";
+ break;
+#ifdef VMAPFILE
+ case VMAPFILE:
+ secname = ".mapfile";
+ break;
+#endif
+ default:
+ continue;
+ }
+
+ /* A file offset of zero means that the
+ section is not contained in the corefile. */
+ if (vmap.v_offset == 0)
+ continue;
+
+ if (!make_bfd_asection (abfd, secname,
+ SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS,
+ vmap.v_len, vmap.v_vaddr, vmap.v_offset))
+ /* Fail. */
+ return 0;
+ }
+
+ return 1;
+}
+#endif
+
+/* 32-bit version. */
+
+static int
+do_sections (bfd *abfd, struct coreout *coreout)
+{
+ struct vmap vmap;
+ char *secname;
+ int i, val;
+
+ for (i = 0; i < coreout->c_nvmap; i++)
+ {
+ val = bfd_bread (&vmap, (bfd_size_type) sizeof vmap, abfd);
+ if (val != sizeof vmap)
+ break;
+
+ switch (vmap.v_type)
+ {
+ case VDATA:
+ secname = ".data";
+ break;
+ case VSTACK:
+ secname = ".stack";
+ break;
+#ifdef VMAPFILE
+ case VMAPFILE:
+ secname = ".mapfile";
+ break;
+#endif
+ default:
+ continue;
+ }
+
+ /* A file offset of zero means that the
+ section is not contained in the corefile. */
+ if (vmap.v_offset == 0)
+ continue;
+
+ if (!make_bfd_asection (abfd, secname,
+ SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS,
+ vmap.v_len, vmap.v_vaddr, vmap.v_offset))
+ /* Fail. */
+ return 0;
+ }
+ return 1;
+}
+