Automatic date update in version.in
[deliverable/binutils-gdb.git] / bfd / archures.c
index e8873d49687a786b3f6b31302ef77f05c2a248b1..390691bfba17aa076f4c6e940626e8a5dc614bc9 100644 (file)
@@ -1,5 +1,5 @@
 /* BFD library support routines for architectures.
-   Copyright (C) 1990-2019 Free Software Foundation, Inc.
+   Copyright (C) 1990-2021 Free Software Foundation, Inc.
    Hacked by John Gilmore and Steve Chamberlain of Cygnus Support.
 
    This file is part of BFD, the Binary File Descriptor library.
@@ -211,10 +211,6 @@ DESCRIPTION
 .  bfd_arch_k1om,      {* Intel K1OM.  *}
 .#define bfd_mach_k1om                 (1 << 6)
 .#define bfd_mach_k1om_intel_syntax    (bfd_mach_k1om | bfd_mach_i386_intel_syntax)
-.#define bfd_mach_i386_nacl            (1 << 7)
-.#define bfd_mach_i386_i386_nacl       (bfd_mach_i386_i386 | bfd_mach_i386_nacl)
-.#define bfd_mach_x86_64_nacl          (bfd_mach_x86_64 | bfd_mach_i386_nacl)
-.#define bfd_mach_x64_32_nacl          (bfd_mach_x64_32 | bfd_mach_i386_nacl)
 .  bfd_arch_iamcu,     {* Intel MCU.  *}
 .#define bfd_mach_iamcu                        (1 << 8)
 .#define bfd_mach_i386_iamcu           (bfd_mach_i386_i386 | bfd_mach_iamcu)
@@ -232,7 +228,6 @@ DESCRIPTION
 .#define bfd_mach_h8300sx      6
 .#define bfd_mach_h8300sxn     7
 .  bfd_arch_pdp11,     {* DEC PDP-11.  *}
-.  bfd_arch_plugin,
 .  bfd_arch_powerpc,   {* PowerPC.  *}
 .#define bfd_mach_ppc          32
 .#define bfd_mach_ppc64                64
@@ -416,6 +411,7 @@ DESCRIPTION
 .#define bfd_mach_iq10         2
 .  bfd_arch_bpf,       {* Linux eBPF.  *}
 .#define bfd_mach_bpf          1
+.#define bfd_mach_xbpf         2
 .  bfd_arch_epiphany,  {* Adapteva EPIPHANY.  *}
 .#define bfd_mach_epiphany16   1
 .#define bfd_mach_epiphany32   2
@@ -505,10 +501,25 @@ DESCRIPTION
 .  bfd_arch_xtensa,    {* Tensilica's Xtensa cores.  *}
 .#define bfd_mach_xtensa       1
 .  bfd_arch_z80,
-.#define bfd_mach_z80strict    1 {* No undocumented opcodes.  *}
-.#define bfd_mach_z80          3 {* With ixl, ixh, iyl, and iyh.  *}
-.#define bfd_mach_z80full      7 {* All undocumented instructions.  *}
-.#define bfd_mach_r800         11 {* R800: successor with multiplication.  *}
+.{* Zilog Z80 without undocumented opcodes.  *}
+.#define bfd_mach_z80strict    1
+.{* Zilog Z180: successor with additional instructions, but without
+. halves of ix and iy.  *}
+.#define bfd_mach_z180         2
+.{* Zilog Z80 with ixl, ixh, iyl, and iyh.  *}
+.#define bfd_mach_z80          3
+.{* Zilog eZ80 (successor of Z80 & Z180) in Z80 (16-bit address) mode.  *}
+.#define bfd_mach_ez80_z80     4
+.{* Zilog eZ80 (successor of Z80 & Z180) in ADL (24-bit address) mode.  *}
+.#define bfd_mach_ez80_adl     5
+.{* Z80N *}
+.#define bfd_mach_z80n         6
+.{* Zilog Z80 with all undocumented instructions.  *}
+.#define bfd_mach_z80full      7
+.{* GameBoy Z80 (reduced instruction set).  *}
+.#define bfd_mach_gbz80                8
+.{* ASCII R800: successor with multiplication.  *}
+.#define bfd_mach_r800         11
 .  bfd_arch_lm32,      {* Lattice Mico32.  *}
 .#define bfd_mach_lm32         1
 .  bfd_arch_microblaze,{* Xilinx MicroBlaze.  *}
@@ -519,6 +530,7 @@ DESCRIPTION
 .#define bfd_mach_tilegx32     2
 .  bfd_arch_aarch64,   {* AArch64.  *}
 .#define bfd_mach_aarch64 0
+.#define bfd_mach_aarch64_8R   1
 .#define bfd_mach_aarch64_ilp32        32
 .  bfd_arch_nios2,     {* Nios II.  *}
 .#define bfd_mach_nios2                0
@@ -542,6 +554,7 @@ DESCRIPTION
 .#define bfd_mach_ck803                5
 .#define bfd_mach_ck807                6
 .#define bfd_mach_ck810                7
+.#define bfd_mach_ck860                8
 .  bfd_arch_last
 .  };
 */
@@ -568,17 +581,16 @@ DESCRIPTION
 .  {* TRUE if this is the default machine for the architecture.
 .     The default arch should be the first entry for an arch so that
 .     all the entries for that arch can be accessed via <<next>>.  *}
-.  bfd_boolean the_default;
+.  bool the_default;
 .  const struct bfd_arch_info * (*compatible) (const struct bfd_arch_info *,
 .                                             const struct bfd_arch_info *);
 .
-.  bfd_boolean (*scan) (const struct bfd_arch_info *, const char *);
+.  bool (*scan) (const struct bfd_arch_info *, const char *);
 .
 .  {* Allocate via bfd_malloc and return a fill buffer of size COUNT.  If
 .     IS_BIGENDIAN is TRUE, the order of bytes is big endian.  If CODE is
 .     TRUE, the buffer contains code.  *}
-.  void *(*fill) (bfd_size_type count, bfd_boolean is_bigendian,
-.                bfd_boolean code);
+.  void *(*fill) (bfd_size_type count, bool is_bigendian, bool code);
 .
 .  const struct bfd_arch_info *next;
 .
@@ -650,7 +662,6 @@ extern const bfd_arch_info_type bfd_ns32k_arch;
 extern const bfd_arch_info_type bfd_or1k_arch;
 extern const bfd_arch_info_type bfd_pdp11_arch;
 extern const bfd_arch_info_type bfd_pj_arch;
-extern const bfd_arch_info_type bfd_plugin_arch;
 extern const bfd_arch_info_type bfd_powerpc_archs[];
 #define bfd_powerpc_arch bfd_powerpc_archs[0]
 extern const bfd_arch_info_type bfd_pru_arch;
@@ -840,7 +851,7 @@ bfd_arch_list (void)
   const char **name_ptr;
   const char **name_list;
   const bfd_arch_info_type * const *app;
-  bfd_size_type amt;
+  size_t amt;
 
   /* Determine the number of architectures.  */
   vec_length = 0;
@@ -880,7 +891,7 @@ FUNCTION
 
 SYNOPSIS
        const bfd_arch_info_type *bfd_arch_get_compatible
-         (const bfd *abfd, const bfd *bbfd, bfd_boolean accept_unknowns);
+         (const bfd *abfd, const bfd *bbfd, bool accept_unknowns);
 
 DESCRIPTION
        Determine whether two BFDs' architectures and machine types
@@ -893,7 +904,7 @@ DESCRIPTION
 const bfd_arch_info_type *
 bfd_arch_get_compatible (const bfd *abfd,
                         const bfd *bbfd,
-                        bfd_boolean accept_unknowns)
+                        bool accept_unknowns)
 {
   const bfd *ubfd, *kbfd;
 
@@ -934,7 +945,7 @@ DESCRIPTION
 
 const bfd_arch_info_type bfd_default_arch_struct =
 {
-  32, 32, 8, bfd_arch_unknown, 0, "unknown", "unknown", 2, TRUE,
+  32, 32, 8, bfd_arch_unknown, 0, "unknown", "unknown", 2, true,
   bfd_default_compatible,
   bfd_default_scan,
   bfd_arch_default_fill,
@@ -963,7 +974,7 @@ FUNCTION
        bfd_default_set_arch_mach
 
 SYNOPSIS
-       bfd_boolean bfd_default_set_arch_mach
+       bool bfd_default_set_arch_mach
          (bfd *abfd, enum bfd_architecture arch, unsigned long mach);
 
 DESCRIPTION
@@ -973,18 +984,18 @@ DESCRIPTION
        pointer.
 */
 
-bfd_boolean
+bool
 bfd_default_set_arch_mach (bfd *abfd,
                           enum bfd_architecture arch,
                           unsigned long mach)
 {
   abfd->arch_info = bfd_lookup_arch (arch, mach);
   if (abfd->arch_info != NULL)
-    return TRUE;
+    return true;
 
   abfd->arch_info = &bfd_default_arch_struct;
   bfd_set_error (bfd_error_bad_value);
-  return FALSE;
+  return false;
 }
 
 /*
@@ -1095,7 +1106,7 @@ INTERNAL_FUNCTION
        bfd_default_scan
 
 SYNOPSIS
-       bfd_boolean bfd_default_scan
+       bool bfd_default_scan
          (const struct bfd_arch_info *info, const char *string);
 
 DESCRIPTION
@@ -1103,7 +1114,7 @@ DESCRIPTION
        architecture hit and a machine hit.
 */
 
-bfd_boolean
+bool
 bfd_default_scan (const bfd_arch_info_type *info, const char *string)
 {
   const char *ptr_src;
@@ -1116,11 +1127,11 @@ bfd_default_scan (const bfd_arch_info_type *info, const char *string)
      default architecture?  */
   if (strcasecmp (string, info->arch_name) == 0
       && info->the_default)
-    return TRUE;
+    return true;
 
   /* Exact match of the machine name (PRINTABLE_NAME)?  */
   if (strcasecmp (string, info->printable_name) == 0)
-    return TRUE;
+    return true;
 
   /* Given that printable_name contains no colon, attempt to match:
      ARCH_NAME [ ":" ] PRINTABLE_NAME?  */
@@ -1134,13 +1145,13 @@ bfd_default_scan (const bfd_arch_info_type *info, const char *string)
            {
              if (strcasecmp (string + strlen_arch_name + 1,
                              info->printable_name) == 0)
-               return TRUE;
+               return true;
            }
          else
            {
              if (strcasecmp (string + strlen_arch_name,
                              info->printable_name) == 0)
-               return TRUE;
+               return true;
            }
        }
     }
@@ -1153,7 +1164,7 @@ bfd_default_scan (const bfd_arch_info_type *info, const char *string)
       if (strncasecmp (string, info->printable_name, colon_index) == 0
          && strcasecmp (string + colon_index,
                         info->printable_name + colon_index + 1) == 0)
-       return TRUE;
+       return true;
     }
 
   /* Given that PRINTABLE_NAME has the form: <arch> ":" <mach>; Do not
@@ -1283,16 +1294,16 @@ bfd_default_scan (const bfd_arch_info_type *info, const char *string)
       break;
 
     default:
-      return FALSE;
+      return false;
     }
 
   if (arch != info->arch)
-    return FALSE;
+    return false;
 
   if (number != info->mach)
-    return FALSE;
+    return false;
 
-  return TRUE;
+  return true;
 }
 
 /*
@@ -1429,8 +1440,8 @@ INTERNAL_FUNCTION
 
 SYNOPSIS
        void *bfd_arch_default_fill (bfd_size_type count,
-                                    bfd_boolean is_bigendian,
-                                    bfd_boolean code);
+                                    bool is_bigendian,
+                                    bool code);
 
 DESCRIPTION
        Allocate via bfd_malloc and return a fill buffer of size COUNT.
@@ -1440,8 +1451,8 @@ DESCRIPTION
 
 void *
 bfd_arch_default_fill (bfd_size_type count,
-                      bfd_boolean is_bigendian ATTRIBUTE_UNUSED,
-                      bfd_boolean code ATTRIBUTE_UNUSED)
+                      bool is_bigendian ATTRIBUTE_UNUSED,
+                      bool code ATTRIBUTE_UNUSED)
 {
   void *fill = bfd_malloc (count);
   if (fill != NULL)
@@ -1449,7 +1460,7 @@ bfd_arch_default_fill (bfd_size_type count,
   return fill;
 }
 
-bfd_boolean
+bool
 _bfd_nowrite_set_arch_mach (bfd *abfd,
                            enum bfd_architecture arch ATTRIBUTE_UNUSED,
                            unsigned long mach ATTRIBUTE_UNUSED)
This page took 0.028185 seconds and 4 git commands to generate.