- PARAMS ((bfd *, CONST char *, flagword, bfd_size_type, bfd_vma, file_ptr));
-static const bfd_target *irix_core_core_file_p PARAMS ((bfd *));
-static char *irix_core_core_file_failing_command PARAMS ((bfd *));
-static int irix_core_core_file_failing_signal PARAMS ((bfd *));
-static boolean irix_core_core_file_matches_executable_p
- PARAMS ((bfd *, bfd *));
-static asymbol *irix_core_make_empty_symbol PARAMS ((bfd *));
-static void swap_abort PARAMS ((void));
+ (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;
+}