Automatic date update in version.in
[deliverable/binutils-gdb.git] / bfd / aix5ppc-core.c
index 62d11e20169c2e107421487eaacc7a1181dd377b..e22b19a8ead06e5ec56f06176606a56fe360e137 100644 (file)
@@ -1,6 +1,5 @@
 /* IBM RS/6000 "XCOFF" back-end for BFD.
-   Copyright 2001, 2002, 2003, 2004, 2005, 2006
-   Free Software Foundation, Inc.
+   Copyright (C) 2001-2019 Free Software Foundation, Inc.
    Written by Tom Rix
    Contributed by Red Hat Inc.
 
@@ -8,7 +7,7 @@
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2 of the License, or
+   the Free Software Foundation; either version 3 of the License, or
    (at your option) any later version.
 
    This program is distributed in the hope that it will be useful,
@@ -21,6 +20,7 @@
    Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
    MA 02110-1301, USA.  */
 
+#include "sysdep.h"
 #include "bfd.h"
 
 const bfd_target *xcoff64_core_p (bfd *);
@@ -30,7 +30,6 @@ int xcoff64_core_file_failing_signal (bfd *);
 
 #ifdef AIX_5_CORE
 
-#include "sysdep.h"
 #include "libbfd.h"
 
 /* Aix 5.1 system include file.  */
@@ -40,6 +39,10 @@ int xcoff64_core_file_failing_signal (bfd *);
 #include <sys/ldr.h>
 #include <core.h>
 
+/* The default architecture and machine for matching core files.  */
+#define DEFAULT_ARCHITECTURE   bfd_arch_powerpc
+#define DEFAULT_MACHINE                bfd_mach_ppc_620
+
 #define        core_hdr(abfd)          ((struct core_dumpxx *) abfd->tdata.any)
 
 #define CHECK_FILE_OFFSET(s, v) \
@@ -48,6 +51,8 @@ int xcoff64_core_file_failing_signal (bfd *);
 const bfd_target *
 xcoff64_core_p (bfd *abfd)
 {
+  enum bfd_architecture arch;
+  unsigned long mach;
   struct core_dumpxx core, *new_core_hdr;
   struct stat statbuf;
   asection *sec;
@@ -218,6 +223,11 @@ xcoff64_core_p (bfd *abfd)
        }
     }
 
+  /* Set the architecture and machine.  */
+  arch = DEFAULT_ARCHITECTURE;
+  mach = DEFAULT_MACHINE;
+  bfd_default_set_arch_mach (abfd, arch, mach);
+
   return_value = (bfd_target *) abfd->xvec;    /* This is garbage for now.  */
 
  xcoff64_core_p_error:
This page took 0.031985 seconds and 4 git commands to generate.