]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blobdiff - bfd/cpu-aarch64.c
Update year range in copyright notice of binutils files
[thirdparty/binutils-gdb.git] / bfd / cpu-aarch64.c
index 81620371ffedd8b2af154ebce5b70013ed2c9983..869fac2173372bc3de82210f3c465371905972a2 100644 (file)
@@ -1,5 +1,5 @@
 /* BFD support for AArch64.
-   Copyright 2009, 2010, 2011, 2012  Free Software Foundation, Inc.
+   Copyright (C) 2009-2021 Free Software Foundation, Inc.
    Contributed by ARM Ltd.
 
    This file is part of BFD, the Binary File Descriptor library.
@@ -22,6 +22,7 @@
 #include "bfd.h"
 #include "libbfd.h"
 #include "libiberty.h"
+#include "cpu-aarch64.h"
 
 /* This routine is provided two arch_infos and works out which Aarch64
    machine which would be compatible with both and returns a pointer
@@ -38,6 +39,10 @@ compatible (const bfd_arch_info_type * a, const bfd_arch_info_type * b)
   if (a->mach == b->mach)
     return a;
 
+  /* Don't allow mixing ilp32 with lp64.  */
+  if ((a->mach & bfd_mach_aarch64_ilp32) != (b->mach & bfd_mach_aarch64_ilp32))
+    return NULL;
+
   /* Otherwise if either a or b is the 'default' machine
      then it can be polymorphed into the other.  */
   if (a->the_default)
@@ -64,10 +69,11 @@ static struct
 }
 processors[] =
 {
-  /* These two are example CPUs supported in GCC, once we have real
-     CPUs they will be removed.  */
-  { bfd_mach_aarch64, "example-1" },
-  { bfd_mach_aarch64, "example-2" }
+  { bfd_mach_aarch64,    "cortex-a34"      },
+  { bfd_mach_aarch64,    "cortex-a65"      },
+  { bfd_mach_aarch64,    "cortex-a65ae"    },
+  { bfd_mach_aarch64,    "cortex-a76ae"    },
+  { bfd_mach_aarch64,    "cortex-a77"      }
 };
 
 static bfd_boolean
@@ -96,14 +102,20 @@ scan (const struct bfd_arch_info *info, const char *string)
   return FALSE;
 }
 
-#define N(NUMBER, PRINT, DEFAULT, NEXT)                                \
-  { 64, 64, 8, bfd_arch_aarch64, NUMBER,                       \
+#define N(NUMBER, PRINT, WORDSIZE, DEFAULT, NEXT)              \
+  { WORDSIZE, WORDSIZE, 8, bfd_arch_aarch64, NUMBER,           \
     "aarch64", PRINT, 4, DEFAULT, compatible, scan,            \
-    bfd_arch_default_fill, NEXT }
+      bfd_arch_default_fill, NEXT, 0 }
 
-const bfd_arch_info_type bfd_aarch64_arch =
-  N (0, "aarch64", TRUE, NULL);
+static const bfd_arch_info_type bfd_aarch64_arch_v8_r =
+  N (bfd_mach_aarch64_8R, "aarch64:armv8-r", 64, FALSE, NULL);
 
+static const bfd_arch_info_type bfd_aarch64_arch_ilp32 =
+  N (bfd_mach_aarch64_ilp32, "aarch64:ilp32", 32, FALSE,
+     &bfd_aarch64_arch_v8_r);
+
+const bfd_arch_info_type bfd_aarch64_arch =
+  N (0, "aarch64", 64, TRUE, &bfd_aarch64_arch_ilp32);
 
 bfd_boolean
 bfd_is_aarch64_special_symbol_name (const char *name, int type)