Enhance the disassembler so that it will reliably determine whether a reloc applies...
authorNick Clifton <nickc@redhat.com>
Tue, 10 Sep 2019 14:20:58 +0000 (15:20 +0100)
committerNick Clifton <nickc@redhat.com>
Tue, 10 Sep 2019 14:20:58 +0000 (15:20 +0100)
PR 24907
binutils* objdump.c (null_print): New function.
(disassemble_bytes): Delete previous_octets local and replace with
a test of the max_reloc_offset_into_insn field of the
bfd_arch_info structure.  If a reloc is a potential match for the
next insn, then perform a dummy disassembly in order to calculate
its real length.

bfd * archures.c (bfd_arch_info_type): Add max_reloc_offset_into_insn
field.
(bfd_default_arch_struct): Initialise the new field.
* bfd-in2.h: Regenerate.
* cpu-aarch64.c: Initialise the new field.
* cpu-alpha.c: Likewise.
* cpu-arc.c: Likewise.
* cpu-arm.c: Likewise.
* cpu-avr.c: Likewise.
* cpu-bfin.c: Likewise.
* cpu-bpf.c: Likewise.
* cpu-cr16.c: Likewise.
* cpu-cr16c.c: Likewise.
* cpu-cris.c: Likewise.
* cpu-crx.c: Likewise.
* cpu-csky.c: Likewise.
* cpu-d10v.c: Likewise.
* cpu-d30v.c: Likewise.
* cpu-dlx.c: Likewise.
* cpu-epiphany.c: Likewise.
* cpu-fr30.c: Likewise.
* cpu-frv.c: Likewise.
* cpu-ft32.c: Likewise.
* cpu-h8300.c: Likewise.
* cpu-hppa.c: Likewise.
* cpu-i386.c: Likewise.
* cpu-ia64.c: Likewise.
* cpu-iamcu.c: Likewise.
* cpu-ip2k.c: Likewise.
* cpu-iq2000.c: Likewise.
* cpu-k1om.c: Likewise.
* cpu-l1om.c: Likewise.
* cpu-lm32.c: Likewise.
* cpu-m10200.c: Likewise.
* cpu-m10300.c: Likewise.
* cpu-m32c.c: Likewise.
* cpu-m32r.c: Likewise.
* cpu-m68hc11.c: Likewise.
* cpu-m68hc12.c: Likewise.
* cpu-m68k.c: Likewise.
* cpu-m9s12x.c: Likewise.
* cpu-m9s12xg.c: Likewise.
* cpu-mcore.c: Likewise.
* cpu-mep.c: Likewise.
* cpu-metag.c: Likewise.
* cpu-microblaze.c: Likewise.
* cpu-mips.c: Likewise.
* cpu-mmix.c: Likewise.
* cpu-moxie.c: Likewise.
* cpu-msp430.c: Likewise.
* cpu-mt.c: Likewise.
* cpu-nds32.c: Likewise.
* cpu-nfp.c: Likewise.
* cpu-nios2.c: Likewise.
* cpu-ns32k.c: Likewise.
* cpu-or1k.c: Likewise.
* cpu-pdp11.c: Likewise.
* cpu-pj.c: Likewise.
* cpu-plugin.c: Likewise.
* cpu-powerpc.c: Likewise.
* cpu-pru.c: Likewise.
* cpu-riscv.c: Likewise.
* cpu-rl78.c: Likewise.
* cpu-rs6000.c: Likewise.
* cpu-rx.c: Likewise.
* cpu-s12z.c: Likewise.
* cpu-s390.c: Likewise.
* cpu-score.c: Likewise.
* cpu-sh.c: Likewise.
* cpu-sparc.c: Likewise.
* cpu-spu.c: Likewise.
* cpu-tic30.c: Likewise.
* cpu-tic4x.c: Likewise.
* cpu-tic54x.c: Likewise.
* cpu-tic6x.c: Likewise.
* cpu-tic80.c: Likewise.
* cpu-tilegx.c: Likewise.
* cpu-tilepro.c: Likewise.
* cpu-v850.c: Likewise.
* cpu-v850_rh850.c: Likewise.
* cpu-vax.c: Likewise.
* cpu-visium.c: Likewise.
* cpu-wasm32.c: Likewise.
* cpu-xc16x.c: Likewise.
* cpu-xgate.c: Likewise.
* cpu-xstormy16.c: Likewise.
* cpu-xtensa.c: Likewise.
* cpu-z80.c: Likewise.
* cpu-z8k.c: Likewise.

gas * testsuite/gas/arm/pr24907.s: New test.
* testsuite/gas/arm/pr24907.d: Expected disassembly.

93 files changed:
bfd/ChangeLog
bfd/archures.c
bfd/bfd-in2.h
bfd/cpu-aarch64.c
bfd/cpu-alpha.c
bfd/cpu-arc.c
bfd/cpu-arm.c
bfd/cpu-avr.c
bfd/cpu-bfin.c
bfd/cpu-bpf.c
bfd/cpu-cr16.c
bfd/cpu-cr16c.c
bfd/cpu-cris.c
bfd/cpu-crx.c
bfd/cpu-csky.c
bfd/cpu-d10v.c
bfd/cpu-d30v.c
bfd/cpu-dlx.c
bfd/cpu-epiphany.c
bfd/cpu-fr30.c
bfd/cpu-frv.c
bfd/cpu-ft32.c
bfd/cpu-h8300.c
bfd/cpu-hppa.c
bfd/cpu-i386.c
bfd/cpu-ia64.c
bfd/cpu-iamcu.c
bfd/cpu-ip2k.c
bfd/cpu-iq2000.c
bfd/cpu-k1om.c
bfd/cpu-l1om.c
bfd/cpu-lm32.c
bfd/cpu-m10200.c
bfd/cpu-m10300.c
bfd/cpu-m32c.c
bfd/cpu-m32r.c
bfd/cpu-m68hc11.c
bfd/cpu-m68hc12.c
bfd/cpu-m68k.c
bfd/cpu-m9s12x.c
bfd/cpu-m9s12xg.c
bfd/cpu-mcore.c
bfd/cpu-mep.c
bfd/cpu-metag.c
bfd/cpu-microblaze.c
bfd/cpu-mips.c
bfd/cpu-mmix.c
bfd/cpu-moxie.c
bfd/cpu-msp430.c
bfd/cpu-mt.c
bfd/cpu-nds32.c
bfd/cpu-nfp.c
bfd/cpu-nios2.c
bfd/cpu-ns32k.c
bfd/cpu-or1k.c
bfd/cpu-pdp11.c
bfd/cpu-pj.c
bfd/cpu-plugin.c
bfd/cpu-powerpc.c
bfd/cpu-pru.c
bfd/cpu-riscv.c
bfd/cpu-rl78.c
bfd/cpu-rs6000.c
bfd/cpu-rx.c
bfd/cpu-s12z.c
bfd/cpu-s390.c
bfd/cpu-score.c
bfd/cpu-sh.c
bfd/cpu-sparc.c
bfd/cpu-spu.c
bfd/cpu-tic30.c
bfd/cpu-tic4x.c
bfd/cpu-tic54x.c
bfd/cpu-tic6x.c
bfd/cpu-tic80.c
bfd/cpu-tilegx.c
bfd/cpu-tilepro.c
bfd/cpu-v850.c
bfd/cpu-v850_rh850.c
bfd/cpu-vax.c
bfd/cpu-visium.c
bfd/cpu-wasm32.c
bfd/cpu-xc16x.c
bfd/cpu-xgate.c
bfd/cpu-xstormy16.c
bfd/cpu-xtensa.c
bfd/cpu-z80.c
bfd/cpu-z8k.c
binutils/ChangeLog
binutils/objdump.c
gas/ChangeLog
gas/testsuite/gas/arm/pr24907.d [new file with mode: 0644]
gas/testsuite/gas/arm/pr24907.s [new file with mode: 0644]

index aca3c80a2b3df248964359be78e3b540e365c649..8b6b843a6f58de46d47db78c868e39a0e6459bee 100644 (file)
@@ -1,3 +1,96 @@
+2019-09-10  Nick Clifton  <nickc@redhat.com>
+
+       PR 24907
+       * archures.c (bfd_arch_info_type): Add max_reloc_offset_into_insn
+       field.
+       (bfd_default_arch_struct): Initialise the new field.
+       * bfd-in2.h: Regenerate.
+       * cpu-aarch64.c: Initialise the new field.
+       * cpu-alpha.c: Likewise.
+       * cpu-arc.c: Likewise.
+       * cpu-arm.c: Likewise.
+       * cpu-avr.c: Likewise.
+       * cpu-bfin.c: Likewise.
+       * cpu-bpf.c: Likewise.
+       * cpu-cr16.c: Likewise.
+       * cpu-cr16c.c: Likewise.
+       * cpu-cris.c: Likewise.
+       * cpu-crx.c: Likewise.
+       * cpu-csky.c: Likewise.
+       * cpu-d10v.c: Likewise.
+       * cpu-d30v.c: Likewise.
+       * cpu-dlx.c: Likewise.
+       * cpu-epiphany.c: Likewise.
+       * cpu-fr30.c: Likewise.
+       * cpu-frv.c: Likewise.
+       * cpu-ft32.c: Likewise.
+       * cpu-h8300.c: Likewise.
+       * cpu-hppa.c: Likewise.
+       * cpu-i386.c: Likewise.
+       * cpu-ia64.c: Likewise.
+       * cpu-iamcu.c: Likewise.
+       * cpu-ip2k.c: Likewise.
+       * cpu-iq2000.c: Likewise.
+       * cpu-k1om.c: Likewise.
+       * cpu-l1om.c: Likewise.
+       * cpu-lm32.c: Likewise.
+       * cpu-m10200.c: Likewise.
+       * cpu-m10300.c: Likewise.
+       * cpu-m32c.c: Likewise.
+       * cpu-m32r.c: Likewise.
+       * cpu-m68hc11.c: Likewise.
+       * cpu-m68hc12.c: Likewise.
+       * cpu-m68k.c: Likewise.
+       * cpu-m9s12x.c: Likewise.
+       * cpu-m9s12xg.c: Likewise.
+       * cpu-mcore.c: Likewise.
+       * cpu-mep.c: Likewise.
+       * cpu-metag.c: Likewise.
+       * cpu-microblaze.c: Likewise.
+       * cpu-mips.c: Likewise.
+       * cpu-mmix.c: Likewise.
+       * cpu-moxie.c: Likewise.
+       * cpu-msp430.c: Likewise.
+       * cpu-mt.c: Likewise.
+       * cpu-nds32.c: Likewise.
+       * cpu-nfp.c: Likewise.
+       * cpu-nios2.c: Likewise.
+       * cpu-ns32k.c: Likewise.
+       * cpu-or1k.c: Likewise.
+       * cpu-pdp11.c: Likewise.
+       * cpu-pj.c: Likewise.
+       * cpu-plugin.c: Likewise.
+       * cpu-powerpc.c: Likewise.
+       * cpu-pru.c: Likewise.
+       * cpu-riscv.c: Likewise.
+       * cpu-rl78.c: Likewise.
+       * cpu-rs6000.c: Likewise.
+       * cpu-rx.c: Likewise.
+       * cpu-s12z.c: Likewise.
+       * cpu-s390.c: Likewise.
+       * cpu-score.c: Likewise.
+       * cpu-sh.c: Likewise.
+       * cpu-sparc.c: Likewise.
+       * cpu-spu.c: Likewise.
+       * cpu-tic30.c: Likewise.
+       * cpu-tic4x.c: Likewise.
+       * cpu-tic54x.c: Likewise.
+       * cpu-tic6x.c: Likewise.
+       * cpu-tic80.c: Likewise.
+       * cpu-tilegx.c: Likewise.
+       * cpu-tilepro.c: Likewise.
+       * cpu-v850.c: Likewise.
+       * cpu-v850_rh850.c: Likewise.
+       * cpu-vax.c: Likewise.
+       * cpu-visium.c: Likewise.
+       * cpu-wasm32.c: Likewise.
+       * cpu-xc16x.c: Likewise.
+       * cpu-xgate.c: Likewise.
+       * cpu-xstormy16.c: Likewise.
+       * cpu-xtensa.c: Likewise.
+       * cpu-z80.c: Likewise.
+       * cpu-z8k.c: Likewise.
+
 2019-09-09  Phil Blundell  <pb@pbcl.net>
 
        binutils 2.33 branch created.
index 3465406213f5c2c13710a59d7fc014d2c4d2665a..02c8e4ec93e822746c728ec2dd413e65601064d8 100644 (file)
@@ -584,6 +584,16 @@ DESCRIPTION
 .                bfd_boolean code);
 .
 .  const struct bfd_arch_info *next;
+.
+.  {* On some architectures the offset for a relocation can point into
+.     the middle of an instruction.  This field specifies the maximum
+.     offset such a relocation can have (in octets).  This affects the
+.     behaviour of the disassembler, since a value greater than zero
+.     means that it may need to disassemble an instruction twice, once
+.     to get its length and then a second time to display it.  If the
+.     value is negative then this has to be done for every single
+.     instruction, regardless of the offset of the reloc.  *}
+.  signed int max_reloc_offset_into_insn;
 .}
 .bfd_arch_info_type;
 .
@@ -929,12 +939,13 @@ DESCRIPTION
 .extern const bfd_arch_info_type bfd_default_arch_struct;
 */
 
-const bfd_arch_info_type bfd_default_arch_struct = {
+const bfd_arch_info_type bfd_default_arch_struct =
+{
   32, 32, 8, bfd_arch_unknown, 0, "unknown", "unknown", 2, TRUE,
   bfd_default_compatible,
   bfd_default_scan,
   bfd_arch_default_fill,
-  0,
+  0, 0
 };
 
 /*
index 7b1cfbcf1a27951fb1b3a212995075dd6fdf985b..690ba9a6fdbc838596ac8fb2679a952c4b037c79 100644 (file)
@@ -2514,6 +2514,16 @@ typedef struct bfd_arch_info
                  bfd_boolean code);
 
   const struct bfd_arch_info *next;
+
+  /* On some architectures the offset for a relocation can point into
+     the middle of an instruction.  This field specifies the maximum
+     offset such a relocation can have (in octets).  This affects the
+     behaviour of the disassembler, since a value greater than zero
+     means that it may need to disassemble an instruction twice, once
+     to get its length and then a second time to display it.  If the
+     value is negative then this has to be done for every single
+     instruction, regardless of the offset of the reloc.  */
+  signed int max_reloc_offset_into_insn;
 }
 bfd_arch_info_type;
 
index eed1c3d9dcdaae5334792a153acb0599505523ec..fbffb79b639a525965ffae968fe043a64cebef32 100644 (file)
@@ -104,7 +104,7 @@ scan (const struct bfd_arch_info *info, const char *string)
 #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 }
 
 static const bfd_arch_info_type bfd_aarch64_arch_ilp32 =
   N (bfd_mach_aarch64_ilp32, "aarch64:ilp32", 32, FALSE, NULL);
index 06ce01dd4127b91ecd591d74fc4868f0c92b280c..c4221d86bced2518b96de206d96f9c1d5877f94d 100644 (file)
 
 #define N(BITS_WORD, BITS_ADDR, NUMBER, PRINT, DEFAULT, NEXT) \
   {                                                    \
-    BITS_WORD, /* bits in a word */                    \
-    BITS_ADDR, /* bits in an address */                        \
-    8, /* 8 bits in a byte */                          \
+    BITS_WORD, /* Bits in a word.  */                  \
+    BITS_ADDR, /* Bits in an address.  */              \
+    8,        /* Bits in a byte.  */                   \
     bfd_arch_alpha,                                    \
     NUMBER,                                            \
     "alpha",                                           \
     PRINT,                                             \
-    3,                                                 \
+    3,         /* Section alignment power. */          \
     DEFAULT,                                           \
     bfd_default_compatible,                            \
     bfd_default_scan,                                  \
     bfd_arch_default_fill,                             \
     NEXT,                                              \
+    0 /* Maximum offset of a reloc from the start of an insn.  */ \
   }
 
 #define NN(index) (&arch_info_struct[index])
index e6f102b4e73f88d71489eb925fb18e2f84f3c768..906ca1d8743a106d781137a9076ba76168a0ef59 100644 (file)
@@ -27,20 +27,21 @@ static const bfd_arch_info_type *
 arc_compatible (const bfd_arch_info_type *a, const bfd_arch_info_type *b);
 
 #define ARC(mach, print_name, default_p, next) \
-{                                      \
-    32,        /* 32 bits in a word  */        \
-    32,        /* 32 bits in an address  */    \
-    8, /* 8 bits in a byte  */         \
+  {                                           \
+    32,        /* Bits in a word.  */          \
+    32,        /* Bits in an address.  */      \
+    8, /* Bits in a byte.  */          \
     bfd_arch_arc,                      \
     mach,                              \
     "arc",                             \
     print_name,                                \
-    4, /* section alignment power  */  \
+    4, /* Section alignment power.  */ \
     default_p,                         \
     arc_compatible,                    \
     bfd_default_scan,                  \
     bfd_arch_default_fill,             \
     next,                              \
+    0 /* Maximum offset of a reloc from the start of an insn.  */ \
   }
 
 static const bfd_arch_info_type arch_info_struct[] =
index 8d70b84b8b69f6db47bf65bfea29cfd833f74846..71a78daf1196c86e3bd9ac4959b7881390110f09 100644 (file)
@@ -221,7 +221,7 @@ scan (const struct bfd_arch_info *info, const char *string)
 
 #define N(number, print, default, next)  \
 {  32, 32, 8, bfd_arch_arm, number, "arm", print, 4, default, compatible, \
-   scan, bfd_arch_default_fill, next }
+    scan, bfd_arch_default_fill, next, 0 }
 
 static const bfd_arch_info_type arch_info_struct[] =
 {
index a8b341ead8eb28928ddd47c0bfc9ec93e4a82170..621c48bba975b327426909a084076517c5d1abc5 100644 (file)
@@ -82,9 +82,9 @@ compatible (const bfd_arch_info_type * a,
 
 #define N(addr_bits, machine, print, default, next)            \
 {                                                              \
-  8,                           /* 8 bits in a word.  */        \
-  addr_bits,                   /* bits in an address.  */      \
-  8,                           /* 8 bits in a byte.  */        \
+  8,                           /* Bits in a word.  */          \
+  addr_bits,                   /* Bits in an address.  */      \
+  8,                           /* Bits in a byte.  */          \
   bfd_arch_avr,                                                        \
   machine,                     /* Machine number.  */          \
   "avr",                       /* Architecture name.   */      \
@@ -94,7 +94,8 @@ compatible (const bfd_arch_info_type * a,
   compatible,                                                  \
   bfd_default_scan,                                            \
   bfd_arch_default_fill,                                       \
-  next                                                         \
+  next,                                                                \
+  0 /* Maximum offset of a reloc from the start of an insn.  */        \
 }
 
 static const bfd_arch_info_type arch_info_struct[] =
index 51b170ac78899597eb5b0355d3b19393eabf65bf..03f388e9b035e6656d3e7c84e8a8ac7da53a7e66 100644 (file)
@@ -37,5 +37,6 @@ const bfd_arch_info_type bfd_bfin_arch =
     bfd_default_compatible,
     bfd_default_scan,
     bfd_arch_default_fill,
-    0,
+    NULL,
+    0 /* Maximum offset of a reloc from the start of an insn.  */
   };
index 57fe7d75026e00045b7cbc6c851cc6c3895d8711..4d92ca4e4f86387aefd2210fd75c3c59e5afb12a 100644 (file)
@@ -25,7 +25,7 @@
 
 const bfd_arch_info_type bfd_bpf_arch =
 {
-  64,                          /* Bits per word */
+  64,                          /* Bits per word */
   64,                          /* Bits per address.  */
   8,                           /* Bits per byte.  */
   bfd_arch_bpf,                        /* Architecture.  */
@@ -37,5 +37,6 @@ const bfd_arch_info_type bfd_bpf_arch =
   bfd_default_compatible,      /* Architecture comparison fn.  */
   bfd_default_scan,            /* String to architecture convert fn.  */
   bfd_arch_default_fill,       /* Default fill.  */
-  NULL                         /* Next in list.  */
+  NULL,                                /* Next in list.  */
+  0 /* Maximum offset of a reloc from the start of an insn.  */
 };
index 04db29efb64f351111e425b6ef0f264effe4890f..bd3bfb32b6ad9dbbf16e45d0b193bf4da45d55d2 100644 (file)
 
 
 const bfd_arch_info_type bfd_cr16_arch =
-  {
-    16,                      /* 16 bits in a word.  */
-    32,                      /* 32 bits in an address.  */
-    8,               /*  8 bits in a byte.  */
-    bfd_arch_cr16,    /* enum bfd_architecture arch.  */
-    bfd_mach_cr16,
-    "cr16",          /* Arch name.  */
-    "cr16",          /* Printable name.  */
-    1,               /* Unsigned int section alignment power.  */
-    TRUE,            /* The one and only.  */
-    bfd_default_compatible,
-    bfd_default_scan,
-    bfd_arch_default_fill,
-    0,
-  };
+{
+ 16,                 /* Bits in a word.  */
+ 32,                 /* Bits in an address.  */
+ 8,                  /* Bits in a byte.  */
+ bfd_arch_cr16,       /* Architecture number.  */
+ bfd_mach_cr16,
+ "cr16",             /* Arch name.  */
+ "cr16",             /* Printable name.  */
+ 1,                  /* Section alignment power.  */
+ TRUE,               /* The one and only.  */
+ bfd_default_compatible,
+ bfd_default_scan,
+ bfd_arch_default_fill,
+ NULL,
+ 0 /* Maximum offset of a reloc from the start of an insn.  */
+};
index b963b26579b099e267a5b0969373e5da61e1aad5..ed4a818971871ba1f598545cab88b71186460502 100644 (file)
 #include "libbfd.h"
 
 const bfd_arch_info_type bfd_cr16c_arch =
-  {
-    16,                /* 16 bits in a word.  */
-    32,                /* 32 bits in an address.  */
-    8,         /*  8 bits in a byte.  */
-    bfd_arch_cr16c,
-    bfd_mach_cr16c,
-    "cr16c",
-    "cr16c",
-    1,
-    TRUE,      /* The one and only.  */
-    bfd_default_compatible,
-    bfd_default_scan,
-    bfd_arch_default_fill,
-    0,
-  };
+{
+  16,          /* Bits in a word.  */
+  32,          /* Bits in an address.  */
+  8,           /* Bits in a byte.  */
+  bfd_arch_cr16c,
+  bfd_mach_cr16c,
+  "cr16c",
+  "cr16c",
+  1,
+  TRUE,                /* The one and only.  */
+  bfd_default_compatible,
+  bfd_default_scan,
+  bfd_arch_default_fill,
+  NULL,
+  0 /* Maximum offset of a reloc from the start of an insn.  */
+};
index c3e404181e813ac555e87d830fb0e7e38fb7c69a..c6b819f2405382d37746fa5c50370218b7cc7021 100644 (file)
@@ -67,7 +67,7 @@ get_compatible (const bfd_arch_info_type *a,
 
 #define N(NUMBER, PRINT, NEXT)  \
  { 32, 32, 8, bfd_arch_cris, NUMBER, "cris", PRINT, 1, FALSE, \
-   get_compatible, bfd_default_scan, bfd_arch_default_fill, NEXT }
+     get_compatible, bfd_default_scan, bfd_arch_default_fill, NEXT, 0 }
 
 static const bfd_arch_info_type bfd_cris_arch_compat_v10_v32 =
  N (bfd_mach_cris_v10_v32, "cris:common_v10_v32", NULL);
@@ -97,8 +97,9 @@ const bfd_arch_info_type bfd_cris_arch =
   bfd_default_scan,            /* Check if a bfd_arch_info_type is a
                                   match.  */
   bfd_arch_default_fill,       /* Default fill.  */
-  &bfd_cris_arch_v32           /* Pointer to next bfd_arch_info_type in
+  &bfd_cris_arch_v32,          /* Pointer to next bfd_arch_info_type in
                                   the same family.  */
+  0 /* Maximum offset of a reloc from the start of an insn.  */
 };
 
 /*
index cc8420fd4b2b12b2aad81d400478eb0ff93f6cab..d181edb56ba1ae6892bf89b63951223a655e0cbd 100644 (file)
 
 
 const bfd_arch_info_type bfd_crx_arch =
-  {
-    16,                /* 16 bits in a word.  */
-    32,                /* 32 bits in an address.  */
-    8,         /*  8 bits in a byte.  */
-    bfd_arch_crx, /* enum bfd_architecture arch.  */
-    bfd_mach_crx,
-    "crx",     /* Arch name.  */
-    "crx",     /* Printable name.  */
-    1,         /* Unsigned int section alignment power.  */
-    TRUE,      /* The one and only.  */
-    bfd_default_compatible,
-    bfd_default_scan,
-    bfd_arch_default_fill,
-    0,
-  };
+{
+  16,          /* Bits in a word.  */
+  32,          /* Bits in an address.  */
+  8,           /* Bits in a byte.  */
+  bfd_arch_crx, /* Architecture number.  */
+  bfd_mach_crx,
+  "crx",       /* Arch name.  */
+  "crx",       /* Printable name.  */
+  1,           /* Section alignment power.  */
+  TRUE,                /* The one and only.  */
+  bfd_default_compatible,
+  bfd_default_scan,
+  bfd_arch_default_fill,
+  NULL,
+  0 /* Maximum offset of a reloc from the start of an insn.  */
+};
index 1bde70e035f3a001d263bf32291945ad828633ec..463dce564fb2903cc2d53ccff0acd8acab1cec22 100644 (file)
 #include "bfd.h"
 #include "libbfd.h"
 
-#define N(NUMBER, PRINT, ISDEFAULT, NEXT)  \
-{                                                                      \
-  32,                     /* 32 bits in a word */                      \
-  32,                     /* 32 bits in an address */                  \
-  8,                      /* 8 bits in a byte */                       \
-  bfd_arch_csky,          /* Architecture */                           \
-  NUMBER,                 /* Machine number */                         \
-  "csky",                 /* Architecture name */                      \
-  PRINT,                  /* Printable name */                         \
-  3,                      /* Section align power */                    \
-  ISDEFAULT,              /* Is this the default architecture ? */     \
-  bfd_default_compatible, /* Architecture comparison function */       \
-  bfd_default_scan,       /* String to architecture conversion */      \
-  bfd_arch_default_fill,                                               \
-  NEXT                    /* Next in list */                           \
+#define N(NUMBER, PRINT, ISDEFAULT, NEXT)                              \
+{                                                                       \
+  32,                     /* Bits in a word.  */                        \
+  32,                     /* Bits in an address.  */                    \
+  8,                      /* Bits in a byte.  */                        \
+  bfd_arch_csky,          /* Architecture.  */                          \
+  NUMBER,                 /* Machine number.  */                        \
+  "csky",                 /* Architecture name.  */                     \
+  PRINT,                  /* Printable name.  */                        \
+  3,                      /* Section align power.  */                   \
+  ISDEFAULT,              /* Is this the default architecture ?  */    \
+  bfd_default_compatible, /* Architecture comparison function.  */     \
+  bfd_default_scan,       /* String to architecture conversion.  */    \
+  bfd_arch_default_fill,                                               \
+  NEXT,                   /* Next in list.  */                         \
+  0 /* Maximum offset of a reloc from the start of an insn.  */                \
 }
 
 static const bfd_arch_info_type arch_info_struct[] =
index b6ebe495a67cced0989b806ce258fd641aee74d1..f78fe88435cf5573725728ba2a7e11aa0dc761c6 100644 (file)
 #include "bfd.h"
 #include "libbfd.h"
 
+#define N(NUMBER, PRINT, DEFAULT, NEXT)                        \
+  {                                                    \
+    16,         /* Bits in a word.  */                 \
+    18,         /* Bits in an address.  */             \
+    8,         /* Bits in a byte.  */                  \
+    bfd_arch_d10v,                                     \
+    NUMBER,                                            \
+    "d10v",                                            \
+    PRINT,                                             \
+    4,         /* Section alignment power.  */         \
+    DEFAULT,                                           \
+    bfd_default_compatible,                            \
+    bfd_default_scan,                                  \
+    bfd_arch_default_fill,                             \
+    NEXT,                                              \
+    0 /* Maximum offset of a reloc from the start of an insn.  */ \
+  }
+
 static const bfd_arch_info_type d10v_ts3_info =
-{
-  16,  /* 16 bits in a word.  */
-  18,  /* really 16 bits in an address, but code has 18 bit range.  */
-  8,   /* 8 bits in a byte.  */
-  bfd_arch_d10v,
-  bfd_mach_d10v_ts3,
-  "d10v",
-  "d10v:ts3",
-  4,   /* Section alignment power.  */
-  FALSE,
-  bfd_default_compatible,
-  bfd_default_scan,
-  bfd_arch_default_fill,
-  0,
-};
+  N (bfd_mach_d10v_ts3, "d10v:ts3", FALSE, NULL);
 
 static const bfd_arch_info_type d10v_ts2_info =
-{
-  16,
-  18,
-  8,
-  bfd_arch_d10v,
-  bfd_mach_d10v_ts2,
-  "d10v",
-  "d10v:ts2",
-  4,
-  FALSE,
-  bfd_default_compatible,
-  bfd_default_scan,
-  bfd_arch_default_fill,
-  & d10v_ts3_info,
-};
+  N (bfd_mach_d10v_ts2, "d10v:ts2", FALSE, & d10v_ts3_info);
 
 const bfd_arch_info_type bfd_d10v_arch =
-{
-  16,
-  18,
-  8,
-  bfd_arch_d10v,
-  bfd_mach_d10v,
-  "d10v",
-  "d10v",
-  4,
-  TRUE,
-  bfd_default_compatible,
-  bfd_default_scan,
-  bfd_arch_default_fill,
-  & d10v_ts2_info,
-};
+  N (bfd_mach_d10v, "d10v", TRUE, & d10v_ts2_info);
index 1e5f553c88e5b2b69050fa3ea7e774f7f9e971e8..f987f1c4bfb7c88f9a4d83f0a05e254911aa99b0 100644 (file)
 
 const bfd_arch_info_type bfd_d30v_arch =
 {
-    32,        /* Bits in a word.  */
-    32,        /* Bits in an address.  */
-    8, /* Bits in a byte.  */
-    bfd_arch_d30v,
-    0,
-    "d30v",
-    "d30v",
-    4, /* Section alignment power.  */
-    TRUE,
-    bfd_default_compatible,
-    bfd_default_scan,
-    bfd_arch_default_fill,
-    0,
+  32,  /* Bits in a word.  */
+  32,  /* Bits in an address.  */
+  8,   /* Bits in a byte.  */
+  bfd_arch_d30v,
+  0,
+  "d30v",
+  "d30v",
+  4, /* Section alignment power.  */
+  TRUE,
+  bfd_default_compatible,
+  bfd_default_scan,
+  bfd_arch_default_fill,
+  NULL,
+  0 /* Maximum offset of a reloc from the start of an insn.  */
 };
index 3d3dd17ba7968c181fa37d00ded774eaa5dfe77f..445515c43751d2893600e3d4c4301d3a04366537 100644 (file)
 #include "libbfd.h"
 
 const bfd_arch_info_type bfd_dlx_arch =
-  {
-    32,        /* 32 bits in a word.  */
-    32,        /* 32 bits in an address.  */
-    8, /* 8 bits in a byte.  */
-    bfd_arch_dlx,
-    0, /* Only 1 machine.  */
-    "dlx",
-    "dlx",
-    4,
-    TRUE, /* The one and only.  */
-    bfd_default_compatible,
-    bfd_default_scan,
-    bfd_arch_default_fill,
-    0,
+{
+  32,  /* Bits in a word.  */
+  32,  /* Bits in an address.  */
+  8,   /* Bits in a byte.  */
+  bfd_arch_dlx,
+  0,   /* Machine number.  */
+  "dlx",
+  "dlx",
+  4,
+  TRUE, /* The one and only.  */
+  bfd_default_compatible,
+  bfd_default_scan,
+  bfd_arch_default_fill,
+  NULL,
+  0 /* Maximum offset of a reloc from the start of an insn.  */
 };
index 453337e69d93674948f71e0fa69abf1ba613db96..dace97483dbbd0e7574fa5d2229b81f46b12ef63 100644 (file)
 #include "bfd.h"
 #include "libbfd.h"
 
+#define N(NUMBER, PRINT, ALIGN, DEFAULT, NEXT)         \
+  {                                                    \
+    32,         /* Bits in a word.  */                 \
+    32,         /* Bits in an address.  */             \
+    8,         /* Bits in a byte.  */                  \
+    bfd_arch_epiphany,                                 \
+    NUMBER,                                            \
+    "epiphany",                                                \
+    PRINT,                                             \
+    ALIGN,     /* Section alignment power.  */         \
+    DEFAULT,                                           \
+    bfd_default_compatible,                            \
+    bfd_default_scan,                                  \
+    bfd_arch_default_fill,                             \
+    NEXT,                                              \
+    0 /* Maximum offset of a reloc from the start of an insn.  */ \
+  }
+
 const bfd_arch_info_type bfd_epiphany16_arch =
-{
-  32,                          /* Bits per word */
-  32,                          /* Bits per address.  */
-  8,                           /* Bits per byte.  */
-  bfd_arch_epiphany,           /* Architecture.  */
-  bfd_mach_epiphany16,         /* Machine.  */
-  "epiphany",                  /* Architecture name.  */
-  "epiphany16",                        /* Machine name.  */
-  1,                           /* Section align power.  */
-  FALSE,                       /* The default ?  */
-  bfd_default_compatible,      /* Architecture comparison fn.  */
-  bfd_default_scan,            /* String to architecture convert fn.  */
-  bfd_arch_default_fill,       /* Default fill.  */
-  NULL                         /* Next in list.  */
-};
+  N (bfd_mach_epiphany16, "epiphany16", 1, FALSE, NULL);
 
 const bfd_arch_info_type bfd_epiphany_arch =
-{
-  32,                          /* Bits per word - not really true.  */
-  32,                          /* Bits per address.  */
-  8,                           /* Bits per byte.  */
-  bfd_arch_epiphany,           /* Architecture.  */
-  bfd_mach_epiphany32,         /* Machine.  */
-  "epiphany",                  /* Architecture name.  */
-  "epiphany32",                        /* Machine name.  */
-  2,                           /* Section align power.  */
-  TRUE,                                /* The default ?  */
-  bfd_default_compatible,      /* Architecture comparison fn.  */
-  bfd_default_scan,            /* String to architecture convert fn.  */
-  bfd_arch_default_fill,       /* Default fill.  */
-  & bfd_epiphany16_arch        /* Next in list.  */
-};
+  N (bfd_mach_epiphany32, "epiphany32", 2, TRUE, & bfd_epiphany16_arch);
+
index 8d4b5a01f04bc3927d4163ecb2d143a7f16713b9..28b7460d5df330bf6621beff28ec9cce1c5daecf 100644 (file)
 
 const bfd_arch_info_type bfd_fr30_arch =
 {
-  32,                          /* bits per word */
-  32,                          /* bits per address */
-  8,                           /* bits per byte */
-  bfd_arch_fr30,               /* architecture */
-  bfd_mach_fr30,               /* machine */
-  "fr30",                      /* architecture name */
-  "fr30",                      /* printable name */
-  4,                           /* section align power */
-  TRUE,                                /* the default ? */
-  bfd_default_compatible,      /* architecture comparison fn */
-  bfd_default_scan,            /* string to architecture convert fn */
+  32,                          /* Bits per word.  */
+  32,                          /* Bits per address.  */
+  8,                           /* Bits per byte.  */
+  bfd_arch_fr30,               /* Architecture.  */
+  bfd_mach_fr30,               /* Machine.  */
+  "fr30",                      /* Architecture name.  */
+  "fr30",                      /* Printable name.  */
+  4,                           /* Section align power.  */
+  TRUE,                                /* The default ?  */
+  bfd_default_compatible,      /* Architecture comparison fn.  */
+  bfd_default_scan,            /* String to architecture convert fn.  */
   bfd_arch_default_fill,       /* Default fill.  */
-  NULL                         /* next in list */
+  NULL,                                /* Next in list.  */
+  0 /* Maximum offset of a reloc from the start of an insn.  */
 };
index e4a15345f1b87edf92defffbdff2515ba2abddb9..622258f0b9cf195292c50a0af77ca550a170cc42 100644 (file)
 
 #define FRV_ARCH(MACHINE, NAME, DEFAULT, NEXT)                         \
 {                                                                      \
-  32,                          /* 32 bits in a word */                 \
-  32,                          /* 32 bits in an address */             \
-  8,                           /* 8 bits in a byte */                  \
-  bfd_arch_frv,                        /* architecture */                      \
-  MACHINE,                     /* which machine */                     \
-  "frv",                       /* architecture name */                 \
-  NAME,                                /* machine name */                      \
-  4,                           /* default alignment */                 \
-  DEFAULT,                     /* is this the default? */              \
-  bfd_default_compatible,      /* architecture comparison fn */        \
-  bfd_default_scan,            /* string to architecture convert fn */ \
+  32,                          /* Bits in a word.  */                  \
+  32,                          /* Bits in an address.  */              \
+  8,                           /* Bits in a byte.  */                  \
+  bfd_arch_frv,                        /* Architecture number.  */             \
+  MACHINE,                     /* Machine number.  */                  \
+  "frv",                       /* Architecture name.  */               \
+  NAME,                                /* Machine name.  */                    \
+  4,                           /* Section alignment.  */               \
+  DEFAULT,                     /* Is this the default?  */             \
+  bfd_default_compatible,      /* Architecture comparison fn.  */      \
+  bfd_default_scan,            /* String to architecture convert fn. */\
   bfd_arch_default_fill,       /* Default fill.  */                    \
-  NEXT                         /* next in list */                      \
+  NEXT,                                /* Next in list.  */                    \
+  0 /* Maximum offset of a reloc from the start of an insn.  */                \
 }
 
 static const bfd_arch_info_type arch_info_300
index 5b51b7abf239bfc69bfbb53bd0c2b118cb46433f..3c33e3fdf02b5d99eb94cc51cb4cb0b8514686d9 100644 (file)
 #include "bfd.h"
 #include "libbfd.h"
 
+#define N(NUMBER, PRINT, DEFAULT, NEXT)                        \
+  {                                                    \
+    32,        /* Bits in a word.  */                  \
+    32,        /* Bits in an address.  */              \
+    8,        /* Bits in a byte.  */                   \
+    bfd_arch_ft32,                                     \
+    NUMBER,                                            \
+    "ft32",                                            \
+    PRINT,                                             \
+    2,         /* Section alignment power.  */         \
+    DEFAULT,                                           \
+    bfd_default_compatible,                            \
+    bfd_default_scan,                                  \
+    bfd_arch_default_fill,                             \
+    NEXT,                                              \
+    0 /* Maximum offset of a reloc from the start of an insn.  */ \
+  }
+
 
 static const bfd_arch_info_type arch_info_struct[] =
-  {
-    {
-      32,              /* 32 bits in a word.  */
-      32,              /* 32 bits in an address.  */
-      8,               /*  8 bits in a byte.  */
-      bfd_arch_ft32,   /* enum bfd_architecture arch.  */
-      bfd_mach_ft32,
-      "ft32",          /* Arch name.  */
-      "ft32",          /* Printable name.  */
-      2,               /* Unsigned int section alignment power.  */
-      FALSE,           /* The one and only.  */
-      bfd_default_compatible,
-      bfd_default_scan,
-      bfd_arch_default_fill,
-      &arch_info_struct[1],
-    },
-    {
-      32,              /* 32 bits in a word.  */
-      32,              /* 32 bits in an address.  */
-      8,               /*  8 bits in a byte.  */
-      bfd_arch_ft32,   /* enum bfd_architecture arch.  */
-      bfd_mach_ft32b,
-      "ft32b",         /* Arch name.  */
-      "ft32b",         /* Printable name.  */
-      2,               /* Unsigned int section alignment power.  */
-      FALSE,           /* The one and only.  */
-      bfd_default_compatible,
-      bfd_default_scan,
-      bfd_arch_default_fill,
-      0,
-    },
-  };
+{
+  N (bfd_mach_ft32, "ft32", FALSE, &arch_info_struct[1]),
+  N (bfd_mach_ft32b, "ft32b", FALSE, NULL)
+};
 
 const bfd_arch_info_type bfd_ft32_arch =
-  {
-    32,                        /* 32 bits in a word.  */
-    32,                        /* 32 bits in an address.  */
-    8,                 /*  8 bits in a byte.  */
-    bfd_arch_ft32,     /* enum bfd_architecture arch.  */
-    bfd_mach_ft32,
-    "ft32",            /* Arch name.  */
-    "ft32",            /* Printable name.  */
-    2,                 /* Unsigned int section alignment power.  */
-    TRUE,              /* The one and only.  */
-    bfd_default_compatible,
-    bfd_default_scan,
-    bfd_arch_default_fill,
-    arch_info_struct,
-  };
+  N (bfd_mach_ft32, "ft32", TRUE, arch_info_struct);
+
index 6c4019e472dd3a85344f850da3301617bf44cc90..53dd4ec52b53d6ee5b57216b88406774a6871e1b 100644 (file)
@@ -113,124 +113,30 @@ compatible (const bfd_arch_info_type *in, const bfd_arch_info_type *out)
     return in;
 }
 
+#define N(word, addr, number, name, print, default, next)        \
+  { word, addr, 8, bfd_arch_h8300, number, name, print, 1, default, \
+    compatible, h8300_scan, bfd_arch_default_fill, next, 0 }
+
 static const bfd_arch_info_type h8300sxn_info_struct =
-{
-  32,                          /* 32 bits in a word */
-  16,                          /* 16 bits in an address */
-  8,                           /* 8 bits in a byte */
-  bfd_arch_h8300,
-  bfd_mach_h8300sxn,
-  "h8300sxn",                  /* arch_name  */
-  "h8300sxn",                  /* printable name */
-  1,
-  FALSE,                       /* the default machine */
-  compatible,
-  h8300_scan,
-  bfd_arch_default_fill,
-  0
-};
+  N (32, 16, bfd_mach_h8300sxn, "h8300sxn", "h8300sxn", FALSE, NULL);
 
 static const bfd_arch_info_type h8300sx_info_struct =
-{
-  32,                          /* 32 bits in a word */
-  32,                          /* 32 bits in an address */
-  8,                           /* 8 bits in a byte */
-  bfd_arch_h8300,
-  bfd_mach_h8300sx,
-  "h8300sx",                   /* arch_name  */
-  "h8300sx",                   /* printable name */
-  1,
-  FALSE,                       /* the default machine */
-  compatible,
-  h8300_scan,
-  bfd_arch_default_fill,
-  &h8300sxn_info_struct
-};
+  N (32, 32, bfd_mach_h8300sx, "h8300sx", "h8300sx", FALSE, &h8300sxn_info_struct);
 
 static const bfd_arch_info_type h8300sn_info_struct =
-{
-  32,                          /* 32 bits in a word.  */
-  16,                          /* 16 bits in an address.  */
-  8,                           /* 8 bits in a byte.  */
-  bfd_arch_h8300,
-  bfd_mach_h8300sn,
-  "h8300sn",                   /* Architecture name.  */
-  "h8300sn",                   /* Printable name.  */
-  1,
-  FALSE,                       /* The default machine.  */
-  compatible,
-  h8300_scan,
-  bfd_arch_default_fill,
-  &h8300sx_info_struct
-};
+  N (32, 16, bfd_mach_h8300sn, "h8300sn", "h8300sn", FALSE, &h8300sx_info_struct);
 
 static const bfd_arch_info_type h8300hn_info_struct =
-{
-  32,                          /* 32 bits in a word.  */
-  16,                          /* 16 bits in an address.  */
-  8,                           /* 8 bits in a byte.  */
-  bfd_arch_h8300,
-  bfd_mach_h8300hn,
-  "h8300hn",                   /* Architecture name.  */
-  "h8300hn",                   /* Printable name.  */
-  1,
-  FALSE,                       /* The default machine.  */
-  compatible,
-  h8300_scan,
-  bfd_arch_default_fill,
-  &h8300sn_info_struct
-};
+  N (32, 16, bfd_mach_h8300hn, "h8300hn", "h8300hn", FALSE, &h8300sn_info_struct);
 
 static const bfd_arch_info_type h8300s_info_struct =
-{
-  32,                          /* 32 bits in a word.  */
-  32,                          /* 32 bits in an address.  */
-  8,                           /* 8 bits in a byte.  */
-  bfd_arch_h8300,
-  bfd_mach_h8300s,
-  "h8300s",                    /* Architecture name.  */
-  "h8300s",                    /* Printable name.  */
-  1,
-  FALSE,                       /* The default machine.  */
-  compatible,
-  h8300_scan,
-  bfd_arch_default_fill,
-  & h8300hn_info_struct
-};
+  N (32, 32, bfd_mach_h8300s, "h8300s", "h8300s", FALSE, & h8300hn_info_struct);
 
 static const bfd_arch_info_type h8300h_info_struct =
-{
-  32,                          /* 32 bits in a word.  */
-  32,                          /* 32 bits in an address.  */
-  8,                           /* 8 bits in a byte.  */
-  bfd_arch_h8300,
-  bfd_mach_h8300h,
-  "h8300h",                    /* Architecture name.  */
-  "h8300h",                    /* Printable name.  */
-  1,
-  FALSE,                       /* The default machine.  */
-  compatible,
-  h8300_scan,
-  bfd_arch_default_fill,
-  &h8300s_info_struct
-};
+  N (32, 32, bfd_mach_h8300h, "h8300h", "h8300h", FALSE, &h8300s_info_struct);
 
 const bfd_arch_info_type bfd_h8300_arch =
-{
-  16,                          /* 16 bits in a word.  */
-  16,                          /* 16 bits in an address.  */
-  8,                           /* 8 bits in a byte.  */
-  bfd_arch_h8300,
-  bfd_mach_h8300,
-  "h8300",                     /* Architecture name.  */
-  "h8300",                     /* Printable name.  */
-  1,
-  TRUE,                                /* The default machine.  */
-  compatible,
-  h8300_scan,
-  bfd_arch_default_fill,
-  &h8300h_info_struct
-};
+  N (16, 16, bfd_mach_h8300, "h8300", "h8300", TRUE, &h8300h_info_struct);
 
 /* Pad the given address to 32 bits, converting 16-bit and 24-bit
    addresses into the values they would have had on a h8s target.  */
index e144c11152e9fe4a6af372d0a5f3329667902b00..2bcc0312daf85f0ee2d5e448768efe9a90b5d0e1 100644 (file)
 #include "bfd.h"
 #include "libbfd.h"
 
+#define N(BITS, NUMBER, PRINT, DEFAULT, NEXT) \
+  {                                                    \
+    BITS,      /* Bits in a word.  */                  \
+    BITS,      /* Bits in an address.  */              \
+    8,        /* Bits in a byte.  */                   \
+    bfd_arch_hppa,                                     \
+    NUMBER,                                            \
+    "hppa",                                            \
+    PRINT,                                             \
+    3,         /* Section alignment power.  */         \
+    DEFAULT,                                           \
+    bfd_default_compatible,                            \
+    bfd_default_scan,                                  \
+    bfd_arch_default_fill,                             \
+    NEXT,                                              \
+    0 /* Maximum offset of a reloc from the start of an insn.  */ \
+  }
+
+
 static const bfd_arch_info_type bfd_hppa10_arch =
-{
-  32,                          /* 32 bits in a word */
-  32,                          /* 32 bits in an address */
-  8,                           /* 8 bits in a byte */
-  bfd_arch_hppa,
-  bfd_mach_hppa10,             /* By convention PA1.0 = 10 */
-  "hppa",
-  "hppa1.0",
-  3,
-  TRUE,                                /* Unless we use 1.1 specific features */
-  bfd_default_compatible,
-  bfd_default_scan,
-  bfd_arch_default_fill,
-  0,
-};
+  N (32, bfd_mach_hppa10, "hppa1.0", TRUE, NULL);
 
-/* PA2.0 in narrow mode */
+/* PA2.0 in narrow mode */
 static const bfd_arch_info_type bfd_hppa20_arch =
-{
-  32,                          /* 32 bits in a word */
-  32,                          /* 32 bits in an address */
-  8,                           /* 8 bits in a byte */
-  bfd_arch_hppa,
-  bfd_mach_hppa20,             /* By convention PA2.0 = 20 */
-  "hppa",
-  "hppa2.0",
-  3,
-  FALSE,                       /* Unless we use 1.1 specific features */
-  bfd_default_compatible,
-  bfd_default_scan,
-  bfd_arch_default_fill,
-  &bfd_hppa10_arch,
-};
+  N (32, bfd_mach_hppa20, "hppa2.0", FALSE, &bfd_hppa10_arch);
 
-/* PA2.0 in wide mode */
+/* PA2.0 in wide mode */
 static const bfd_arch_info_type bfd_hppa20w_arch =
-{
-  64,                          /* 64 bits in a word */
-  64,                          /* 64 bits in an address */
-  8,                           /* 8 bits in a byte */
-  bfd_arch_hppa,
-  bfd_mach_hppa20w,            /* ??? How best to describe wide mode here?  */
-  "hppa",
-  "hppa2.0w",
-  3,
-  FALSE,                       /* Unless we use 1.1 specific features */
-  bfd_default_compatible,
-  bfd_default_scan,
-  bfd_arch_default_fill,
-  &bfd_hppa20_arch,
-};
+  N (64, bfd_mach_hppa20w, "hppa2.0w", FALSE, &bfd_hppa20_arch);
 
 const bfd_arch_info_type bfd_hppa_arch =
-{
-  32,                          /* 32 bits in a word */
-  32,                          /* 32 bits in an address */
-  8,                           /* 8 bits in a byte */
-  bfd_arch_hppa,
-  bfd_mach_hppa11,             /* By convention PA1.1 = 11 */
-  "hppa",
-  "hppa1.1",
-  3,
-  FALSE,                       /* 1.1 specific features used */
-  bfd_default_compatible,
-  bfd_default_scan,
-  bfd_arch_default_fill,
-  &bfd_hppa20w_arch,
-};
+  N (32, bfd_mach_hppa11, "hppa1.1", FALSE, &bfd_hppa20w_arch);
index a865a66e127341b3887a586d68ce22097fb59b43..5df643551986c24308f64451da20a48e7178e8a9 100644 (file)
@@ -130,173 +130,62 @@ bfd_arch_i386_onebyte_nop_fill (bfd_size_type count,
   return fill;
 }
 
+#define N(BITS, MACH, NAME, PRINT, DEF, FILL, NEXT)    \
+  { BITS, /* Bits in a word.  */               \
+    BITS, /* Bits in an address.  */           \
+    8,    /* Bits in a byte. */                        \
+    bfd_arch_i386,                             \
+    MACH, /* Machine number.  */               \
+    NAME,                                      \
+    PRINT,                                     \
+    3,   /* Section alignment power.  */       \
+    DEF, /* Default architecture version ?  */ \
+    bfd_i386_compatible,                       \
+    bfd_default_scan,                          \
+    FILL,                                      \
+    NEXT,                                      \
+    0 /* Maximum instruction length.  */       \
+  }
+
 
 static const bfd_arch_info_type bfd_x64_32_nacl_arch =
-{
-  64, /* 64 bits in a word */
-  64, /* 64 bits in an address */
-  8,  /* 8 bits in a byte */
-  bfd_arch_i386,
-  bfd_mach_x64_32_nacl,
-  "i386",
-  "i386:x64-32:nacl",
-  3,
-  FALSE,
-  bfd_i386_compatible,
-  bfd_default_scan,
-  bfd_arch_i386_onebyte_nop_fill,
-  NULL
-};
+  N (64, bfd_mach_x64_32_nacl, "i386", "i386:x64-32:nacl",
+     FALSE, bfd_arch_i386_onebyte_nop_fill, NULL);
 
 static const bfd_arch_info_type bfd_x86_64_nacl_arch =
-{
-  64, /* 64 bits in a word */
-  64, /* 64 bits in an address */
-  8,  /* 8 bits in a byte */
-  bfd_arch_i386,
-  bfd_mach_x86_64_nacl,
-  "i386",
-  "i386:x86-64:nacl",
-  3,
-  FALSE,
-  bfd_i386_compatible,
-  bfd_default_scan,
-  bfd_arch_i386_onebyte_nop_fill,
-  &bfd_x64_32_nacl_arch
-};
+  N (64, bfd_mach_x86_64_nacl, "i386", "i386:x86-64:nacl",
+     FALSE, bfd_arch_i386_onebyte_nop_fill, &bfd_x64_32_nacl_arch);
 
 const bfd_arch_info_type bfd_i386_nacl_arch =
-{
-  32,  /* 32 bits in a word */
-  32,  /* 32 bits in an address */
-  8,   /* 8 bits in a byte */
-  bfd_arch_i386,
-  bfd_mach_i386_i386_nacl,
-  "i386",
-  "i386:nacl",
-  3,
-  TRUE,
-  bfd_i386_compatible,
-  bfd_default_scan,
-  bfd_arch_i386_onebyte_nop_fill,
-  &bfd_x86_64_nacl_arch
-};
+  N (32, bfd_mach_i386_i386_nacl, "i386", "i386:nacl",
+     TRUE, bfd_arch_i386_onebyte_nop_fill, &bfd_x86_64_nacl_arch);
+
 
 static const bfd_arch_info_type bfd_x64_32_arch_intel_syntax =
-{
-  64, /* 64 bits in a word */
-  64, /* 64 bits in an address */
-  8,  /* 8 bits in a byte */
-  bfd_arch_i386,
-  bfd_mach_x64_32_intel_syntax,
-  "i386:intel",
-  "i386:x64-32:intel",
-  3,
-  FALSE,
-  bfd_i386_compatible,
-  bfd_default_scan,
-  bfd_arch_i386_long_nop_fill,
-  &bfd_i386_nacl_arch
-};
+  N (64, bfd_mach_x64_32_intel_syntax, "i386:intel", "i386:x64-32:intel",
+     FALSE, bfd_arch_i386_long_nop_fill, &bfd_i386_nacl_arch);
 
 static const bfd_arch_info_type bfd_x86_64_arch_intel_syntax =
-{
-  64, /* 64 bits in a word */
-  64, /* 64 bits in an address */
-  8,  /* 8 bits in a byte */
-  bfd_arch_i386,
-  bfd_mach_x86_64_intel_syntax,
-  "i386:intel",
-  "i386:x86-64:intel",
-  3,
-  FALSE,
-  bfd_i386_compatible,
-  bfd_default_scan,
-  bfd_arch_i386_long_nop_fill,
-  &bfd_x64_32_arch_intel_syntax,
-};
+  N (64, bfd_mach_x86_64_intel_syntax, "i386:intel", "i386:x86-64:intel",
+     FALSE, bfd_arch_i386_long_nop_fill, &bfd_x64_32_arch_intel_syntax);
 
 static const bfd_arch_info_type bfd_i386_arch_intel_syntax =
-{
-  32,  /* 32 bits in a word */
-  32,  /* 32 bits in an address */
-  8,   /* 8 bits in a byte */
-  bfd_arch_i386,
-  bfd_mach_i386_i386_intel_syntax,
-  "i386:intel",
-  "i386:intel",
-  3,
-  TRUE,
-  bfd_i386_compatible,
-  bfd_default_scan,
-  bfd_arch_i386_short_nop_fill,
-  &bfd_x86_64_arch_intel_syntax
-};
+  N (32, bfd_mach_i386_i386_intel_syntax, "i386:intel", "i386:intel",
+     TRUE, bfd_arch_i386_short_nop_fill, &bfd_x86_64_arch_intel_syntax);
+
 
 static const bfd_arch_info_type i8086_arch =
-{
-  32,  /* 32 bits in a word */
-  32,  /* 32 bits in an address (well, not really) */
-  8,   /* 8 bits in a byte */
-  bfd_arch_i386,
-  bfd_mach_i386_i8086,
-  "i8086",
-  "i8086",
-  3,
-  FALSE,
-  bfd_i386_compatible,
-  bfd_default_scan,
-  bfd_arch_i386_short_nop_fill,
-  &bfd_i386_arch_intel_syntax
-};
+  N (32, bfd_mach_i386_i8086, "i8086", "i8086",
+     FALSE, bfd_arch_i386_short_nop_fill, &bfd_i386_arch_intel_syntax);
 
 static const bfd_arch_info_type bfd_x64_32_arch =
-{
-  64, /* 64 bits in a word */
-  64, /* 64 bits in an address */
-  8,  /* 8 bits in a byte */
-  bfd_arch_i386,
-  bfd_mach_x64_32,
-  "i386",
-  "i386:x64-32",
-  3,
-  FALSE,
-  bfd_i386_compatible,
-  bfd_default_scan,
-  bfd_arch_i386_long_nop_fill,
-  &i8086_arch
-};
+  N (64, bfd_mach_x64_32, "i386", "i386:x64-32",
+     FALSE, bfd_arch_i386_long_nop_fill, &i8086_arch);
 
 static const bfd_arch_info_type bfd_x86_64_arch =
-{
-  64, /* 64 bits in a word */
-  64, /* 64 bits in an address */
-  8,  /* 8 bits in a byte */
-  bfd_arch_i386,
-  bfd_mach_x86_64,
-  "i386",
-  "i386:x86-64",
-  3,
-  FALSE,
-  bfd_i386_compatible,
-  bfd_default_scan,
-  bfd_arch_i386_long_nop_fill,
-  &bfd_x64_32_arch
-};
+  N (64, bfd_mach_x86_64, "i386", "i386:x86-64",
+     FALSE, bfd_arch_i386_long_nop_fill, &bfd_x64_32_arch);
 
 const bfd_arch_info_type bfd_i386_arch =
-{
-  32,  /* 32 bits in a word */
-  32,  /* 32 bits in an address */
-  8,   /* 8 bits in a byte */
-  bfd_arch_i386,
-  bfd_mach_i386_i386,
-  "i386",
-  "i386",
-  3,
-  TRUE,
-  bfd_i386_compatible,
-  bfd_default_scan,
-  bfd_arch_i386_short_nop_fill,
-  &bfd_x86_64_arch
-};
+  N (32, bfd_mach_i386_i386, "i386", "i386",
+     TRUE, bfd_arch_i386_short_nop_fill, &bfd_x86_64_arch);
index 93e8cc001aa3aeec693d5697063f4ff1168c7b75..300007ade6f6e852c8887f3026bc5d2f56d8e732 100644 (file)
 #include "bfd.h"
 #include "libbfd.h"
 
+#define N(BITS_ADDR, NUMBER, PRINT, DEFAULT, NEXT) \
+  {                                                    \
+    64,        /* Bits in a word.  */                  \
+    BITS_ADDR, /* Bits in an address.  */              \
+    8,        /* Bits in a byte.  */                   \
+    bfd_arch_ia64,                                     \
+    NUMBER,                                            \
+    "ia64",                                            \
+    PRINT,                                             \
+    3,         /* Section alignment power.  */         \
+    DEFAULT,                                           \
+    bfd_default_compatible,                            \
+    bfd_default_scan,                                  \
+    bfd_arch_default_fill,                             \
+    NEXT,                                              \
+    0 /* Maximum offset of a reloc from the start of an insn.  */ \
+  }
+
 const bfd_arch_info_type bfd_ia64_elf32_arch =
-  {
-    64,        /* 64 bits in a word */
-    32,        /* 32 bits in an address */
-    8, /* 8 bits in a byte */
-    bfd_arch_ia64,
-    bfd_mach_ia64_elf32,
-    "ia64",
-    "ia64-elf32",
-    3, /* log2 of section alignment */
-    TRUE, /* the one and only */
-    bfd_default_compatible,
-    bfd_default_scan,
-    bfd_arch_default_fill,
-    0,
-  };
+  N (32, bfd_mach_ia64_elf32, "ia64-elf32", FALSE, NULL);
 
 const bfd_arch_info_type bfd_ia64_arch =
-  {
-    64,        /* 64 bits in a word */
-    64,        /* 64 bits in an address */
-    8, /* 8 bits in a byte */
-    bfd_arch_ia64,
-    bfd_mach_ia64_elf64,
-    "ia64",
-    "ia64-elf64",
-    3, /* log2 of section alignment */
-    TRUE, /* the one and only */
-    bfd_default_compatible,
-    bfd_default_scan,
-    bfd_arch_default_fill,
-    &bfd_ia64_elf32_arch,
-  };
+  N (64, bfd_mach_ia64_elf64, "ia64-elf64", TRUE, &bfd_ia64_elf32_arch);
 
 #include "cpu-ia64-opc.c"
index 4b315d447599ccb7b3da78cfa5e8201b53c55908..6630a7a662f8371ef4eaed33fcaa63de23f17b50 100644 (file)
 extern void * bfd_arch_i386_short_nop_fill (bfd_size_type, bfd_boolean,
                                            bfd_boolean);
 
+#define N(number, name, print, next)                        \
+  { 32, 32, 8, bfd_arch_iamcu, number, name, print, 3, TRUE, \
+    bfd_default_compatible, bfd_default_scan,               \
+    bfd_arch_i386_short_nop_fill, next, 0 }
+
 static const bfd_arch_info_type bfd_iamcu_arch_intel_syntax =
-{
-  32, /* 32 bits in a word */
-  32, /* 32 bits in an address */
-  8,  /* 8 bits in a byte */
-  bfd_arch_iamcu,
-  bfd_mach_i386_iamcu_intel_syntax,
-  "iamcu:intel",
-  "iamcu:intel",
-  3,
-  TRUE,
-  bfd_default_compatible,
-  bfd_default_scan,
-  bfd_arch_i386_short_nop_fill,
-  0
-};
+  N (bfd_mach_i386_iamcu_intel_syntax, "iamcu:intel", "iamcu:intel", NULL);
 
 const bfd_arch_info_type bfd_iamcu_arch =
-{
-  32, /* 32 bits in a word */
-  32, /* 32 bits in an address */
-  8,  /* 8 bits in a byte */
-  bfd_arch_iamcu,
-  bfd_mach_i386_iamcu,
-  "iamcu",
-  "iamcu",
-  3,
-  TRUE,
-  bfd_default_compatible,
-  bfd_default_scan,
-  bfd_arch_i386_short_nop_fill,
-  &bfd_iamcu_arch_intel_syntax
-};
+  N (bfd_mach_i386_iamcu, "iamcu", "iamcu", &bfd_iamcu_arch_intel_syntax);
+
index 68e3a34ba2358b06105f06d189253468934caa59..217229dfd17dcf3e2ba8f297be0bad612ba4c3da 100644 (file)
 #include "bfd.h"
 #include "libbfd.h"
 
+#define N(NUMBER, PRINT, DEFAULT, NEXT)                        \
+  {                                                    \
+    32,         /* Bits in a word.  */                 \
+    16,         /* Bits in an address.  */             \
+    8,         /* Bits in a byte.  */                  \
+    bfd_arch_ip2k,                                     \
+    NUMBER,                                            \
+    "ip2k",                                            \
+    PRINT,                                             \
+    1,         /* Section alignment power.  */         \
+    DEFAULT,                                           \
+    bfd_default_compatible,                            \
+    bfd_default_scan,                                  \
+    bfd_arch_default_fill,                             \
+    NEXT,                                              \
+    0 /* Maximum offset of a reloc from the start of an insn.  */ \
+  }
+
 const bfd_arch_info_type bfd_ip2k_nonext_arch =
-{
-  32,                          /* Bits per word - not really true.  */
-  16,                          /* Bits per address.  */
-  8,                           /* Bits per byte.  */
-  bfd_arch_ip2k,               /* Architecture.  */
-  bfd_mach_ip2022,             /* Machine.  */
-  "ip2k",                      /* Architecture name.  */
-  "ip2022",                    /* Machine name.  */
-  1,                           /* Section align power.  */
-  FALSE,                       /* The default ?  */
-  bfd_default_compatible,      /* Architecture comparison fn.  */
-  bfd_default_scan,            /* String to architecture convert fn.  */
-  bfd_arch_default_fill,       /* Default fill.  */
-  NULL                         /* Next in list.  */
-};
+  N (bfd_mach_ip2022, "ip2022", FALSE, NULL);
 
 const bfd_arch_info_type bfd_ip2k_arch =
-{
-  32,                          /* Bits per word - not really true.  */
-  16,                          /* Bits per address.  */
-  8,                           /* Bits per byte.  */
-  bfd_arch_ip2k,               /* Architecture.  */
-  bfd_mach_ip2022ext,          /* Machine.  */
-  "ip2k",                      /* Architecture name.  */
-  "ip2022ext",                 /* Machine name.  */
-  1,                           /* Section align power.  */
-  TRUE,                                /* The default ?  */
-  bfd_default_compatible,      /* Architecture comparison fn.  */
-  bfd_default_scan,            /* String to architecture convert fn.  */
-  bfd_arch_default_fill,       /* Default fill.  */
-  & bfd_ip2k_nonext_arch       /* Next in list.  */
-};
+  N (bfd_mach_ip2022ext, "ip2022ext", TRUE, & bfd_ip2k_nonext_arch);
+
index c5f5c1a17f8e22b227617731900b38764e4ea14d..a8d09478bbd040a6a6899fb4aaeff2b795e87678 100644 (file)
 #include "bfd.h"
 #include "libbfd.h"
 
-static const bfd_arch_info_type arch_info_struct[] =
-{
-  {
-    32,                                /* bits per word */
-    32,                                /* bits per address */
-    8,                         /* bits per byte */
-    bfd_arch_iq2000,           /* architecture */
-    bfd_mach_iq10,             /* machine */
-    "iq2000",                  /* architecture name */
-    "iq10",                    /* printable name */
-    3,                         /* section align power */
-    FALSE,                     /* the default ? */
-    bfd_default_compatible,    /* architecture comparison fn */
-    bfd_default_scan,          /* string to architecture convert fn */
-    bfd_arch_default_fill,     /* Default fill.  */
-    NULL                       /* next in list */
+#define N(NUMBER, PRINT, DEFAULT, NEXT)                        \
+  {                                                    \
+    32,         /* Bits in a word.  */                 \
+    32,         /* Bits in an address.  */             \
+    8,         /* Bits in a byte.  */                  \
+    bfd_arch_iq2000,                                   \
+    NUMBER,                                            \
+    "iq2000",                                          \
+    PRINT,                                             \
+    3,         /* Section alignment power.  */         \
+    DEFAULT,                                           \
+    bfd_default_compatible,                            \
+    bfd_default_scan,                                  \
+    bfd_arch_default_fill,                             \
+    NEXT,                                              \
+    0 /* Maximum offset of a reloc from the start of an insn.  */ \
   }
-};
+
+static const bfd_arch_info_type arch_info_struct =
+  N (bfd_mach_iq10, "iq10", FALSE, NULL);
 
 const bfd_arch_info_type bfd_iq2000_arch =
-{
-  32,                          /* bits per word */
-  32,                          /* bits per address */
-  8,                           /* bits per byte */
-  bfd_arch_iq2000,             /* architecture */
-  bfd_mach_iq2000,             /* machine */
-  "iq2000",                    /* architecture name */
-  "iq2000",                    /* printable name */
-  3,                           /* section align power */
-  TRUE,                                /* the default ? */
-  bfd_default_compatible,      /* architecture comparison fn */
-  bfd_default_scan,            /* string to architecture convert fn */
-  bfd_arch_default_fill,       /* Default fill.  */
-  &arch_info_struct[0],                /* next in list */
-};
+  N (bfd_mach_iq2000, "iq2000", TRUE, &arch_info_struct);
+
index 927bab6f2c77c6c740d40e898530923ec35190c8..f5bcec168da40b3476f4981e2d4bec22a67826a6 100644 (file)
 extern void * bfd_arch_i386_short_nop_fill (bfd_size_type, bfd_boolean,
                                            bfd_boolean);
 
+#define N(number, name, print, next)                        \
+  { 64, 64, 8, bfd_arch_k1om, number, name, print, 3, TRUE, \
+    bfd_default_compatible, bfd_default_scan,               \
+    bfd_arch_i386_short_nop_fill, next, 9 }
+
 static const bfd_arch_info_type bfd_k1om_arch_intel_syntax =
-{
-  64, /* 64 bits in a word */
-  64, /* 64 bits in an address */
-  8,  /* 8 bits in a byte */
-  bfd_arch_k1om,
-  bfd_mach_k1om_intel_syntax,
-  "k1om:intel",
-  "k1om:intel",
-  3,
-  TRUE,
-  bfd_default_compatible,
-  bfd_default_scan,
-  bfd_arch_i386_short_nop_fill,
-  0
-};
+  N (bfd_mach_k1om_intel_syntax, "k1om:intel", "k1om:intel", NULL);
 
 const bfd_arch_info_type bfd_k1om_arch =
-{
-  64, /* 64 bits in a word */
-  64, /* 64 bits in an address */
-  8,  /* 8 bits in a byte */
-  bfd_arch_k1om,
-  bfd_mach_k1om,
-  "k1om",
-  "k1om",
-  3,
-  TRUE,
-  bfd_default_compatible,
-  bfd_default_scan,
-  bfd_arch_i386_short_nop_fill,
-  &bfd_k1om_arch_intel_syntax
-};
+  N (bfd_mach_k1om, "k1om", "k1om", &bfd_k1om_arch_intel_syntax);
+
index e32400eb978072bb085e9a51050131aa5d3c1ade..063a5aa1e7a1b36799975daa1e9fc46f721e0070 100644 (file)
 extern void * bfd_arch_i386_short_nop_fill (bfd_size_type, bfd_boolean,
                                            bfd_boolean);
 
+#define N(number, name, print, next)                        \
+  { 64, 64, 8, bfd_arch_l1om, number, name, print, 3, TRUE, \
+    bfd_default_compatible, bfd_default_scan,               \
+    bfd_arch_i386_short_nop_fill, next, 0 }
+
 static const bfd_arch_info_type bfd_l1om_arch_intel_syntax =
-{
-  64, /* 64 bits in a word */
-  64, /* 64 bits in an address */
-  8,  /* 8 bits in a byte */
-  bfd_arch_l1om,
-  bfd_mach_l1om_intel_syntax,
-  "l1om:intel",
-  "l1om:intel",
-  3,
-  TRUE,
-  bfd_default_compatible,
-  bfd_default_scan,
-  bfd_arch_i386_short_nop_fill,
-  0
-};
+  N (bfd_mach_l1om_intel_syntax, "l1om:intel", "l1om:intel", NULL);
 
 const bfd_arch_info_type bfd_l1om_arch =
-{
-  64, /* 64 bits in a word */
-  64, /* 64 bits in an address */
-  8,  /* 8 bits in a byte */
-  bfd_arch_l1om,
-  bfd_mach_l1om,
-  "l1om",
-  "l1om",
-  3,
-  TRUE,
-  bfd_default_compatible,
-  bfd_default_scan,
-  bfd_arch_i386_short_nop_fill,
-  &bfd_l1om_arch_intel_syntax
-};
+  N (bfd_mach_l1om, "l1om", "l1om", &bfd_l1om_arch_intel_syntax);
index 41e3dc9348e6e70d70efc3bf00baf0fdf8cab926..9711e0654eba24a9730175ebda8e9ef86816e7f5 100644 (file)
 
 const bfd_arch_info_type bfd_lm32_arch =
 {
-    32,                                  /* Bits in word.  */
-    32,                                  /* Bits in address.  */
-    8,                           /* Bits in byte.  */
-    bfd_arch_lm32,               /* Enum bfd_architecture.  */
-    bfd_mach_lm32,               /* Machine number.  */
-    "lm32",                      /* Architecture name.  */
-    "lm32",                      /* Printable name.  */
-    4,                           /* Alignment.  */
-    TRUE,                        /* Is this the default machine for the target.  */
-    bfd_default_compatible,      /* Function callback to test if two files have compatible machines.  */
-    bfd_default_scan,
-    bfd_arch_default_fill,
-    NULL                         /* Next.  */
+  32,                    /* Bits in word.  */
+  32,                    /* Bits in address.  */
+  8,                     /* Bits in byte.  */
+  bfd_arch_lm32,         /* Enum bfd_architecture.  */
+  bfd_mach_lm32,         /* Machine number.  */
+  "lm32",                /* Architecture name.  */
+  "lm32",                /* Printable name.  */
+  4,                     /* Alignment.  */
+  TRUE,                          /* Is this the default machine for the target.  */
+  bfd_default_compatible, /* Function callback to test if two files have compatible machines.  */
+  bfd_default_scan,
+  bfd_arch_default_fill,
+  NULL,                          /* Next.  */
+  0                      /* Maximum offset of a reloc from the start of an insn.  */
 };
index f546764a9e5e222410f4a04cf62c270bbe72f016..96faeb9c9610239a3aca406d3321df3a5413ada3 100644 (file)
 #include "libbfd.h"
 
 const bfd_arch_info_type bfd_mn10200_arch =
-  {
-    16, /* 16 bits in a word */
-    24, /* 16 bits in an address */
-    8,  /* 8 bits in a byte */
-    bfd_arch_mn10200,
-    200,
-    "mn10200",
-    "mn10200",
-    2,
-    TRUE, /* the one and only */
-    bfd_default_compatible,
-    bfd_default_scan,
-    bfd_arch_default_fill,
-    0,
-  };
+{
+  16, /* Bits in a word.  */
+  24, /* Bits in an address.  */
+  8,  /* Bits in a byte.  */
+  bfd_arch_mn10200,
+  200,
+  "mn10200",
+  "mn10200",
+  2,
+  TRUE,   /* The one and only.  */
+  bfd_default_compatible,
+  bfd_default_scan,
+  bfd_arch_default_fill,
+  NULL,
+  0 /* Maximum offset of a reloc from the start of an insn.  */
+};
index b52c37eb6d71b5560e7c60a94d164bc8f2e14c66..2681b71edd9f3220fa57e2115032c5580c4ae814 100644 (file)
 #include "bfd.h"
 #include "libbfd.h"
 
+#define N(NUMBER, NAME, PRINT, DEFAULT, NEXT)          \
+  {                                                    \
+    32,         /* Bits in a word.  */                 \
+    32,         /* Bits in an address.  */             \
+    8,         /* Bits in a byte.  */                  \
+    bfd_arch_mn10300,                                  \
+    NUMBER,                                            \
+    NAME,                                              \
+    PRINT,                                             \
+    2,         /* Section alignment power.  */         \
+    DEFAULT,                                           \
+    bfd_default_compatible,                            \
+    bfd_default_scan,                                  \
+    bfd_arch_default_fill,                             \
+    NEXT,                                              \
+    0 /* Maximum offset of a reloc from the start of an insn.  */ \
+  }
+
 const bfd_arch_info_type bfd_am33_2_arch =
-  {
-    32, /* 32 bits in a word */
-    32, /* 32 bits in an address */
-    8,  /* 8 bits in a byte */
-    bfd_arch_mn10300,
-    332,
-    "am33_2",
-    "am33-2",
-    2,
-    FALSE,
-    bfd_default_compatible,
-    bfd_default_scan,
-    bfd_arch_default_fill,
-    0,
-  };
+  N (bfd_mach_am33_2, "am33_2", "am33-2", FALSE, NULL);
 
 const bfd_arch_info_type bfd_am33_arch =
-  {
-    32, /* 32 bits in a word */
-    32, /* 32 bits in an address */
-    8,  /* 8 bits in a byte */
-    bfd_arch_mn10300,
-    330,
-    "am33",
-    "am33",
-    2,
-    FALSE,
-    bfd_default_compatible,
-    bfd_default_scan,
-    bfd_arch_default_fill,
-    &bfd_am33_2_arch,
-  };
+  N (bfd_mach_am33, "am33", "am33", FALSE, &bfd_am33_2_arch);
 
 const bfd_arch_info_type bfd_mn10300_arch =
-  {
-    32, /* 32 bits in a word */
-    32, /* 32 bits in an address */
-    8,  /* 8 bits in a byte */
-    bfd_arch_mn10300,
-    300,
-    "mn10300",
-    "mn10300",
-    2,
-    TRUE, /* the one and only */
-    bfd_default_compatible,
-    bfd_default_scan,
-    bfd_arch_default_fill,
-    &bfd_am33_arch,
-  };
+  N (bfd_mach_mn10300, "mn10300", "mn10300", TRUE, &bfd_am33_arch);
index 2e7de137f136aa73eff2cb51f321510e73d90b38..86e6b783d582b65f30cb198d84423a9023569e3b 100644 (file)
@@ -35,38 +35,13 @@ m32c_scan (const bfd_arch_info_type * info, const char * string)
   return bfd_default_scan (info, string);
 }
 
-static const bfd_arch_info_type arch_info_struct[] =
-{
-  {
-    32,                                /* bits per word */
-    32,                                /* bits per address */
-    8,                         /* bits per byte */
-    bfd_arch_m32c,             /* architecture */
-    bfd_mach_m32c,             /* machine */
-    "m32c",                    /* architecture name */
-    "m32c",                    /* printable name */
-    3,                         /* section align power */
-    FALSE,                     /* the default ? */
-    bfd_default_compatible,    /* architecture comparison fn */
-    m32c_scan,                 /* string to architecture convert fn */
-    bfd_arch_default_fill,     /* Default fill.  */
-    NULL                       /* next in list */
-  },
-};
+#define N(number, print, align, default, next)                    \
+{ 32, 32, 8, bfd_arch_m32c, number, "m32c", print, align, default, \
+  bfd_default_compatible, m32c_scan, bfd_arch_default_fill, next, 0 }
+
+static const bfd_arch_info_type arch_info_struct =
+  N (bfd_mach_m32c, "m32c", 3, FALSE, NULL);
 
 const bfd_arch_info_type bfd_m32c_arch =
-{
-  32,                          /* Bits per word.  */
-  32,                          /* Bits per address.  */
-  8,                           /* Bits per byte.  */
-  bfd_arch_m32c,               /* Architecture.  */
-  bfd_mach_m16c,               /* Machine.  */
-  "m32c",                      /* Architecture name.  */
-  "m16c",                      /* Printable name.  */
-  4,                           /* Section align power.  */
-  TRUE,                                /* The default ?  */
-  bfd_default_compatible,      /* Architecture comparison fn.  */
-  m32c_scan,                   /* String to architecture convert fn.  */
-  bfd_arch_default_fill,       /* Default fill.  */
-  &arch_info_struct[0],                /* Next in list.  */
-};
+  N (bfd_mach_m16c, "m16c", 4, TRUE, &arch_info_struct);
+
index 085fd4eb2c440af7774c054d2c4e5c29878e502c..c911d238653231dae62d82902f12c2176730bbf8 100644 (file)
@@ -23,8 +23,8 @@
 #include "libbfd.h"
 
 #define N(number, print, default, next)  \
-{  32, 32, 8, bfd_arch_m32r, number, "m32r", print, 4, default, \
-     bfd_default_compatible, bfd_default_scan, bfd_arch_default_fill, next }
+{ 32, 32, 8, bfd_arch_m32r, number, "m32r", print, 4, default, \
+  bfd_default_compatible, bfd_default_scan, bfd_arch_default_fill, next, 0 }
 
 #define M32R2_NEXT   & arch_info_struct [1]
 #define NEXT        & arch_info_struct [0]
index 4bb7cd475c86e75d97c1a2432f9d08209f18319f..23841f88d8bf995d7b37fc6eb8169979726f5a57 100644 (file)
 
 const bfd_arch_info_type bfd_m68hc11_arch =
 {
-    16,        /* 16 bits in a word */
-    16,        /* 16 bits in an address */
-    8, /* 8 bits in a byte */
-    bfd_arch_m68hc11,
-    0,
-    "m68hc11",
-    "m68hc11",
-    4, /* section alignment power */
-    TRUE,
-    bfd_default_compatible,
-    bfd_default_scan,
-    bfd_arch_default_fill,
-    0,
+  16,  /* Bits in a word.  */
+  16,  /* Bits in an address.  */
+  8,   /* Bits in a byte.  */
+  bfd_arch_m68hc11,
+  0,
+  "m68hc11",
+  "m68hc11",
+  4, /* Section alignment power.  */
+  TRUE,
+  bfd_default_compatible,
+  bfd_default_scan,
+  bfd_arch_default_fill,
+  NULL,
+  0 /* Maximum offset of a reloc from the start of an insn.  */
 };
index 4d199f25412d970a73211a1e8ae6ca65a2e23375..15b41c75b750ba5fdc4b8781f3555177c1a10bbc 100644 (file)
 #include "bfd.h"
 #include "libbfd.h"
 
+#define N(NUMBER, PRINT, DEFAULT, NEXT)                        \
+  {                                                    \
+    16,        /* Bits in a word.  */                  \
+    32,        /* Bits in an address.  */              \
+    8,        /* Bits in a byte.  */                   \
+    bfd_arch_m68hc12,                                  \
+    NUMBER,                                            \
+    "m68hc12",                                         \
+    PRINT,                                             \
+    4,         /* Section alignment power.  */         \
+    DEFAULT,                                           \
+    bfd_default_compatible,                            \
+    bfd_default_scan,                                  \
+    bfd_arch_default_fill,                             \
+    NEXT,                                              \
+    0 /* Maximum offset of a reloc from the start of an insn.  */ \
+  }
+
 const bfd_arch_info_type bfd_m68hc12s_arch =
-{
-    16,        /* 16 bits in a word */
-    32,        /* 16 bits in an address */
-    8, /* 8 bits in a byte */
-    bfd_arch_m68hc12,
-    bfd_mach_m6812s,
-    "m68hc12:HCS12",
-    "m68hc12",
-    4, /* section alignment power */
-    TRUE,
-    bfd_default_compatible,
-    bfd_default_scan,
-    bfd_arch_default_fill,
-    0,
-};
+  N (bfd_mach_m6812s, "m68hc12:HCS12", FALSE, NULL);
 
 const bfd_arch_info_type bfd_m68hc12_arch =
-{
-    16,        /* 16 bits in a word */
-    32,        /* 16 bits in an address */
-    8, /* 8 bits in a byte */
-    bfd_arch_m68hc12,
-    0,
-    "m68hc12",
-    "m68hc12",
-    4, /* section alignment power */
-    TRUE,
-    bfd_default_compatible,
-    bfd_default_scan,
-    bfd_arch_default_fill,
-    &bfd_m68hc12s_arch,
-};
+  N (bfd_mach_m6812_default, "m68hc12", TRUE, &bfd_m68hc12s_arch);
+
index d42f3b8417ff5864512247545fdaf5db3e5a4f06..b3d3358edeec1d3eb0554c54f7ba0efcf86594ff 100644 (file)
@@ -30,7 +30,7 @@ bfd_m68k_compatible (const bfd_arch_info_type *a,
 
 #define N(name, print,d,next)  \
 {  32, 32, 8, bfd_arch_m68k, name, "m68k",print,2,d,bfd_m68k_compatible, \
-   bfd_default_scan, bfd_arch_default_fill, next, }
+   bfd_default_scan, bfd_arch_default_fill, next, }
 
 static const bfd_arch_info_type arch_info_struct[] =
   {
index e6fbb29f5b4ec36176978c56b4794b67df25f109..4cd4ba1044e9e0321770442f10a3a4f3dcc78229 100644 (file)
 
 const bfd_arch_info_type bfd_m9s12x_arch =
 {
-    16,        /* 16 bits in a word.  */
-    32,        /* 16 bits in an address.  */
-    8, /* 8 bits in a byte.  */
-    bfd_arch_m9s12x,
-    0,
-    "m9s12x",
-    "m9s12x",
-    4, /* Section alignment power.  */
-    TRUE,
-    bfd_default_compatible,
-    bfd_default_scan,
-    bfd_arch_default_fill,
-    0,
+  16,  /* Bits in a word.  */
+  32,  /* Bits in an address.  */
+  8,   /* Bits in a byte.  */
+  bfd_arch_m9s12x,
+  0,
+  "m9s12x",
+  "m9s12x",
+  4,    /* Section alignment power.  */
+  TRUE,
+  bfd_default_compatible,
+  bfd_default_scan,
+  bfd_arch_default_fill,
+  NULL,
+  0     /* Maximum offset of a reloc from the start of an insn.  */
 };
 
index 7e9298c9338a98f3567b7d9d84dc25be6827f4e4..91a4822d1d2341ed0eada91f239b36f92ad861e4 100644 (file)
 
 const bfd_arch_info_type bfd_m9s12xg_arch =
 {
-    16,        /* 16 bits in a word.  */
-    32,        /* 16 bits in an address.  */
-    8, /* 8 bits in a byte.  */
-    bfd_arch_m9s12xg,
-    0,
-    "m9s12xg",
-    "m9s12xg",
-    4, /* Section alignment power.  */
-    TRUE,
-    bfd_default_compatible,
-    bfd_default_scan,
-    bfd_arch_default_fill,
-    0,
+  16,  /* Bits in a word.  */
+  32,  /* Bits in an address.  */
+  8,   /* Bits in a byte.  */
+  bfd_arch_m9s12xg,
+  0,
+  "m9s12xg",
+  "m9s12xg",
+  4,    /* Section alignment power.  */
+  TRUE,
+  bfd_default_compatible,
+  bfd_default_scan,
+  bfd_arch_default_fill,
+  NULL,
+  0    /* Maximum offset of a reloc from the start of an insn.  */
 };
 
index f4ab528dc8ec6f1934a4114978ba335a5ab25153..36c0b63e77fc479fe822e1fb281737bf39666754 100644 (file)
 
 const bfd_arch_info_type bfd_mcore_arch =
 {
-  32,                          /* 32 bits in a word */
-  32,                          /* 32 bits in an address */
-  8,                           /* 8 bits in a byte */
-  bfd_arch_mcore,              /* Architecture */
-  0,                           /* Machine number - 0 for now */
-  "MCore",                     /* Architecture name */
-  "MCore",                     /* Printable name */
-  3,                           /* Section align power */
-  TRUE,                                /* Is this the default architecture ? */
-  bfd_default_compatible,      /* Architecture comparison function */
-  bfd_default_scan,            /* String to architecture conversion */
+  32,                          /* Bits in a word.  */
+  32,                          /* Bits in an address.  */
+  8,                           /* Bits in a byte.  */
+  bfd_arch_mcore,              /* Architecture number.  */
+  0,                           /* Machine number - 0 for now */
+  "MCore",                     /* Architecture name */
+  "MCore",                     /* Machine name.  */
+  3,                           /* Section align power */
+  TRUE,                                /* Is this the default architecture ?  */
+  bfd_default_compatible,      /* Architecture comparison function */
+  bfd_default_scan,            /* String to architecture conversion */
   bfd_arch_default_fill,       /* Default fill.  */
-  NULL                         /* Next in list */
+  NULL,                                /* Next in list */
+  0 /* Maximum offset of a reloc from the start of an insn.  */
 };
index 0e590662964b7fc6bc7ec916f3bcb32693c7d1bf..cc10c662ea48cf30ae6201622b5d77e25aedffae 100644 (file)
@@ -22,8 +22,8 @@
 #include "libbfd.h"
 
 #define MA(x, n, def, y) { 32, 32, 8, bfd_arch_mep, x, "mep", n, \
-       2, def, bfd_default_compatible, bfd_default_scan, \
-       bfd_arch_default_fill, y }
+                          2, def, bfd_default_compatible, bfd_default_scan, \
+                          bfd_arch_default_fill, y, 0 }
 
 static const bfd_arch_info_type bfd_c5_arch = MA (bfd_mach_mep_c5, "c5", FALSE, NULL);
 static const bfd_arch_info_type bfd_h1_arch = MA (bfd_mach_mep_h1, "h1", FALSE, & bfd_c5_arch);
index 3ce116f58a6629d6688ba4839599a9f39326dfc1..60805b808c4f8ac6ce3f530da46273b1705c2ce7 100644 (file)
@@ -37,5 +37,6 @@ const bfd_arch_info_type bfd_metag_arch =
   bfd_default_compatible,      /* Architecture comparison fn.  */
   bfd_default_scan,            /* String to architecture convert fn.  */
   bfd_arch_default_fill,       /* Default fill.  */
-  NULL                         /* Next in list.  */
+  NULL,                                /* Next in list.  */
+  0 /* Maximum offset of a reloc from the start of an insn.  */
 };
index 9bc2eb3de9870b794949699941cc81ccd2b5ad40..4e05d73f01ba673f5b3df0b0eb2fee15421c215c 100644 (file)
 
 const bfd_arch_info_type bfd_microblaze_arch =
 {
-  32,                          /* 32 bits in a word.  */
-  32,                          /* 32 bits in an address.  */
-  8,                           /* 8 bits in a byte.  */
-  bfd_arch_microblaze,         /* Architecture.  */
+  32,                          /* Bits in a word.  */
+  32,                          /* Bits in an address.  */
+  8,                           /* Bits in a byte.  */
+  bfd_arch_microblaze,         /* Architecture number.  */
   0,                           /* Machine number - 0 for now.  */
   "microblaze",                        /* Architecture name.  */
   "MicroBlaze",                        /* Printable name.  */
@@ -37,5 +37,6 @@ const bfd_arch_info_type bfd_microblaze_arch =
   bfd_default_compatible,      /* Architecture comparison function.  */
   bfd_default_scan,            /* String to architecture conversion.  */
   bfd_arch_default_fill,       /* Default fill.  */
-  NULL                         /* Next in list.  */
+  NULL,                                /* Next in list.  */
+  0 /* Maximum offset of a reloc from the start of an insn.  */
 };
index b35949130593bd2e9a71512a9ec103bd37d85a3e..15adcd4e2c874ce34e2fd23bdfa16c85d9dc31eb 100644 (file)
@@ -43,9 +43,9 @@ mips_compatible (const bfd_arch_info_type *a, const bfd_arch_info_type *b)
 
 #define N(BITS_WORD, BITS_ADDR, NUMBER, PRINT, DEFAULT, NEXT)          \
   {                                                    \
-    BITS_WORD, /*  bits in a word */                   \
-    BITS_ADDR, /* bits in an address */                        \
-    8, /* 8 bits in a byte */                          \
+    BITS_WORD,  /* Bits in a word.  */                 \
+    BITS_ADDR,  /* Bits in an address.  */             \
+    8,         /* Bits in a byte.  */                  \
     bfd_arch_mips,                                     \
     NUMBER,                                            \
     "mips",                                            \
@@ -56,6 +56,7 @@ mips_compatible (const bfd_arch_info_type *a, const bfd_arch_info_type *b)
     bfd_default_scan,                                  \
     bfd_arch_default_fill,                             \
     NEXT,                                              \
+    0 /* Maximum offset of a reloc from the start of an insn.  */ \
   }
 
 enum
@@ -150,19 +151,19 @@ static const bfd_arch_info_type arch_info_struct[] =
   N (64, 64, bfd_mach_mipsisa64r5,"mips:isa64r5", FALSE, NN(I_mipsisa64r5)),
   N (64, 64, bfd_mach_mipsisa64r6,"mips:isa64r6", FALSE, NN(I_mipsisa64r6)),
   N (64, 64, bfd_mach_mips_sb1, "mips:sb1",      FALSE, NN(I_sb1)),
-  N (64, 64, bfd_mach_mips_loongson_2e, "mips:loongson_2e",      FALSE, NN(I_loongson_2e)),
-  N (64, 64, bfd_mach_mips_loongson_2f, "mips:loongson_2f",      FALSE, NN(I_loongson_2f)),
+  N (64, 64, bfd_mach_mips_loongson_2e, "mips:loongson_2e", FALSE, NN(I_loongson_2e)),
+  N (64, 64, bfd_mach_mips_loongson_2f, "mips:loongson_2f", FALSE, NN(I_loongson_2f)),
   N (64, 64, bfd_mach_mips_gs464, "mips:gs464",          FALSE, NN(I_gs464)),
-  N (64, 64, bfd_mach_mips_gs464e, "mips:gs464e",        FALSE, NN(I_gs464e)),
-  N (64, 64, bfd_mach_mips_gs264e, "mips:gs264e",        FALSE, NN(I_gs264e)),
+  N (64, 64, bfd_mach_mips_gs464e, "mips:gs464e", FALSE, NN(I_gs464e)),
+  N (64, 64, bfd_mach_mips_gs264e, "mips:gs264e", FALSE, NN(I_gs264e)),
   N (64, 64, bfd_mach_mips_octeon,"mips:octeon",  FALSE, NN(I_mipsocteon)),
-  N (64, 64, bfd_mach_mips_octeonp,"mips:octeon+",  FALSE, NN(I_mipsocteonp)),
-  N (64, 64, bfd_mach_mips_octeon2,"mips:octeon2",  FALSE, NN(I_mipsocteon2)),
-  N (64, 64, bfd_mach_mips_octeon3, "mips:octeon3",  FALSE, NN(I_mipsocteon3)),
-  N (64, 64, bfd_mach_mips_xlr, "mips:xlr",      FALSE, NN(I_xlr)),
+  N (64, 64, bfd_mach_mips_octeonp,"mips:octeon+", FALSE, NN(I_mipsocteonp)),
+  N (64, 64, bfd_mach_mips_octeon2,"mips:octeon2", FALSE, NN(I_mipsocteon2)),
+  N (64, 64, bfd_mach_mips_octeon3, "mips:octeon3", FALSE, NN(I_mipsocteon3)),
+  N (64, 64, bfd_mach_mips_xlr, "mips:xlr",       FALSE, NN(I_xlr)),
   N (32, 32, bfd_mach_mips_interaptiv_mr2, "mips:interaptiv-mr2", FALSE,
      NN(I_interaptiv_mr2)),
-  N (64, 64, bfd_mach_mips_micromips,"mips:micromips",FALSE,0)
+  N (64, 64, bfd_mach_mips_micromips, "mips:micromips", FALSE, NULL)
 };
 
 /* The default architecture is mips:3000, but with a machine number of
index eaacf313775f48c9e3804983283722725d16a4b0..8bedeb2d2ff8dc64141ba511860827066c92ca12 100644 (file)
 
 const bfd_arch_info_type
 bfd_mmix_arch =
- {
-   64,                         /* 64 bits in a word.  */
-   64,                         /* 64 bits in an address.  */
-   8,                          /* 8 bits in a byte.  */
-   bfd_arch_mmix,              /* Architecture.  */
-   0,                          /* Machine number - 0 for now.  */
-   /* Sorry, these are by custom and creeping assumption lower-case.  */
-   "mmix",                     /* Architecture name.  */
-   "mmix",                     /* Printable name.  */
-   3,                          /* Section align power.  */
-   TRUE,                       /* This is the default architecture.  */
-   bfd_default_compatible,     /* Architecture comparison function.  */
-   bfd_default_scan,           /* String to architecture conversion.  */
-   bfd_arch_default_fill,      /* Default fill.  */
-   NULL                                /* Next in list.  */
+{
+  64,                          /* Bits in a word.  */
+  64,                          /* Bits in an address.  */
+  8,                           /* Bits in a byte.  */
+  bfd_arch_mmix,               /* Architecture number.  */
+  0,                           /* Machine number - 0 for now.  */
+  /* Sorry, these are by custom and creeping assumption lower-case.  */
+  "mmix",                      /* Architecture name.  */
+  "mmix",                      /* Printable name.  */
+  3,                           /* Section align power.  */
+  TRUE,                        /* This is the default architecture.  */
+  bfd_default_compatible,      /* Architecture comparison function.  */
+  bfd_default_scan,            /* String to architecture conversion.  */
+  bfd_arch_default_fill,       /* Default fill.  */
+  NULL,                                /* Next in list.  */
+  0 /* Maximum offset of a reloc from the start of an insn.  */
 };
index a3978b6c94611965323e77a32a00a2ca4cfe6ab4..e200e1a4a5b3967c6add0a2243cdd83ffe35184a 100644 (file)
 
 
 const bfd_arch_info_type bfd_moxie_arch =
-  {
-    32,                      /* 32 bits in a word.  */
-    32,                      /* 32 bits in an address.  */
-    8,               /*  8 bits in a byte.  */
-    bfd_arch_moxie,   /* enum bfd_architecture arch.  */
-    bfd_mach_moxie,
-    "moxie",         /* Arch name.  */
-    "moxie",         /* Printable name.  */
-    2,               /* Unsigned int section alignment power.  */
-    TRUE,            /* The one and only.  */
-    bfd_default_compatible,
-    bfd_default_scan,
-    bfd_arch_default_fill,
-    0,
-  };
+{
+  32,                /* Bits in a word.  */
+  32,                /* Bits in an address.  */
+  8,                 /* Bits in a byte.  */
+  bfd_arch_moxie,     /* Architecture Number.  */
+  bfd_mach_moxie,     /* Machine number.  */
+  "moxie",           /* Arch name.  */
+  "moxie",           /* Printable name.  */
+  2,                 /* Section alignment power.  */
+  TRUE,                      /* The one and only.  */
+  bfd_default_compatible,
+  bfd_default_scan,
+  bfd_arch_default_fill,
+  NULL,
+  0 /* Maximum offset of a reloc from the start of an insn.  */
+};
index 2c35e5f138c2cd48b640d0e1c19e6b86b9eca85e..94d570d82cec30a71a92b4cdeba0f6e6b50cc93a 100644 (file)
@@ -43,9 +43,9 @@ compatible (const bfd_arch_info_type * a,
 
 #define N(addr_bits, machine, print, default, next)            \
 {                                                              \
-  16,                          /* 16 bits in a word.  */       \
+  16,                          /* Bits in a word.  */          \
   addr_bits,                   /* Bits in an address.  */      \
-  8,                           /* 8 bits in a byte.  */        \
+  8,                           /* Bits in a byte.  */          \
   bfd_arch_msp430,                                             \
   machine,                     /* Machine number.  */          \
   "msp430",                    /* Architecture name.   */      \
@@ -55,7 +55,8 @@ compatible (const bfd_arch_info_type * a,
   compatible,                                                  \
   bfd_default_scan,                                            \
   bfd_arch_default_fill,                                       \
-  next                                                         \
+  next,                                                                \
+  0 /* Maximum offset of a reloc from the start of an insn.  */ \
 }
 
 static const bfd_arch_info_type arch_info_struct[] =
index 614a80421c1099348b7fdf34fc718da08474b391..c6a320f17c230a2ed901d9a1ee607960ef8abe05 100644 (file)
 #include "bfd.h"
 #include "libbfd.h"
 
-const bfd_arch_info_type arch_info_struct[] =
+#define N(NUMBER, PRINT, DEFAULT, NEXT)                        \
+  {                                                    \
+    32,   /* Bits in a word.  */                       \
+    32,   /* Bits in an address.  */                   \
+    8,   /* Bits in a byte.  */                        \
+    bfd_arch_mt,                                       \
+    NUMBER,                                            \
+    "mt",                                              \
+    PRINT,                                             \
+    1,         /* Section alignment power.  */         \
+    DEFAULT,                                           \
+    bfd_default_compatible,                            \
+    bfd_default_scan,                                  \
+    bfd_arch_default_fill,                             \
+    NEXT,                                              \
+    0 /* Maximum offset of a reloc from the start of an insn.  */ \
+  }
+
+const bfd_arch_info_type arch_info_struct[2] =
 {
-{
-  32,                          /* Bits per word - not really true.  */
-  32,                          /* Bits per address.  */
-  8,                           /* Bits per byte.  */
-  bfd_arch_mt,                 /* Architecture.  */
-  bfd_mach_mrisc2,             /* Machine.  */
-  "mt",                                /* Architecture name.  */
-  "ms1-003",                   /* Printable name.  */
-  1,                           /* Section align power.  */
-  FALSE,                       /* The default ?  */
-  bfd_default_compatible,      /* Architecture comparison fn.  */
-  bfd_default_scan,            /* String to architecture convert fn.  */
-  bfd_arch_default_fill,       /* Default fill.  */
-  &arch_info_struct[1]         /* Next in list.  */
-},
-{
-  32,                          /* Bits per word - not really true.  */
-  32,                          /* Bits per address.  */
-  8,                           /* Bits per byte.  */
-  bfd_arch_mt,                 /* Architecture.  */
-  bfd_mach_ms2,                        /* Machine.  */
-  "mt",                                /* Architecture name.  */
-  "ms2",                       /* Printable name.  */
-  1,                           /* Section align power.  */
-  FALSE,                       /* The default ?  */
-  bfd_default_compatible,      /* Architecture comparison fn.  */
-  bfd_default_scan,            /* String to architecture convert fn.  */
-  bfd_arch_default_fill,       /* Default fill.  */
-  NULL                         /* Next in list.  */
-},
+  N (bfd_mach_mrisc2, "ms1-003", FALSE, arch_info_struct + 1),
+  N (bfd_mach_ms2,    "ms2",     FALSE, NULL)
 };
 
 const bfd_arch_info_type bfd_mt_arch =
-{
-  32,                          /* Bits per word - not really true.  */
-  32,                          /* Bits per address.  */
-  8,                           /* Bits per byte.  */
-  bfd_arch_mt,                 /* Architecture.  */
-  bfd_mach_ms1,                        /* Machine.  */
-  "mt",                                /* Architecture name.  */
-  "ms1",                       /* Printable name.  */
-  1,                           /* Section align power.  */
-  TRUE,                                /* The default ?  */
-  bfd_default_compatible,      /* Architecture comparison fn.  */
-  bfd_default_scan,            /* String to architecture convert fn.  */
-  bfd_arch_default_fill,       /* Default fill.  */
-  &arch_info_struct[0]         /* Next in list.  */
-};
+  N (bfd_mach_ms1,    "ms1",     TRUE, arch_info_struct);
+
 
index 71c27e4d135c51ed80c627208c19d6586a78aaa1..cfa15a033c4d9f8d22846c66dd10d25f78ca5ecf 100644 (file)
@@ -26,7 +26,7 @@
 
 #define N(number, print, default, next)  \
     {32, 32, 8, bfd_arch_nds32, number, "nds32", print, 4, default, \
-     bfd_default_compatible, bfd_default_scan, bfd_arch_default_fill, next }
+     bfd_default_compatible, bfd_default_scan, bfd_arch_default_fill, next, 0 }
 
 #define NEXT           &arch_info_struct[0]
 #define NDS32V2_NEXT   &arch_info_struct[1]
index 767539350fc6e3a43bf00e0182073479aa334a46..a242d7b74a11f024eeed72ff263ec8b2a6f2552a 100644 (file)
@@ -50,13 +50,12 @@ bfd_nfp_compatible (const bfd_arch_info_type * a,
   bfd_nfp_compatible,                                          \
   bfd_default_scan,                                            \
   bfd_arch_default_fill,                                       \
-  next                                                         \
+  next,                                                                \
+  0 /* Maximum offset of a reloc from the start of an insn.  */ \
 }
 
-static const bfd_arch_info_type arch_info_struct[] =
-{
-  N (bfd_mach_nfp3200, "NFP-32xx", FALSE, NULL)
-};
+static const bfd_arch_info_type arch_info_struct =
+  N (bfd_mach_nfp3200, "NFP-32xx", FALSE, NULL);
 
 const bfd_arch_info_type bfd_nfp_arch =
-  N (bfd_mach_nfp6000, "NFP-6xxx", TRUE, &arch_info_struct[0]);
+  N (bfd_mach_nfp6000, "NFP-6xxx", TRUE, &arch_info_struct);
index 485394501fe9dfdadf06df3f1df6d8cc27d863af..907d318447dea9b9045c0d009bb47e4db52f71cb 100644 (file)
@@ -44,11 +44,11 @@ nios2_compatible (const bfd_arch_info_type *a,
   return a;
 }
 
-#define N(BITS_WORD, BITS_ADDR, NUMBER, PRINT, DEFAULT, NEXT)          \
+#define N(NUMBER, PRINT, DEFAULT, NEXT)                        \
   {                                                    \
-    BITS_WORD, /*  bits in a word */                   \
-    BITS_ADDR, /* bits in an address */                        \
-    8, /* 8 bits in a byte */                          \
+    32, /* Bits in a word.  */                         \
+    32, /* Bits in an address.  */                     \
+    8, /* Bits in a byte.  */                          \
     bfd_arch_nios2,                                    \
     NUMBER,                                            \
     "nios2",                                           \
@@ -58,17 +58,18 @@ nios2_compatible (const bfd_arch_info_type *a,
     nios2_compatible,                                  \
     bfd_default_scan,                                  \
     bfd_arch_default_fill,                             \
-    NEXT                                               \
+    NEXT,                                              \
+    0 /* Maximum offset of a reloc from the start of an insn.  */ \
   }
 
 #define NIOS2R1_NEXT &arch_info_struct[0]
 #define NIOS2R2_NEXT &arch_info_struct[1]
 
-static const bfd_arch_info_type arch_info_struct[] =
+static const bfd_arch_info_type arch_info_struct[2] =
 {
-  N (32, 32, bfd_mach_nios2r1, "nios2:r1", FALSE, NIOS2R2_NEXT),
-  N (32, 32, bfd_mach_nios2r2, "nios2:r2", FALSE, NULL),
+  N (bfd_mach_nios2r1, "nios2:r1", FALSE, NIOS2R2_NEXT),
+  N (bfd_mach_nios2r2, "nios2:r2", FALSE, NULL),
 };
 
 const bfd_arch_info_type bfd_nios2_arch =
-  N (32, 32, 0, "nios2", TRUE, NIOS2R1_NEXT);
+  N (bfd_mach_nios2, "nios2", TRUE, NIOS2R1_NEXT);
index c69d93ba6a1e6ea980f1aac9e482db8d96e1f90d..bc6523b7485f4c52202b474b25a1911a116c1fe4 100644 (file)
 #include "ns32k.h"
 
 #define N(machine, printable, d, next)  \
- 32, 32, 8, bfd_arch_ns32k, machine, "ns32k",printable,3,d, \
-   bfd_default_compatible,bfd_default_scan,bfd_arch_default_fill,next, }
+ { 32, 32, 8, bfd_arch_ns32k, machine, "ns32k",printable,3,d, \
+   bfd_default_compatible,bfd_default_scan,bfd_arch_default_fill,next, }
 
 static const bfd_arch_info_type arch_info_struct[] =
 {
-  N(32532,"ns32k:32532",TRUE, 0), /* The word ns32k will match this too.  */
+  N (32532, "ns32k:32532", TRUE, 0), /* The word ns32k will match this too.  */
 };
 
 const bfd_arch_info_type bfd_ns32k_arch =
-  N(32032,"ns32k:32032",FALSE, &arch_info_struct[0]);
+  N (32032, "ns32k:32032", FALSE, &arch_info_struct[0]);
 
 bfd_vma
 _bfd_ns32k_get_displacement (bfd_byte *buffer, int size)
index e6594865aec7222bb09feec52e535f1d92750089..cd9fda376e64d308bd64161e343a61d9b2a135e5 100644 (file)
 #include "bfd.h"
 #include "libbfd.h"
 
-const bfd_arch_info_type bfd_or1k_arch;
-const bfd_arch_info_type bfd_or1knd_arch;
+#define N(NUMBER, PRINT, DEFAULT, NEXT)                        \
+  {                                                    \
+    32,     /* Bits in a word.  */                     \
+    32,     /* Bits in an address.  */                 \
+    8,     /* Bits in a byte.  */                      \
+    bfd_arch_or1k,                                     \
+    NUMBER,                                            \
+    PRINT,                                             \
+    PRINT,                                             \
+    4,         /* Section alignment power.  */         \
+    DEFAULT,                                           \
+    bfd_default_compatible,                            \
+    bfd_default_scan,                                  \
+    bfd_arch_default_fill,                             \
+    NEXT,                                              \
+    0 /* Maximum offset of a reloc from the start of an insn.  */ \
+  }
 
-const bfd_arch_info_type bfd_or1k_arch =
-  {
-    32,                  /* 32 bits in a word.  */
-    32,                  /* 32 bits in an address.  */
-    8,           /* 8 bits in a byte.  */
-    bfd_arch_or1k,
-    bfd_mach_or1k,
-    "or1k",
-    "or1k",
-    4,
-    TRUE,
-    bfd_default_compatible,
-    bfd_default_scan,
-    bfd_arch_default_fill,
-    &bfd_or1knd_arch,
-  };
 
 const bfd_arch_info_type bfd_or1knd_arch =
-  {
-    32,                  /* 32 bits in a word.  */
-    32,                  /* 32 bits in an address.  */
-    8,           /* 8 bits in a byte.  */
-    bfd_arch_or1k,
-    bfd_mach_or1knd,
-    "or1knd",
-    "or1knd",
-    4,
-    FALSE,
-    bfd_default_compatible,
-    bfd_default_scan,
-    bfd_arch_default_fill,
-    NULL,
-  };
+  N (bfd_mach_or1knd, "or1knd", FALSE, NULL);
+
+const bfd_arch_info_type bfd_or1k_arch =
+  N (bfd_mach_or1k, "or1k", TRUE, &bfd_or1knd_arch);
index d42f7f867003aa67c751bdf2cafd71800c9a9852..0d6a50c266a253269845ba89cd84e51c8c90a816 100644 (file)
 #include "libbfd.h"
 
 const bfd_arch_info_type bfd_pdp11_arch =
-  {
-    16,        /* 16 bits in a word */
-    16,        /* 16 bits in an address */
-    8, /* 8 bits in a byte */
-    bfd_arch_pdp11,
-    0, /* only 1 machine */
-    "pdp11",
-    "pdp11",
-    1,         /* alignment = 16 bit */
-    TRUE, /* the one and only */
-    bfd_default_compatible,
-    bfd_default_scan,
-    bfd_arch_default_fill,
-    0,
-  };
+{
+  16,  /* Bits in a word.  */
+  16,  /* Bits in an address.  */
+  8,   /* Bits in a byte.  */
+  bfd_arch_pdp11,
+  0,   /* Only 1 machine.  */
+  "pdp11",
+  "pdp11",
+  1,   /* Alignment = 16 bit.  */
+  TRUE, /* The one and only.  */
+  bfd_default_compatible,
+  bfd_default_scan,
+  bfd_arch_default_fill,
+  NULL,
+  0 /* Maximum offset of a reloc from the start of an insn.  */
+};
 
index b0a092304ab0abbaa507df82713f81e0f32393a4..cf5f491e3eb8aaf944d94ce249a9fbaff4dd4a1a 100644 (file)
 
 const bfd_arch_info_type bfd_pj_arch =
 {
-  32,                          /* 32 bits in a word */
-  32,                          /* 32 bits in an address */
-  8,                           /* 8 bits in a byte */
+  32,                          /* Bits in a word.  */
+  32,                          /* Bits in an address.  */
+  8,                           /* Bits in a byte.  */
   bfd_arch_pj,
   0,
-  "pj",                                /* arch_name  */
-  "pj",                                /* printable name */
+  "pj",                                /* Arch_name.  */
+  "pj",                                /* Printable name.  */
   1,
-  TRUE,                                /* the default machine */
+  TRUE,                                /* The default machine.  */
   bfd_default_compatible,
   bfd_default_scan,
   bfd_arch_default_fill,
-  0
+  NULL,
+  0 /* Maximum offset of a reloc from the start of an insn.  */
 };
index 044f74c01436213a6ad2fd3b639660f51af4698a..53f0c234577d03e4e6f1afe62daba0616ec9a201 100644 (file)
@@ -24,9 +24,9 @@
 
 const bfd_arch_info_type bfd_plugin_arch =
 {
-  32,  /* 32 bits in a word.  */
-  32,  /* 32 bits in an address.  */
-  8,   /* 8 bits in a byte.  */
+  32,  /* Bits in a word.  */
+  32,  /* Bits in an address.  */
+  8,   /* Bits in a byte.  */
   bfd_arch_plugin,
   0,   /* Only 1 machine.  */
   "plugin",
@@ -36,5 +36,6 @@ const bfd_arch_info_type bfd_plugin_arch =
   bfd_default_compatible,
   bfd_default_scan,
   bfd_arch_default_fill,
-  0
+  NULL,
+  0 /* Maximum offset of a reloc from the start of an insn.  */
 };
index bfe4868159294c274034ca4b0298144f1ed82665..49594678d3a4319b8923996e0db1ef01e8df7772 100644 (file)
@@ -48,375 +48,74 @@ powerpc_compatible (const bfd_arch_info_type *a,
   /*NOTREACHED*/
 }
 
+#define N(BITS, NUMBER, PRINT, DEFAULT, NEXT)          \
+  {                                                    \
+    BITS,      /* Bits in a word.  */                  \
+    BITS,      /* Bits in an address.  */              \
+    8,        /* Bits in a byte.  */                   \
+    bfd_arch_powerpc,                                  \
+    NUMBER,                                            \
+    "powerpc",                                         \
+    PRINT,                                             \
+    3,         /* Section alignment power.  */         \
+    DEFAULT,                                           \
+    powerpc_compatible,                                        \
+    bfd_default_scan,                                  \
+    bfd_arch_default_fill,                             \
+    NEXT,                                              \
+    0 /* Maximum offset of a reloc from the start of an insn.  */ \
+  }
+
 const bfd_arch_info_type bfd_powerpc_archs[] =
 {
 #if BFD_DEFAULT_TARGET_SIZE == 64
-  /* Default arch must come first.  */
-  {
-    64,        /* 64 bits in a word */
-    64,        /* 64 bits in an address */
-    8, /* 8 bits in a byte */
-    bfd_arch_powerpc,
-    bfd_mach_ppc64,
-    "powerpc",
-    "powerpc:common64",
-    3,
-    TRUE, /* default for 64 bit target */
-    powerpc_compatible,
-    bfd_default_scan,
-    bfd_arch_default_fill,
-    &bfd_powerpc_archs[1]
-  },
+  /* Default for 64 bit target.  */
+  N (64, bfd_mach_ppc64, "powerpc:common64", TRUE, bfd_powerpc_archs + 1),
   /* elf32-ppc:ppc_elf_object_p relies on the default 32 bit arch
      being immediately after the 64 bit default.  */
-  {
-    32,        /* 32 bits in a word */
-    32,        /* 32 bits in an address */
-    8, /* 8 bits in a byte */
-    bfd_arch_powerpc,
-    bfd_mach_ppc, /* for the POWER/PowerPC common architecture */
-    "powerpc",
-    "powerpc:common",
-    3,
-    FALSE,
-    powerpc_compatible,
-    bfd_default_scan,
-    bfd_arch_default_fill,
-    &bfd_powerpc_archs[2],
-  },
+  N (32, bfd_mach_ppc, "powerpc:common", FALSE, bfd_powerpc_archs + 2),
 #else
   /* Default arch must come first.  */
-  {
-    32,        /* 32 bits in a word */
-    32,        /* 32 bits in an address */
-    8, /* 8 bits in a byte */
-    bfd_arch_powerpc,
-    bfd_mach_ppc, /* for the POWER/PowerPC common architecture */
-    "powerpc",
-    "powerpc:common",
-    3,
-    TRUE, /* default for 32 bit target */
-    powerpc_compatible,
-    bfd_default_scan,
-    bfd_arch_default_fill,
-    &bfd_powerpc_archs[1],
-  },
+  N (32, bfd_mach_ppc, "powerpc:common", TRUE, bfd_powerpc_archs + 1),
   /* elf64-ppc:ppc64_elf_object_p relies on the default 64 bit arch
      being immediately after the 32 bit default.  */
-  {
-    64,        /* 64 bits in a word */
-    64,        /* 64 bits in an address */
-    8, /* 8 bits in a byte */
-    bfd_arch_powerpc,
-    bfd_mach_ppc64,
-    "powerpc",
-    "powerpc:common64",
-    3,
-    FALSE,
-    powerpc_compatible,
-    bfd_default_scan,
-    bfd_arch_default_fill,
-    &bfd_powerpc_archs[2]
-  },
+  N (64, bfd_mach_ppc64, "powerpc:common64", FALSE, bfd_powerpc_archs + 2),
 #endif
+  N (32, bfd_mach_ppc_603,      "powerpc:603",     FALSE, bfd_powerpc_archs + 3),
+  N (32, bfd_mach_ppc_ec603e,   "powerpc:EC603e",  FALSE, bfd_powerpc_archs + 4),
+  N (32, bfd_mach_ppc_604,      "powerpc:604",     FALSE, bfd_powerpc_archs + 5),
+  N (32, bfd_mach_ppc_403,      "powerpc:403",     FALSE, bfd_powerpc_archs + 6),
+  N (32, bfd_mach_ppc_601,      "powerpc:601",     FALSE, bfd_powerpc_archs + 7),
+  N (64, bfd_mach_ppc_620,      "powerpc:620",     FALSE, bfd_powerpc_archs + 8),
+  N (64, bfd_mach_ppc_630,      "powerpc:630",     FALSE, bfd_powerpc_archs + 9),
+  N (64, bfd_mach_ppc_a35,      "powerpc:a35",     FALSE, bfd_powerpc_archs + 10),
+  N (64, bfd_mach_ppc_rs64ii,   "powerpc:rs64ii",  FALSE, bfd_powerpc_archs + 11),
+  N (64, bfd_mach_ppc_rs64iii,  "powerpc:rs64iii", FALSE, bfd_powerpc_archs + 12),
+  N (32, bfd_mach_ppc_7400,     "powerpc:7400",    FALSE, bfd_powerpc_archs + 13),
+  N (32, bfd_mach_ppc_e500,     "powerpc:e500",    FALSE, bfd_powerpc_archs + 14),
+  N (32, bfd_mach_ppc_e500mc,   "powerpc:e500mc",  FALSE, bfd_powerpc_archs + 15),
+  N (64, bfd_mach_ppc_e500mc64, "powerpc:e500mc64",FALSE, bfd_powerpc_archs + 16),
+  N (32, bfd_mach_ppc_860,      "powerpc:MPC8XX",  FALSE, bfd_powerpc_archs + 17),
+  N (32, bfd_mach_ppc_750,      "powerpc:750",     FALSE, bfd_powerpc_archs + 18),
+  N (32, bfd_mach_ppc_titan,    "powerpc:titan",   FALSE, bfd_powerpc_archs + 19),
+
   {
-    32,        /* 32 bits in a word */
-    32,        /* 32 bits in an address */
-    8, /* 8 bits in a byte */
-    bfd_arch_powerpc,
-    bfd_mach_ppc_603,
-    "powerpc",
-    "powerpc:603",
-    3,
-    FALSE, /* not the default */
-    powerpc_compatible,
-    bfd_default_scan,
-    bfd_arch_default_fill,
-    &bfd_powerpc_archs[3]
-  },
-  {
-    32,        /* 32 bits in a word */
-    32,        /* 32 bits in an address */
-    8, /* 8 bits in a byte */
-    bfd_arch_powerpc,
-    bfd_mach_ppc_ec603e,
-    "powerpc",
-    "powerpc:EC603e",
-    3,
-    FALSE, /* not the default */
-    powerpc_compatible,
-    bfd_default_scan,
-    bfd_arch_default_fill,
-    &bfd_powerpc_archs[4]
-  },
-  {
-    32,        /* 32 bits in a word */
-    32,        /* 32 bits in an address */
-    8, /* 8 bits in a byte */
-    bfd_arch_powerpc,
-    bfd_mach_ppc_604,
-    "powerpc",
-    "powerpc:604",
-    3,
-    FALSE, /* not the default */
-    powerpc_compatible,
-    bfd_default_scan,
-    bfd_arch_default_fill,
-    &bfd_powerpc_archs[5]
-  },
-  {
-    32,        /* 32 bits in a word */
-    32,        /* 32 bits in an address */
-    8, /* 8 bits in a byte */
-    bfd_arch_powerpc,
-    bfd_mach_ppc_403,
-    "powerpc",
-    "powerpc:403",
-    3,
-    FALSE, /* not the default */
-    powerpc_compatible,
-    bfd_default_scan,
-    bfd_arch_default_fill,
-    &bfd_powerpc_archs[6]
-  },
-  {
-    32,        /* 32 bits in a word */
-    32,        /* 32 bits in an address */
-    8, /* 8 bits in a byte */
-    bfd_arch_powerpc,
-    bfd_mach_ppc_601,
-    "powerpc",
-    "powerpc:601",
-    3,
-    FALSE, /* not the default */
-    powerpc_compatible,
-    bfd_default_scan,
-    bfd_arch_default_fill,
-    &bfd_powerpc_archs[7]
-  },
-  {
-    64,        /* 64 bits in a word */
-    64,        /* 64 bits in an address */
-    8, /* 8 bits in a byte */
-    bfd_arch_powerpc,
-    bfd_mach_ppc_620,
-    "powerpc",
-    "powerpc:620",
-    3,
-    FALSE, /* not the default */
-    powerpc_compatible,
-    bfd_default_scan,
-    bfd_arch_default_fill,
-    &bfd_powerpc_archs[8]
-  },
-  {
-    64,        /* 64 bits in a word */
-    64,        /* 64 bits in an address */
-    8, /* 8 bits in a byte */
-    bfd_arch_powerpc,
-    bfd_mach_ppc_630,
-    "powerpc",
-    "powerpc:630",
-    3,
-    FALSE, /* not the default */
-    powerpc_compatible,
-    bfd_default_scan,
-    bfd_arch_default_fill,
-    &bfd_powerpc_archs[9]
-  },
-  {
-    64,        /* 64 bits in a word */
-    64,        /* 64 bits in an address */
-    8, /* 8 bits in a byte */
-    bfd_arch_powerpc,
-    bfd_mach_ppc_a35,
-    "powerpc",
-    "powerpc:a35",
-    3,
-    FALSE, /* not the default */
-    powerpc_compatible,
-    bfd_default_scan,
-    bfd_arch_default_fill,
-    &bfd_powerpc_archs[10]
-  },
-  {
-    64,        /* 64 bits in a word */
-    64,        /* 64 bits in an address */
-    8, /* 8 bits in a byte */
-    bfd_arch_powerpc,
-    bfd_mach_ppc_rs64ii,
-    "powerpc",
-    "powerpc:rs64ii",
-    3,
-    FALSE, /* not the default */
-    powerpc_compatible,
-    bfd_default_scan,
-    bfd_arch_default_fill,
-    &bfd_powerpc_archs[11]
-  },
-  {
-    64,        /* 64 bits in a word */
-    64,        /* 64 bits in an address */
-    8, /* 8 bits in a byte */
-    bfd_arch_powerpc,
-    bfd_mach_ppc_rs64iii,
-    "powerpc",
-    "powerpc:rs64iii",
-    3,
-    FALSE, /* not the default */
-    powerpc_compatible,
-    bfd_default_scan,
-    bfd_arch_default_fill,
-    &bfd_powerpc_archs[12]
-  },
-  {
-    32,        /* 32 bits in a word */
-    32,        /* 32 bits in an address */
-    8, /* 8 bits in a byte */
-    bfd_arch_powerpc,
-    bfd_mach_ppc_7400,
-    "powerpc",
-    "powerpc:7400",
-    3,
-    FALSE, /* not the default */
-    powerpc_compatible,
-    bfd_default_scan,
-    bfd_arch_default_fill,
-    &bfd_powerpc_archs[13]
-  },
-  {
-    32,        /* 32 bits in a word */
-    32,        /* 32 bits in an address */
-    8, /* 8 bits in a byte */
-    bfd_arch_powerpc,
-    bfd_mach_ppc_e500,
-    "powerpc",
-    "powerpc:e500",
-    3,
-    FALSE,
-    powerpc_compatible,
-    bfd_default_scan,
-    bfd_arch_default_fill,
-    &bfd_powerpc_archs[14]
-  },
-  {
-    32,        /* 32 bits in a word */
-    32,        /* 32 bits in an address */
-    8, /* 8 bits in a byte */
-    bfd_arch_powerpc,
-    bfd_mach_ppc_e500mc,
-    "powerpc",
-    "powerpc:e500mc",
-    3,
-    FALSE, /* not the default */
-    powerpc_compatible,
-    bfd_default_scan,
-    bfd_arch_default_fill,
-    &bfd_powerpc_archs[15]
-  },
-  {
-    64,        /* 64 bits in a word */
-    64,        /* 64 bits in an address */
-    8, /* 8 bits in a byte */
-    bfd_arch_powerpc,
-    bfd_mach_ppc_e500mc64,
-    "powerpc",
-    "powerpc:e500mc64",
-    3,
-    FALSE, /* not the default */
-    powerpc_compatible,
-    bfd_default_scan,
-    bfd_arch_default_fill,
-    &bfd_powerpc_archs[16]
-  },
-  {
-    32,        /* 32 bits in a word */
-    32,        /* 32 bits in an address */
-    8, /* 8 bits in a byte */
-    bfd_arch_powerpc,
-    bfd_mach_ppc_860,
-    "powerpc",
-    "powerpc:MPC8XX",
-    3,
-    FALSE, /* not the default */
-    powerpc_compatible,
-    bfd_default_scan,
-    bfd_arch_default_fill,
-    &bfd_powerpc_archs[17]
-  },
-  {
-    32,        /* 32 bits in a word */
-    32,        /* 32 bits in an address */
-    8, /* 8 bits in a byte */
-    bfd_arch_powerpc,
-    bfd_mach_ppc_750,
-    "powerpc",
-    "powerpc:750",
-    3,
-    FALSE, /* not the default */
-    powerpc_compatible,
-    bfd_default_scan,
-    bfd_arch_default_fill,
-    &bfd_powerpc_archs[18]
-  },
-  {
-    32,        /* 32 bits in a word */
-    32,        /* 32 bits in an address */
-    8, /* 8 bits in a byte */
-    bfd_arch_powerpc,
-    bfd_mach_ppc_titan,
-    "powerpc",
-    "powerpc:titan",
-    3,
-    FALSE, /* not the default */
-    powerpc_compatible,
-    bfd_default_scan,
-    bfd_arch_default_fill,
-    &bfd_powerpc_archs[19]
-  },
-  {
-    16,        /* 16 or 32 bits in a word */
-    32,        /* 32 bits in an address */
-    8, /* 8 bits in a byte */
+    16,        /* Bits in a word.  */
+    32,        /* Bits in an address.  */
+    8, /* Bits in a byte.  */
     bfd_arch_powerpc,
     bfd_mach_ppc_vle,
     "powerpc",
     "powerpc:vle",
     3,
-    FALSE, /* not the default */
+    FALSE, /* Not the default.  */
     powerpc_compatible,
     bfd_default_scan,
     bfd_arch_default_fill,
-    &bfd_powerpc_archs[20]
+    bfd_powerpc_archs + 20,
+    0 /* Maximum offset of a reloc from the start of an insn.  */
   },
-  {
-    64,        /* 64 bits in a word */
-    64,        /* 64 bits in an address */
-    8, /* 8 bits in a byte */
-    bfd_arch_powerpc,
-    bfd_mach_ppc_e5500,
-    "powerpc",
-    "powerpc:e5500",
-    3,
-    FALSE, /* not the default */
-    powerpc_compatible,
-    bfd_default_scan,
-    bfd_arch_default_fill,
-    &bfd_powerpc_archs[21]
-  },
-  {
-    64,        /* 64 bits in a word */
-    64,        /* 64 bits in an address */
-    8, /* 8 bits in a byte */
-    bfd_arch_powerpc,
-    bfd_mach_ppc_e6500,
-    "powerpc",
-    "powerpc:e6500",
-    3,
-    FALSE, /* not the default */
-    powerpc_compatible,
-    bfd_default_scan,
-    bfd_arch_default_fill,
-    0
-  }
+
+  N (64, bfd_mach_ppc_e5500, "powerpc:e5500", FALSE, bfd_powerpc_archs + 21),
+  N (64, bfd_mach_ppc_e6500, "powerpc:e6500", FALSE, NULL)
 };
index b0feb9d6d9797196a8f989f00ab924fb6566affe..99be27eca5e7d7f68bf1a8b44fc7edfc77700427 100644 (file)
@@ -37,7 +37,8 @@
     bfd_default_compatible,                            \
     bfd_default_scan,                                  \
     bfd_arch_default_fill,                             \
-    NEXT                                               \
+    NEXT,                                              \
+    0 /* Maximum offset of a reloc from the start of an insn.  */ \
   }
 
 const bfd_arch_info_type bfd_pru_arch = N (32, 32, 0, "pru", TRUE, NULL);
index 153a84e88354addec75e2ce2c170f57e4b232a62..aca7ade0af3e879eea4f5dd963effc2bd30759fd 100644 (file)
@@ -39,11 +39,11 @@ riscv_compatible (const bfd_arch_info_type *a, const bfd_arch_info_type *b)
   return a;
 }
 
-#define N(BITS_WORD, BITS_ADDR, NUMBER, PRINT, DEFAULT, NEXT)  \
+#define N(BITS, NUMBER, PRINT, DEFAULT, NEXT)                  \
   {                                                            \
-    BITS_WORD, /*  bits in a word */                           \
-    BITS_ADDR, /* bits in an address */                                \
-    8, /* 8 bits in a byte */                                  \
+    BITS,      /* Bits in a word.  */                          \
+    BITS,      /* Bits in an address.  */                      \
+    8,        /* Bits in a byte.  */                           \
     bfd_arch_riscv,                                            \
     NUMBER,                                                    \
     "riscv",                                                   \
@@ -54,6 +54,7 @@ riscv_compatible (const bfd_arch_info_type *a, const bfd_arch_info_type *b)
     bfd_default_scan,                                          \
     bfd_arch_default_fill,                                     \
     NEXT,                                                      \
+    0 /* Maximum offset of a reloc from the start of an insn.  */\
   }
 
 /* This enum must be kept in the same order as arch_info_struct.  */
@@ -69,11 +70,11 @@ enum
    and each entry except the last should end with NN (my enum value).  */
 static const bfd_arch_info_type arch_info_struct[] =
 {
-  N (64, 64, bfd_mach_riscv64, "riscv:rv64", FALSE, NN (I_riscv64)),
-  N (32, 32, bfd_mach_riscv32, "riscv:rv32", FALSE, 0)
+  N (64, bfd_mach_riscv64, "riscv:rv64", FALSE, NN (I_riscv64)),
+  N (32, bfd_mach_riscv32, "riscv:rv32", FALSE, NULL)
 };
 
 /* The default architecture is riscv:rv64.  */
 
 const bfd_arch_info_type bfd_riscv_arch =
-  N (64, 64, 0, "riscv", TRUE, &arch_info_struct[0]);
+  N (64, 0, "riscv", TRUE, &arch_info_struct[0]);
index 5d4c770c080a2c2520abb9c505a7b5d9705fe1a8..acc4ab91c657c69faad3ab1280a7ee63bb051142 100644 (file)
@@ -36,5 +36,6 @@ const bfd_arch_info_type bfd_rl78_arch =
   bfd_default_compatible,      /* Architecture comparison fn.  */
   bfd_default_scan,            /* String to architecture convert fn.  */
   bfd_arch_default_fill,       /* Default fill.  */
-  NULL                         /* Next in list.  */
+  NULL,                                /* Next in list.  */
+  0 /* Maximum offset of a reloc from the start of an insn.  */
 };
index d798d0eaaa0243a40f1f5912ad83f5270a309bdd..46ecca924705bfda0fdbce5c8e4abdb1da812ebe 100644 (file)
@@ -46,68 +46,30 @@ rs6000_compatible (const bfd_arch_info_type *a,
   /*NOTREACHED*/
 }
 
-static const bfd_arch_info_type arch_info_struct[] =
-{
-  {
-    32,        /* 32 bits in a word */
-    32,        /* 32 bits in an address */
-    8, /* 8 bits in a byte */
-    bfd_arch_rs6000,
-    bfd_mach_rs6k_rs1,
-    "rs6000",
-    "rs6000:rs1",
-    3,
-    FALSE, /* not the default */
-    rs6000_compatible,
-    bfd_default_scan,
-    bfd_arch_default_fill,
-    &arch_info_struct[1]
-  },
-  {
-    32,        /* 32 bits in a word */
-    32,        /* 32 bits in an address */
-    8, /* 8 bits in a byte */
-    bfd_arch_rs6000,
-    bfd_mach_rs6k_rsc,
-    "rs6000",
-    "rs6000:rsc",
-    3,
-    FALSE, /* not the default */
-    rs6000_compatible,
-    bfd_default_scan,
-    bfd_arch_default_fill,
-    &arch_info_struct[2]
-  },
-  {
-    32,        /* 32 bits in a word */
-    32,        /* 32 bits in an address */
-    8, /* 8 bits in a byte */
-    bfd_arch_rs6000,
-    bfd_mach_rs6k_rs2,
-    "rs6000",
-    "rs6000:rs2",
-    3,
-    FALSE, /* not the default */
-    rs6000_compatible,
-    bfd_default_scan,
-    bfd_arch_default_fill,
-    0
+#define N(NUMBER, PRINT, DEFAULT, NEXT)                        \
+  {                                                    \
+    32,        /* Bits in a word.  */                  \
+    32,        /* Bits in an address.  */              \
+    8,        /* Bits in a byte.  */                   \
+    bfd_arch_rs6000,                                   \
+    NUMBER,                                            \
+    "rs6000",                                          \
+    PRINT,                                             \
+    3,         /* Section alignment power.  */         \
+    DEFAULT,                                           \
+    rs6000_compatible,                                 \
+    bfd_default_scan,                                  \
+    bfd_arch_default_fill,                             \
+    NEXT,                                              \
+    0 /* Maximum offset of a reloc from the start of an insn.  */ \
   }
+
+static const bfd_arch_info_type arch_info_struct[3] =
+{
+  N (bfd_mach_rs6k_rs1, "rs6000:rs1", FALSE, arch_info_struct + 1),
+  N (bfd_mach_rs6k_rsc, "rs6000:rsc", FALSE, arch_info_struct + 2),
+  N (bfd_mach_rs6k_rs2, "rs6000:rs2", FALSE, NULL)
 };
 
 const bfd_arch_info_type bfd_rs6000_arch =
-  {
-    32,        /* 32 bits in a word */
-    32,        /* 32 bits in an address */
-    8, /* 8 bits in a byte */
-    bfd_arch_rs6000,
-    bfd_mach_rs6k,     /* POWER common architecture */
-    "rs6000",
-    "rs6000:6000",
-    3,
-    TRUE, /* the default */
-    rs6000_compatible,
-    bfd_default_scan,
-    bfd_arch_default_fill,
-    &arch_info_struct[0]
-  };
+  N (bfd_mach_rs6k, "rs6000:6000", TRUE, arch_info_struct + 0);
index 821edeb590b0f679db75a8578712f2a4dc1c66d6..ecdb98ff59a891af35bcd9d563ad88f7a4edde29 100644 (file)
 #include "bfd.h"
 #include "libbfd.h"
 
-static const bfd_arch_info_type arch_info_struct[] =
+#define N(mach, name, align, def, next)                                \
+  { 32, 32, 8, bfd_arch_rx, mach, "rx", name, align, def,      \
+    bfd_default_compatible, bfd_default_scan,                  \
+    bfd_arch_default_fill, next, 0 }
+
+static const bfd_arch_info_type arch_info_struct[3] =
 {
-  {
-    32,                                /* Bits per word.  */
-    32,                                /* Bits per address.  */
-    8,                         /* Bits per byte.  */
-    bfd_arch_rx,               /* Architecture.  */
-    bfd_mach_rx,               /* Machine.  */
-    "rx",                      /* Architecture name.  */
-    "rx",                      /* Printable name.  */
-    3,                         /* Section align power.  */
-    FALSE,                     /* The default ?  */
-    bfd_default_compatible,    /* Architecture comparison fn.  */
-    bfd_default_scan,          /* String to architecture convert fn.  */
-    bfd_arch_default_fill,     /* Default fill.  */
-    &arch_info_struct[1]       /* Next in list.  */
-  },
-  {
-    32,                                /* Bits per word.  */
-    32,                                /* Bits per address.  */
-    8,                         /* Bits per byte.  */
-    bfd_arch_rx,               /* Architecture.  */
-    bfd_mach_rx_v2,            /* Machine.  */
-    "rx:v2",                   /* Architecture name.  */
-    "rx:v2",                   /* Printable name.  */
-    3,                         /* Section align power.  */
-    FALSE,                     /* The default ?  */
-    bfd_default_compatible,    /* Architecture comparison fn.  */
-    bfd_default_scan,          /* String to architecture convert fn.  */
-    bfd_arch_default_fill,     /* Default fill.  */
-    &arch_info_struct[2]       /* Next in list.  */
-  },
-  {
-    32,                                /* Bits per word.  */
-    32,                                /* Bits per address.  */
-    8,                         /* Bits per byte.  */
-    bfd_arch_rx,               /* Architecture.  */
-    bfd_mach_rx_v3,            /* Machine.  */
-    "rx:v3",                   /* Architecture name.  */
-    "rx:v3",                   /* Printable name.  */
-    3,                         /* Section align power.  */
-    FALSE,                     /* The default ?  */
-    bfd_default_compatible,    /* Architecture comparison fn.  */
-    bfd_default_scan,          /* String to architecture convert fn.  */
-    bfd_arch_default_fill,     /* Default fill.  */
-    NULL                       /* Next in list.  */
-  },
+  N (bfd_mach_rx,    "rx",    3, FALSE, arch_info_struct + 1),
+  N (bfd_mach_rx_v2, "rx:v2", 3, FALSE, arch_info_struct + 2),
+  N (bfd_mach_rx_v3, "rx:v3", 3, FALSE, NULL)
 };
 
 const bfd_arch_info_type bfd_rx_arch =
-{
-  32,                          /* Bits per word.  */
-  32,                          /* Bits per address.  */
-  8,                           /* Bits per byte.  */
-  bfd_arch_rx,                 /* Architecture.  */
-  bfd_mach_rx,                 /* Machine.  */
-  "rx",                                /* Architecture name.  */
-  "rx",                                /* Printable name.  */
-  4,                           /* Section align power.  */
-  TRUE,                                /* The default ?  */
-  bfd_default_compatible,      /* Architecture comparison fn.  */
-  bfd_default_scan,            /* String to architecture convert fn.  */
-  bfd_arch_default_fill,       /* Default fill.  */
-  & arch_info_struct[0],       /* Next in list.  */
-};
+  N (bfd_mach_rx,    "rx",    4, TRUE, arch_info_struct + 0);
+
index 13263598585143b608de6fccf588ccb9d8024423..4ad2eafbb15e3435805d1f8663ce258153cb581e 100644 (file)
 
 const bfd_arch_info_type bfd_s12z_arch =
 {
-    16,        /* 16 bits in a word.  */
-    24,        /* 24 bits in an address.  */
-    8, /* 8 bits in a byte.  */
-    bfd_arch_s12z,
-    0,
-    "s12z",
-    "s12z",
-    4, /* Section alignment power.  */
-    TRUE,
-    bfd_default_compatible,
-    bfd_default_scan,
-    bfd_arch_default_fill,
-    0,
+  16,  /* Bits in a word.  */
+  24,  /* Bits in an address.  */
+  8,   /* Bits in a byte.  */
+  bfd_arch_s12z,
+  0,
+  "s12z",
+  "s12z",
+  4,    /* Section alignment power.  */
+  TRUE,
+  bfd_default_compatible,
+  bfd_default_scan,
+  bfd_arch_default_fill,
+  NULL,
+  0    /* Maximum offset of a reloc from the start of an insn.  */
 };
 
index 8e379364c7d256ba81395da1d3536718ba5d44be..f906472435d98d148c6ef4d8c3a1c8bf051e8b62 100644 (file)
 
 #define N(bits, number, print, is_default, next)       \
   {                                                    \
-    bits,             /* bits in a word */             \
-    bits,             /* bits in an address */         \
-    8,                /* bits in a byte */             \
+    bits,             /* Bits in a word.  */           \
+    bits,             /* Bits in an address.  */       \
+    8,                /* Bits in a byte.  */           \
     bfd_arch_s390,                                     \
     number,                                            \
     "s390",                                            \
     print,                                             \
-    3,                /* section alignment power */    \
+    3,                /* Section alignment power */    \
     is_default,                                                \
     bfd_default_compatible,                            \
     bfd_default_scan,                                  \
     bfd_arch_default_fill,                             \
-    next                                               \
+    next,                                              \
+    0 /* Maximum offset of a reloc from the start of an insn.  */ \
   }
 
 #if BFD_DEFAULT_TARGET_SIZE == 64
index 576e9adbdaba0fea674405ecb054372e61c8b3d9..5bf9c6bdf26faf2db4a056a8b853210c97f4c045 100644 (file)
@@ -43,11 +43,11 @@ compatible (const bfd_arch_info_type * a, const bfd_arch_info_type * b)
   return a;
 }
 
-#define N(addr_bits, machine, print, default, next)            \
+#define N(machine, print, default, next)                       \
 {                                                              \
-  32,                          /* 16 bits in a word.  */       \
+  32,                          /* Bits in a word.  */          \
   32,                          /* Bits in an address.  */      \
-  8,                           /* 8 bits in a byte.  */        \
+  8,                           /* Bits in a byte.  */          \
   bfd_arch_score,                                              \
   machine,                     /* Machine number.  */          \
   "score",                     /* Architecture name.   */      \
@@ -57,13 +57,14 @@ compatible (const bfd_arch_info_type * a, const bfd_arch_info_type * b)
   compatible,                                                  \
   bfd_default_scan,                                            \
   bfd_arch_default_fill,                                       \
-  next                                                         \
+  next,                                                                \
+  0 /* Maximum offset of a reloc from the start of an insn.  */ \
 }
 
 static const bfd_arch_info_type arch_info_struct[] =
 {
-  N (16, bfd_mach_score3, "score3", FALSE, NULL),
+  N (bfd_mach_score3, "score3", FALSE, NULL),
 };
 
 const bfd_arch_info_type bfd_score_arch =
-  N (16, bfd_mach_score7, "score7", TRUE, & arch_info_struct[0]);
+  N (bfd_mach_score7, "score7", TRUE, & arch_info_struct[0]);
index 2bfaad7e63b00c8ca5c3d6fdf8f8b8af47208bdb..37edace29bc5f116cb445a98803fafc3b7b17fa7 100644 (file)
 #include "libbfd.h"
 #include "../opcodes/sh-opc.h"
 
-#define SH_NEXT                                   arch_info_struct + 0
-#define SH2_NEXT                          arch_info_struct + 1
-#define SH2E_NEXT                         arch_info_struct + 2
-#define SH_DSP_NEXT                       arch_info_struct + 3
-#define SH3_NEXT                          arch_info_struct + 4
-#define SH3_NOMMU_NEXT                    arch_info_struct + 5
-#define SH3_DSP_NEXT                      arch_info_struct + 6
-#define SH3E_NEXT                         arch_info_struct + 7
-#define SH4_NEXT                          arch_info_struct + 8
-#define SH4A_NEXT                         arch_info_struct + 9
-#define SH4AL_DSP_NEXT                    arch_info_struct + 10
-#define SH4_NOFPU_NEXT                    arch_info_struct + 11
-#define SH4_NOMMU_NOFPU_NEXT              arch_info_struct + 12
-#define SH4A_NOFPU_NEXT                           arch_info_struct + 13
-#define SH2A_NEXT                         arch_info_struct + 14
-#define SH2A_NOFPU_NEXT                           arch_info_struct + 15
-#define SH2A_NOFPU_OR_SH4_NOMMU_NOFPU_NEXT arch_info_struct + 16
-#define SH2A_NOFPU_OR_SH3_NOMMU_NEXT      arch_info_struct + 17
-#define SH2A_OR_SH4_NEXT                  arch_info_struct + 18
-#define SH2A_OR_SH3E_NEXT                 NULL
+
+#define N(NUMBER, PRINT, DEFAULT, NEXT)                        \
+  {                                                    \
+    32,     /* Bits in a word.  */                     \
+    32,     /* Bits in an address.  */                 \
+    8,     /* Bits in a byte.  */                      \
+    bfd_arch_sh,                                       \
+    NUMBER,                                            \
+    "sh",                                              \
+    PRINT,                                             \
+    1,         /* Section alignment power.  */         \
+    DEFAULT,                                           \
+    bfd_default_compatible,                            \
+    bfd_default_scan,                                  \
+    bfd_arch_default_fill,                             \
+    NEXT,                                              \
+    0 /* Maximum offset of a reloc from the start of an insn.  */ \
+  }
 
 static const bfd_arch_info_type arch_info_struct[] =
 {
-  {
-    32,                                /* 32 bits in a word.  */
-    32,                                /* 32 bits in an address.  */
-    8,                         /* 8 bits in a byte.  */
-    bfd_arch_sh,
-    bfd_mach_sh2,
-    "sh",                      /* Architecture name.  */
-    "sh2",                     /* Machine name.  */
-    1,
-    FALSE,                     /* Not the default.  */
-    bfd_default_compatible,
-    bfd_default_scan,
-    bfd_arch_default_fill,
-    SH2_NEXT
-  },
-  {
-    32,                                /* 32 bits in a word.  */
-    32,                                /* 32 bits in an address.  */
-    8,                         /* 8 bits in a byte.  */
-    bfd_arch_sh,
-    bfd_mach_sh2e,
-    "sh",                      /* Architecture name.  */
-    "sh2e",                    /* Machine name.  */
-    1,
-    FALSE,                     /* Not the default.  */
-    bfd_default_compatible,
-    bfd_default_scan,
-    bfd_arch_default_fill,
-    SH2E_NEXT
-  },
-  {
-    32,                                /* 32 bits in a word.  */
-    32,                                /* 32 bits in an address.  */
-    8,                         /* 8 bits in a byte.  */
-    bfd_arch_sh,
-    bfd_mach_sh_dsp,
-    "sh",                      /* Architecture name.   */
-    "sh-dsp",                  /* Machine name.  */
-    1,
-    FALSE,                     /* Not the default.  */
-    bfd_default_compatible,
-    bfd_default_scan,
-    bfd_arch_default_fill,
-    SH_DSP_NEXT
-  },
-  {
-    32,                                /* 32 bits in a word.  */
-    32,                                /* 32 bits in an address.  */
-    8,                         /* 8 bits in a byte.  */
-    bfd_arch_sh,
-    bfd_mach_sh3,
-    "sh",                      /* Architecture name.   */
-    "sh3",                     /* Machine name.  */
-    1,
-    FALSE,                     /* Not the default.  */
-    bfd_default_compatible,
-    bfd_default_scan,
-    bfd_arch_default_fill,
-    SH3_NEXT
-  },
-  {
-    32,                                /* 32 bits in a word.  */
-    32,                                /* 32 bits in an address.  */
-    8,                         /* 8 bits in a byte.  */
-    bfd_arch_sh,
-    bfd_mach_sh3_nommu,
-    "sh",                      /* Architecture name.   */
-    "sh3-nommu",               /* Machine name.  */
-    1,
-    FALSE,                     /* Not the default.  */
-    bfd_default_compatible,
-    bfd_default_scan,
-    bfd_arch_default_fill,
-    SH3_NOMMU_NEXT
-  },
-  {
-    32,                                /* 32 bits in a word.  */
-    32,                                /* 32 bits in an address.  */
-    8,                         /* 8 bits in a byte.  */
-    bfd_arch_sh,
-    bfd_mach_sh3_dsp,
-    "sh",                      /* Architecture name.   */
-    "sh3-dsp",                 /* Machine name.  */
-    1,
-    FALSE,                     /* Not the default.  */
-    bfd_default_compatible,
-    bfd_default_scan,
-    bfd_arch_default_fill,
-    SH3_DSP_NEXT
-  },
-  {
-    32,                                /* 32 bits in a word.  */
-    32,                                /* 32 bits in an address.  */
-    8,                         /* 8 bits in a byte.  */
-    bfd_arch_sh,
-    bfd_mach_sh3e,
-    "sh",                      /* Architecture name.   */
-    "sh3e",                    /* Machine name.  */
-    1,
-    FALSE,                     /* Not the default.  */
-    bfd_default_compatible,
-    bfd_default_scan,
-    bfd_arch_default_fill,
-    SH3E_NEXT
-  },
-  {
-    32,                                /* 32 bits in a word.  */
-    32,                                /* 32 bits in an address.  */
-    8,                         /* 8 bits in a byte.  */
-    bfd_arch_sh,
-    bfd_mach_sh4,
-    "sh",                      /* Architecture name.   */
-    "sh4",                     /* Machine name.  */
-    1,
-    FALSE,                     /* Not the default.  */
-    bfd_default_compatible,
-    bfd_default_scan,
-    bfd_arch_default_fill,
-    SH4_NEXT
-  },
-  {
-    32,                                /* 32 bits in a word.  */
-    32,                                /* 32 bits in an address.  */
-    8,                         /* 8 bits in a byte.  */
-    bfd_arch_sh,
-    bfd_mach_sh4a,
-    "sh",                      /* Architecture name.   */
-    "sh4a",                    /* Machine name.  */
-    1,
-    FALSE,                     /* Not the default.  */
-    bfd_default_compatible,
-    bfd_default_scan,
-    bfd_arch_default_fill,
-    SH4A_NEXT
-  },
-  {
-    32,                                /* 32 bits in a word.  */
-    32,                                /* 32 bits in an address.  */
-    8,                         /* 8 bits in a byte.  */
-    bfd_arch_sh,
-    bfd_mach_sh4al_dsp,
-    "sh",                      /* Architecture name.   */
-    "sh4al-dsp",               /* Machine name.  */
-    1,
-    FALSE,                     /* Not the default.  */
-    bfd_default_compatible,
-    bfd_default_scan,
-    bfd_arch_default_fill,
-    SH4AL_DSP_NEXT
-  },
-  {
-    32,                                /* 32 bits in a word.  */
-    32,                                /* 32 bits in an address.  */
-    8,                         /* 8 bits in a byte.  */
-    bfd_arch_sh,
-    bfd_mach_sh4_nofpu,
-    "sh",                      /* Architecture name.   */
-    "sh4-nofpu",               /* Machine name.  */
-    1,
-    FALSE,                     /* Not the default.  */
-    bfd_default_compatible,
-    bfd_default_scan,
-    bfd_arch_default_fill,
-    SH4_NOFPU_NEXT
-  },
-  {
-    32,                                /* 32 bits in a word.  */
-    32,                                /* 32 bits in an address.  */
-    8,                         /* 8 bits in a byte.  */
-    bfd_arch_sh,
-    bfd_mach_sh4_nommu_nofpu,
-    "sh",                      /* Architecture name.   */
-    "sh4-nommu-nofpu",         /* Machine name.  */
-    1,
-    FALSE,                     /* Not the default.  */
-    bfd_default_compatible,
-    bfd_default_scan,
-    bfd_arch_default_fill,
-    SH4_NOMMU_NOFPU_NEXT
-  },
-  {
-    32,                                /* 32 bits in a word.  */
-    32,                                /* 32 bits in an address.  */
-    8,                         /* 8 bits in a byte.  */
-    bfd_arch_sh,
-    bfd_mach_sh4a_nofpu,
-    "sh",                      /* Architecture name.   */
-    "sh4a-nofpu",              /* Machine name.  */
-    1,
-    FALSE,                     /* Not the default.  */
-    bfd_default_compatible,
-    bfd_default_scan,
-    bfd_arch_default_fill,
-    SH4A_NOFPU_NEXT
-  },
-  {
-    32,                                /* 32 bits in a word.  */
-    32,                                /* 32 bits in an address.  */
-    8,                         /* 8 bits in a byte.  */
-    bfd_arch_sh,
-    bfd_mach_sh2a,
-    "sh",                      /* Architecture name.  */
-    "sh2a",                    /* Machine name.  */
-    1,
-    FALSE,                     /* Not the default.  */
-    bfd_default_compatible,
-    bfd_default_scan,
-    bfd_arch_default_fill,
-    SH2A_NEXT
-  },
-  {
-    32,                                /* 32 bits in a word.  */
-    32,                                /* 32 bits in an address.  */
-    8,                         /* 8 bits in a byte.  */
-    bfd_arch_sh,
-    bfd_mach_sh2a_nofpu,
-    "sh",                      /* Architecture name.  */
-    "sh2a-nofpu",              /* Machine name.  */
-    1,
-    FALSE,                     /* Not the default.  */
-    bfd_default_compatible,
-    bfd_default_scan,
-    bfd_arch_default_fill,
-    SH2A_NOFPU_NEXT
-  },
-  {
-    32,                                /* 32 bits in a word.  */
-    32,                                /* 32 bits in an address.  */
-    8,                         /* 8 bits in a byte.  */
-    bfd_arch_sh,
-    bfd_mach_sh2a_nofpu_or_sh4_nommu_nofpu,
-    "sh",                      /* Architecture name.  */
-    "sh2a-nofpu-or-sh4-nommu-nofpu",           /* Machine name.  */
-    1,
-    FALSE,                     /* Not the default.  */
-    bfd_default_compatible,
-    bfd_default_scan,
-    bfd_arch_default_fill,
-    SH2A_NOFPU_OR_SH4_NOMMU_NOFPU_NEXT
-  },
-  {
-    32,                                /* 32 bits in a word.  */
-    32,                                /* 32 bits in an address.  */
-    8,                         /* 8 bits in a byte.  */
-    bfd_arch_sh,
-    bfd_mach_sh2a_nofpu_or_sh3_nommu,
-    "sh",                      /* Architecture name. .  */
-    "sh2a-nofpu-or-sh3-nommu", /* Machine name.  */
-    1,
-    FALSE,                     /* Not the default.  */
-    bfd_default_compatible,
-    bfd_default_scan,
-    bfd_arch_default_fill,
-    SH2A_NOFPU_OR_SH3_NOMMU_NEXT
-  },
-  {
-    32,                                /* 32 bits in a word.  */
-    32,                                /* 32 bits in an address.  */
-    8,                         /* 8 bits in a byte.  */
-    bfd_arch_sh,
-    bfd_mach_sh2a_or_sh4,
-    "sh",                      /* Architecture name.  */
-    "sh2a-or-sh4",             /* Machine name.  */
-    1,
-    FALSE,                     /* Not the default.  */
-    bfd_default_compatible,
-    bfd_default_scan,
-    bfd_arch_default_fill,
-    SH2A_OR_SH4_NEXT
-  },
-  {
-    32,                                /* 32 bits in a word.  */
-    32,                                /* 32 bits in an address.  */
-    8,                         /* 8 bits in a byte.  */
-    bfd_arch_sh,
-    bfd_mach_sh2a_or_sh3e,
-    "sh",                      /* Architecture name.  */
-    "sh2a-or-sh3e",            /* Machine name.  */
-    1,
-    FALSE,                     /* Not the default.  */
-    bfd_default_compatible,
-    bfd_default_scan,
-    bfd_arch_default_fill,
-    SH2A_OR_SH3E_NEXT
-  },
+  N (bfd_mach_sh2,          "sh2",       FALSE, arch_info_struct + 1),
+  N (bfd_mach_sh2e,         "sh2e",      FALSE, arch_info_struct + 2),
+  N (bfd_mach_sh_dsp,       "sh-dsp",    FALSE, arch_info_struct + 3),
+  N (bfd_mach_sh3,          "sh3",       FALSE, arch_info_struct + 4),
+  N (bfd_mach_sh3_nommu,    "sh3-nommu", FALSE, arch_info_struct + 5),
+  N (bfd_mach_sh3_dsp,      "sh3-dsp",   FALSE, arch_info_struct + 6),
+  N (bfd_mach_sh3e,         "sh3e",      FALSE, arch_info_struct + 7),
+  N (bfd_mach_sh4,          "sh4",       FALSE, arch_info_struct + 8),
+  N (bfd_mach_sh4a,         "sh4a",      FALSE, arch_info_struct + 9),
+  N (bfd_mach_sh4al_dsp,    "sh4al-dsp", FALSE, arch_info_struct + 10),
+  N (bfd_mach_sh4_nofpu,    "sh4-nofpu", FALSE, arch_info_struct + 11),
+  N (bfd_mach_sh4_nommu_nofpu, "sh4-nommu-nofpu", FALSE, arch_info_struct + 12),
+  N (bfd_mach_sh4a_nofpu,   "sh4a-nofpu", FALSE, arch_info_struct + 13),
+  N (bfd_mach_sh2a,         "sh2a",       FALSE, arch_info_struct + 14),
+  N (bfd_mach_sh2a_nofpu,   "sh2a-nofpu", FALSE, arch_info_struct + 15),
+  N (bfd_mach_sh2a_nofpu_or_sh4_nommu_nofpu, "sh2a-nofpu-or-sh4-nommu-nofpu", FALSE, arch_info_struct + 16),
+  N (bfd_mach_sh2a_nofpu_or_sh3_nommu, "sh2a-nofpu-or-sh3-nommu", FALSE, arch_info_struct + 17),
+  N (bfd_mach_sh2a_or_sh4,  "sh2a-or-sh4",  FALSE, arch_info_struct + 18),
+  N (bfd_mach_sh2a_or_sh3e, "sh2a-or-sh3e", FALSE, NULL)
 };
 
 const bfd_arch_info_type bfd_sh_arch =
-{
-  32,                          /* 32 bits in a word.  */
-  32,                          /* 32 bits in an address.  */
-  8,                           /* 8 bits in a byte.  */
-  bfd_arch_sh,
-  bfd_mach_sh,
-  "sh",                                /* Architecture name.   */
-  "sh",                                /* Machine name.  */
-  1,
-  TRUE,                                /* The default machine.  */
-  bfd_default_compatible,
-  bfd_default_scan,
-  bfd_arch_default_fill,
-  SH_NEXT
-};
-
+  N (bfd_mach_sh, "sh", TRUE, arch_info_struct + 0);
 
 /* This table defines the mappings from the BFD internal numbering
    system to the opcodes internal flags system.
index a1eb4c227db23592241c8d8d9dd12b140529da4f..e7f30fb342b5d8b746f438121e3f8d10ba123101 100644 (file)
 #include "bfd.h"
 #include "libbfd.h"
 
+#define N(BITS, NUMBER, PRINT, DEFAULT, NEXT) \
+  {                                                    \
+    BITS,      /* Bits in a word.  */                  \
+    BITS,      /* Bits in an address.  */              \
+    8,        /* Bits in a byte.  */                   \
+    bfd_arch_sparc,                                    \
+    NUMBER,                                            \
+    "sparc",                                           \
+    PRINT,                                             \
+    3,         /* Section alignment power.  */         \
+    DEFAULT,                                           \
+    bfd_default_compatible,                            \
+    bfd_default_scan,                                  \
+    bfd_arch_default_fill,                             \
+    NEXT,                                              \
+    0 /* Maximum offset of a reloc from the start of an insn.  */ \
+  }
+
 static const bfd_arch_info_type arch_info_struct[] =
 {
-  {
-    32,        /* bits in a word */
-    32,        /* bits in an address */
-    8, /* bits in a byte */
-    bfd_arch_sparc,
-    bfd_mach_sparc_sparclet,
-    "sparc",
-    "sparc:sparclet",
-    3,
-    FALSE,
-    bfd_default_compatible,
-    bfd_default_scan,
-    bfd_arch_default_fill,
-    &arch_info_struct[1],
-  },
-  {
-    32,        /* bits in a word */
-    32,        /* bits in an address */
-    8, /* bits in a byte */
-    bfd_arch_sparc,
-    bfd_mach_sparc_sparclite,
-    "sparc",
-    "sparc:sparclite",
-    3,
-    FALSE,
-    bfd_default_compatible,
-    bfd_default_scan,
-    bfd_arch_default_fill,
-    &arch_info_struct[2],
-  },
-  {
-    32,        /* bits in a word */
-    32,        /* bits in an address */
-    8, /* bits in a byte */
-    bfd_arch_sparc,
-    bfd_mach_sparc_v8plus,
-    "sparc",
-    "sparc:v8plus",
-    3,
-    FALSE,
-    bfd_default_compatible,
-    bfd_default_scan,
-    bfd_arch_default_fill,
-    &arch_info_struct[3],
-  },
-  {
-    32,        /* bits in a word */
-    32,        /* bits in an address */
-    8, /* bits in a byte */
-    bfd_arch_sparc,
-    bfd_mach_sparc_v8plusa,
-    "sparc",
-    "sparc:v8plusa",
-    3,
-    FALSE,
-    bfd_default_compatible,
-    bfd_default_scan,
-    bfd_arch_default_fill,
-    &arch_info_struct[4],
-  },
-  {
-    32,        /* bits in a word */
-    32,        /* bits in an address */
-    8, /* bits in a byte */
-    bfd_arch_sparc,
-    bfd_mach_sparc_sparclite_le,
-    "sparc",
-    "sparc:sparclite_le",
-    3,
-    FALSE,
-    bfd_default_compatible,
-    bfd_default_scan,
-    bfd_arch_default_fill,
-    &arch_info_struct[5],
-  },
-  {
-    64,        /* bits in a word */
-    64,        /* bits in an address */
-    8, /* bits in a byte */
-    bfd_arch_sparc,
-    bfd_mach_sparc_v9,
-    "sparc",
-    "sparc:v9",
-    3,
-    FALSE,
-    bfd_default_compatible,
-    bfd_default_scan,
-    bfd_arch_default_fill,
-    &arch_info_struct[6],
-  },
-  {
-    64,        /* bits in a word */
-    64,        /* bits in an address */
-    8, /* bits in a byte */
-    bfd_arch_sparc,
-    bfd_mach_sparc_v9a,
-    "sparc",
-    "sparc:v9a",
-    3,
-    FALSE,
-    bfd_default_compatible,
-    bfd_default_scan,
-    bfd_arch_default_fill,
-    &arch_info_struct[7],
-  },
-  {
-    32,        /* bits in a word */
-    32,        /* bits in an address */
-    8, /* bits in a byte */
-    bfd_arch_sparc,
-    bfd_mach_sparc_v8plusb,
-    "sparc",
-    "sparc:v8plusb",
-    3,
-    FALSE,
-    bfd_default_compatible,
-    bfd_default_scan,
-    bfd_arch_default_fill,
-    &arch_info_struct[8],
-  },
-  {
-    64,        /* bits in a word */
-    64,        /* bits in an address */
-    8, /* bits in a byte */
-    bfd_arch_sparc,
-    bfd_mach_sparc_v9b,
-    "sparc",
-    "sparc:v9b",
-    3,
-    FALSE,
-    bfd_default_compatible,
-    bfd_default_scan,
-    bfd_arch_default_fill,
-    &arch_info_struct[9],
-  },
-  {
-    32,        /* bits in a word */
-    32,        /* bits in an address */
-    8, /* bits in a byte */
-    bfd_arch_sparc,
-    bfd_mach_sparc_v8plusc,
-    "sparc",
-    "sparc:v8plusc",
-    3,
-    FALSE,
-    bfd_default_compatible,
-    bfd_default_scan,
-    bfd_arch_default_fill,
-    &arch_info_struct[10],
-  },
-  {
-    64,        /* bits in a word */
-    64,        /* bits in an address */
-    8, /* bits in a byte */
-    bfd_arch_sparc,
-    bfd_mach_sparc_v9c,
-    "sparc",
-    "sparc:v9c",
-    3,
-    FALSE,
-    bfd_default_compatible,
-    bfd_default_scan,
-    bfd_arch_default_fill,
-    &arch_info_struct[11],
-  },
-  {
-    32,        /* bits in a word */
-    32,        /* bits in an address */
-    8, /* bits in a byte */
-    bfd_arch_sparc,
-    bfd_mach_sparc_v8plusd,
-    "sparc",
-    "sparc:v8plusd",
-    3,
-    FALSE,
-    bfd_default_compatible,
-    bfd_default_scan,
-    bfd_arch_default_fill,
-    &arch_info_struct[12],
-  },
-  {
-    64,        /* bits in a word */
-    64,        /* bits in an address */
-    8, /* bits in a byte */
-    bfd_arch_sparc,
-    bfd_mach_sparc_v9d,
-    "sparc",
-    "sparc:v9d",
-    3,
-    FALSE,
-    bfd_default_compatible,
-    bfd_default_scan,
-    bfd_arch_default_fill,
-    &arch_info_struct[13],
-  },
-  {
-    32,        /* bits in a word */
-    32,        /* bits in an address */
-    8, /* bits in a byte */
-    bfd_arch_sparc,
-    bfd_mach_sparc_v8pluse,
-    "sparc",
-    "sparc:v8pluse",
-    3,
-    FALSE,
-    bfd_default_compatible,
-    bfd_default_scan,
-    bfd_arch_default_fill,
-    &arch_info_struct[14],
-  },
-  {
-    64,        /* bits in a word */
-    64,        /* bits in an address */
-    8, /* bits in a byte */
-    bfd_arch_sparc,
-    bfd_mach_sparc_v9e,
-    "sparc",
-    "sparc:v9e",
-    3,
-    FALSE,
-    bfd_default_compatible,
-    bfd_default_scan,
-    bfd_arch_default_fill,
-    &arch_info_struct[15],
-  },
-  {
-    32,        /* bits in a word */
-    32,        /* bits in an address */
-    8, /* bits in a byte */
-    bfd_arch_sparc,
-    bfd_mach_sparc_v8plusv,
-    "sparc",
-    "sparc:v8plusv",
-    3,
-    FALSE,
-    bfd_default_compatible,
-    bfd_default_scan,
-    bfd_arch_default_fill,
-    &arch_info_struct[16],
-  },
-  {
-    64,        /* bits in a word */
-    64,        /* bits in an address */
-    8, /* bits in a byte */
-    bfd_arch_sparc,
-    bfd_mach_sparc_v9v,
-    "sparc",
-    "sparc:v9v",
-    3,
-    FALSE,
-    bfd_default_compatible,
-    bfd_default_scan,
-    bfd_arch_default_fill,
-    &arch_info_struct[17],
-  },
-  {
-    32,        /* bits in a word */
-    32,        /* bits in an address */
-    8, /* bits in a byte */
-    bfd_arch_sparc,
-    bfd_mach_sparc_v8plusm,
-    "sparc",
-    "sparc:v8plusm",
-    3,
-    FALSE,
-    bfd_default_compatible,
-    bfd_default_scan,
-    bfd_arch_default_fill,
-    &arch_info_struct[18],
-  },
-  {
-    64,        /* bits in a word */
-    64,        /* bits in an address */
-    8, /* bits in a byte */
-    bfd_arch_sparc,
-    bfd_mach_sparc_v9m,
-    "sparc",
-    "sparc:v9m",
-    3,
-    FALSE,
-    bfd_default_compatible,
-    bfd_default_scan,
-    bfd_arch_default_fill,
-    &arch_info_struct[19],
-  },
-  {
-    32,        /* bits in a word */
-    32,        /* bits in an address */
-    8, /* bits in a byte */
-    bfd_arch_sparc,
-    bfd_mach_sparc_v8plusm8,
-    "sparc",
-    "sparc:v8plusm8",
-    3,
-    FALSE,
-    bfd_default_compatible,
-    bfd_default_scan,
-    bfd_arch_default_fill,
-    &arch_info_struct[20],
-  },
-  {
-    64,        /* bits in a word */
-    64,        /* bits in an address */
-    8, /* bits in a byte */
-    bfd_arch_sparc,
-    bfd_mach_sparc_v9m8,
-    "sparc",
-    "sparc:v9m8",
-    3,
-    FALSE,
-    bfd_default_compatible,
-    bfd_default_scan,
-    bfd_arch_default_fill,
-    0,
-  }
+  N (32, bfd_mach_sparc_sparclet,     "sparc:sparclet",     FALSE, arch_info_struct + 1),
+  N (32, bfd_mach_sparc_sparclite,    "sparc:sparclite",    FALSE, arch_info_struct + 2),
+  N (32, bfd_mach_sparc_v8plus,       "sparc:v8plus",       FALSE, arch_info_struct + 3),
+  N (32, bfd_mach_sparc_v8plusa,      "sparc:v8plusa",      FALSE, arch_info_struct + 4),
+  N (32, bfd_mach_sparc_sparclite_le, "sparc:sparclite_le", FALSE, arch_info_struct + 5),
+  N (64, bfd_mach_sparc_v9,           "sparc:v9",           FALSE, arch_info_struct + 6),
+  N (64, bfd_mach_sparc_v9a,          "sparc:v9a",          FALSE, arch_info_struct + 7),
+  N (32, bfd_mach_sparc_v8plusb,      "sparc:v8plusb",      FALSE, arch_info_struct + 8),
+  N (64, bfd_mach_sparc_v9b,          "sparc:v9b",          FALSE, arch_info_struct + 9),
+  N (32, bfd_mach_sparc_v8plusc,      "sparc:v8plusc",      FALSE, arch_info_struct + 10),
+  N (64, bfd_mach_sparc_v9c,          "sparc:v9c",          FALSE, arch_info_struct + 11),
+  N (32, bfd_mach_sparc_v8plusd,      "sparc:v8plusd",      FALSE, arch_info_struct + 12),
+  N (64, bfd_mach_sparc_v9d,          "sparc:v9d",          FALSE, arch_info_struct + 13),
+  N (32, bfd_mach_sparc_v8pluse,      "sparc:v8pluse",      FALSE, arch_info_struct + 14),
+  N (64, bfd_mach_sparc_v9e,          "sparc:v9e",          FALSE, arch_info_struct + 15),
+  N (32, bfd_mach_sparc_v8plusv,      "sparc:v8plusv",      FALSE, arch_info_struct + 16),
+  N (64, bfd_mach_sparc_v9v,          "sparc:v9v",          FALSE, arch_info_struct + 17),
+  N (32, bfd_mach_sparc_v8plusm,      "sparc:v8plusm",      FALSE, arch_info_struct + 18),
+  N (64, bfd_mach_sparc_v9m,          "sparc:v9m",          FALSE, arch_info_struct + 19),
+  N (32, bfd_mach_sparc_v8plusm8,     "sparc:v8plusm8",     FALSE, arch_info_struct + 20),
+  N (64, bfd_mach_sparc_v9m8,         "sparc:v9m8",         FALSE, NULL)
 };
 
 const bfd_arch_info_type bfd_sparc_arch =
-  {
-    32,        /* bits in a word */
-    32,        /* bits in an address */
-    8, /* bits in a byte */
-    bfd_arch_sparc,
-    bfd_mach_sparc,
-    "sparc",
-    "sparc",
-    3,
-    TRUE, /* the default */
-    bfd_default_compatible,
-    bfd_default_scan,
-    bfd_arch_default_fill,
-    &arch_info_struct[0],
-  };
+  N (32, bfd_mach_sparc, "sparc", TRUE, arch_info_struct);
index 8f9e755be8071caef378bd1a8e796c16d3ccfac7..af66045319f73ef45d6ce880fcf2db12f4637071 100644 (file)
@@ -20,7 +20,6 @@
 #include "bfd.h"
 #include "libbfd.h"
 
-
 static const bfd_arch_info_type *
 spu_compatible (const bfd_arch_info_type *a, const bfd_arch_info_type *b)
 {
@@ -35,21 +34,20 @@ spu_compatible (const bfd_arch_info_type *a, const bfd_arch_info_type *b)
   /*NOTREACHED*/
 }
 
-const bfd_arch_info_type bfd_spu_arch[] =
+const bfd_arch_info_type bfd_spu_arch =
 {
-  {
-    32,        /* 32 bits in a word */
-    32,        /* 32 bits in an address */
-    8, /* 8 bits in a byte */
-    bfd_arch_spu,      /* architecture */
-    bfd_mach_spu,      /* machine */
-    "spu",             /* architecture name */
-    "spu:256K",                /* printable name */
-    3,                 /* aligned power */
-    TRUE,              /* the default machine for the architecture */
-    spu_compatible,    /* the spu is only compatible with itself, see above */
-    bfd_default_scan,
-    bfd_arch_default_fill,
-    0,                 /* next -- there are none! */
-  }
+  32,                  /* Bits in a word.  */
+  32,                  /* Bits in an address.  */
+  8,                   /* Bits in a byte.  */
+  bfd_arch_spu,                /* Architecture number.  */
+  bfd_mach_spu,                /* Machine number.  */
+  "spu",               /* Architecture name.  */
+  "spu:256K",          /* Printable name.  */
+  3,                   /* Section alignment power.  */
+  TRUE,                        /* Default machine.  */
+  spu_compatible,      /* The spu is only compatible with itself, see above.  */
+  bfd_default_scan,
+  bfd_arch_default_fill,
+  NULL,                        /* Next -- there are none!  */
+  0 /* Maximum offset of a reloc from the start of an insn.  */
 };
index 3296daf2aece8ed590be50c526616bbe1aa66760..606d66353b494b6166ca8e8ebd2fd2ef03bdfb1d 100644 (file)
 
 const bfd_arch_info_type bfd_tic30_arch =
 {
-  32,                          /* 32 bits in a word */
-  32,                          /* 32 bits in an address */
-  8,                           /* 8 bits in a byte */
+  32,                          /* Bits in a word.  */
+  32,                          /* Bits in an address.  */
+  8,                           /* Bits in a byte.  */
   bfd_arch_tic30,
-  0,                           /* only 1 machine */
+  0,                           /* Only 1 machine.  */
   "tic30",
   "tms320c30",
   2,
-  TRUE,                                /* the one and only */
+  TRUE,                                /* The one and only.  */
   bfd_default_compatible,
   bfd_default_scan,
   bfd_arch_default_fill,
-  0,
+  NULL,
+  0 /* Maximum offset of a reloc from the start of an insn.  */
 };
index f8dbf98065813db700797bb5c6c272fc19defa3a..cf87bfedf5bf7d5bc955b8a20949c66f64886804 100644 (file)
@@ -45,39 +45,26 @@ tic4x_scan (const struct bfd_arch_info *info,
   return FALSE;
 }
 
+#define N(NUMBER, NAME, PRINT, DEFAULT, NEXT)          \
+  {                                                    \
+    32,        /* Bits in a word.  */                  \
+    32,        /* Bits in an address.  */              \
+    32,               /* Bits in a byte.  */                   \
+    bfd_arch_tic4x,                                    \
+    NUMBER,                                            \
+    NAME,                                              \
+    PRINT,                                             \
+    0,         /* Section alignment power.  */         \
+    DEFAULT,                                           \
+    bfd_default_compatible,                            \
+    tic4x_scan,                                                \
+    bfd_arch_default_fill,                             \
+    NEXT,                                              \
+    0 /* Maximum offset of a reloc from the start of an insn.  */ \
+  }
 
 const bfd_arch_info_type bfd_tic3x_arch =
-  {
-    32,                                /* 32 bits in a word.  */
-    32,                                /* 32 bits in an address.  */
-    32,                                /* 32 bits in a byte.  */
-    bfd_arch_tic4x,
-    bfd_mach_tic3x,            /* Machine number.  */
-    "tic3x",                   /* Architecture name.  */
-    "tms320c3x",               /* Printable name.  */
-    0,                         /* Alignment power.  */
-    FALSE,                     /* Not the default architecture.  */
-    bfd_default_compatible,
-    tic4x_scan,
-    bfd_arch_default_fill,
-    0
-  };
+  N (bfd_mach_tic3x, "tic3x", "tms320c3x", FALSE, NULL);
 
 const bfd_arch_info_type bfd_tic4x_arch =
-  {
-    32,                                /* 32 bits in a word.  */
-    32,                                /* 32 bits in an address.  */
-    32,                                /* 32 bits in a byte.  */
-    bfd_arch_tic4x,
-    bfd_mach_tic4x,            /* Machine number.  */
-    "tic4x",                   /* Architecture name.  */
-    "tms320c4x",               /* Printable name.  */
-    0,                         /* Alignment power.  */
-    TRUE,                      /* The default architecture.  */
-    bfd_default_compatible,
-    tic4x_scan,
-    bfd_arch_default_fill,
-    &bfd_tic3x_arch,
-  };
-
-
+  N (bfd_mach_tic4x, "tic4x", "tms320c4x", TRUE, &bfd_tic3x_arch);
index 7c9505dc8b87a3f8784d2de69f3730da95d6a368..67e6e6ca8077e2733bcd456cb00fe58cf896fd56 100644 (file)
 
 const bfd_arch_info_type bfd_tic54x_arch =
 {
-  16,                          /* 16 bits in a word */
-  16,                          /* 16 bits in an address (except '548) */
-  16,                          /* 16 bits in a byte */
+  16,                          /* Bits in a word.  */
+  16,                          /* Bits in an address (except '548).  */
+  16,                          /* Bits in a byte.  */
   bfd_arch_tic54x,
-  0,                           /* only 1 machine */
+  0,                           /* Only 1 machine.  */
   "tic54x",
   "tms320c54x",
   1,
-  TRUE,                                /* the one and only */
+  TRUE,                                /* The one and only.  */
   bfd_default_compatible,
   bfd_default_scan,
   bfd_arch_default_fill,
-  0,
+  NULL,
+  0 /* Maximum offset of a reloc from the start of an insn.  */
 };
index bb9439480ed76a30af38479f337674b97d23eeb1..286927ba63364c0ed0bfb1c153b3f48e671b5c24 100644 (file)
 #include "libbfd.h"
 
 const bfd_arch_info_type bfd_tic6x_arch =
-  {
-    32, /* 32 bits in a word.  */
-    32, /* 32 bits in an address.  */
-    8, /* 8 bits in a byte.  */
-    bfd_arch_tic6x, /* Architecture.  */
-    0, /* No BFD machine numbers needed.  */
-    "tic6x", /* Architecture name.  */
-    "tic6x", /* Printable name.  */
-    2, /* Section alignment power.  */
-    TRUE, /* Default machine for this architecture.  */
-    bfd_default_compatible,
-    bfd_default_scan,
-    bfd_arch_default_fill,
-    0,
-  };
+{
+  32, /* Bits in a word.  */
+  32, /* Bits in an address.  */
+  8,  /* Bits in a byte.  */
+  bfd_arch_tic6x, /* Architecture.  */
+  0,  /* No BFD machine numbers needed.  */
+  "tic6x", /* Architecture name.  */
+  "tic6x", /* Printable name.  */
+  2, /* Section alignment power.  */
+  TRUE, /* Default machine for this architecture.  */
+  bfd_default_compatible,
+  bfd_default_scan,
+  bfd_arch_default_fill,
+  NULL,
+  0 /* Maximum offset of a reloc from the start of an insn.  */
+};
index 24261f438ed78610375982b747abae22af734a02..2fcbd9ddc460a7b1df59b2f08763b7252d6f38f8 100644 (file)
 #include "libbfd.h"
 
 const bfd_arch_info_type bfd_tic80_arch =
-  {
-    32,                                /* 32 bits in a word */
-    32,                                /* 32 bits in an address */
-    8,                         /* 8 bits in a byte */
-    bfd_arch_tic80,            /* bfd_architecture enum */
-    0,                         /* only 1 machine */
-    "tic80",                   /* architecture name */
-    "tic80",                   /* printable name */
-    2,                         /* section alignment power */
-    TRUE,                      /* default machine for architecture */
-    bfd_default_compatible,
-    bfd_default_scan,
-    bfd_arch_default_fill,
-    NULL,                              /* Pointer to next in chain */
-  };
+{
+  32,                          /* Bits in a word.  */
+  32,                          /* Bits in an address.  */
+  8,                           /* Bits in a byte.  */
+  bfd_arch_tic80,              /* Architecture number.  */
+  0,                           /* Only 1 machine.  */
+  "tic80",                     /* Architecture name.  */
+  "tic80",                     /* Printable name.  */
+  2,                           /* Section alignment power.  */
+  TRUE,                                /* Default machine.  */
+  bfd_default_compatible,
+  bfd_default_scan,
+  bfd_arch_default_fill,
+  NULL,                                /* Pointer to next in chain.  */
+  0 /* Maximum offset of a reloc from the start of an insn.  */
+};
index cfe08b3f9a6a47b79cc16f57d5f1f482a2812158..633dde8d9700f225565ff5736ccde29044f01fc8 100644 (file)
 #include "bfd.h"
 #include "libbfd.h"
 
+#define N(BITS, NUMBER, PRINT, DEFAULT, NEXT)          \
+  {                                                    \
+    BITS,      /* Bits in a word.  */                  \
+    BITS,      /* Bits in an address.  */              \
+    8,        /* Bits in a byte.  */                   \
+    bfd_arch_tilegx,                                   \
+    NUMBER,                                            \
+    "tilegx",                                          \
+    PRINT,                                             \
+    3,         /* Section alignment power.  */         \
+    DEFAULT,                                           \
+    bfd_default_compatible,                            \
+    bfd_default_scan,                                  \
+    bfd_arch_default_fill,                             \
+    NEXT,                                              \
+    0 /* Maximum offset of a reloc from the start of an insn.  */ \
+  }
+
 const bfd_arch_info_type bfd_tilegx32_arch =
-  {
-    32, /* 32 bits in a word */
-    32, /* 32 bits in an address */
-    8,  /* 8 bits in a byte */
-    bfd_arch_tilegx,
-    bfd_mach_tilegx32,
-    "tilegx32",
-    "tilegx32",
-    3,
-    FALSE,
-    bfd_default_compatible,
-    bfd_default_scan,
-    bfd_arch_default_fill,
-    0,
-  };
+  N (32, bfd_mach_tilegx32, "tilegx32", FALSE, NULL);
 
 const bfd_arch_info_type bfd_tilegx_arch =
-  {
-    64, /* 64 bits in a word */
-    64, /* 64 bits in an address */
-    8,  /* 8 bits in a byte */
-    bfd_arch_tilegx,
-    bfd_mach_tilegx,
-    "tilegx",
-    "tilegx",
-    3,
-    TRUE,
-    bfd_default_compatible,
-    bfd_default_scan,
-    bfd_arch_default_fill,
-    &bfd_tilegx32_arch,
-  };
+  N (64, bfd_mach_tilegx, "tilegx", TRUE, &bfd_tilegx32_arch);
+
index bdd6aee9d23df474445bab2b5df3f46de38acae0..82ad8d2d0489a9c86ae51ae58918df9ff10d4343 100644 (file)
 #include "libbfd.h"
 
 const bfd_arch_info_type bfd_tilepro_arch =
-  {
-    32, /* 32 bits in a word */
-    32, /* 32 bits in an address */
-    8,  /* 8 bits in a byte */
-    bfd_arch_tilepro,
-    bfd_mach_tilepro,
-    "tilepro",
-    "tilepro",
-    3,
-    TRUE,
-    bfd_default_compatible,
-    bfd_default_scan,
-    bfd_arch_default_fill,
-    0,
-  };
+{
+  32, /* Bits in a word.  */
+  32, /* Bits in an address.  */
+  8,  /* Bits in a byte.  */
+  bfd_arch_tilepro,
+  bfd_mach_tilepro,
+  "tilepro",
+  "tilepro",
+  3,
+  TRUE,
+  bfd_default_compatible,
+  bfd_default_scan,
+  bfd_arch_default_fill,
+  NULL,
+  0 /* Maximum offset of a reloc from the start of an insn.  */
+};
index d4c86938fe734134504c514f3ca1f9490688da09..0daea285ef9678ca789bf71b9c001fd9dc9cfe5f 100644 (file)
 #include "safe-ctype.h"
 
 #define N(number, print, default, next)  \
- 32, 32, 8, bfd_arch_v850, number, "v850", print ":old-gcc-abi", 2, default, \
-   bfd_default_compatible, bfd_default_scan, bfd_arch_default_fill, next }
+ { 32, 32, 8, bfd_arch_v850, number, "v850", print ":old-gcc-abi", 2, default, \
+   bfd_default_compatible, bfd_default_scan, bfd_arch_default_fill, next, 0 }
 
-#define NEXT NULL
-
-static const bfd_arch_info_type arch_info_struct[] =
+static const bfd_arch_info_type arch_info_struct[6] =
 {
-  N (bfd_mach_v850e3v5, "v850e3v5",    FALSE, & arch_info_struct[1]),
-  N (bfd_mach_v850e3v5, "v850e2v4",    FALSE, & arch_info_struct[2]),
-  N (bfd_mach_v850e2v3, "v850e2v3",    FALSE, & arch_info_struct[3]),
-  N (bfd_mach_v850e2,  "v850e2",       FALSE, & arch_info_struct[4]),
-  N (bfd_mach_v850e1,  "v850e1",       FALSE, & arch_info_struct[5]),
-  N (bfd_mach_v850e,   "v850e",        FALSE, NULL)
+  N (bfd_mach_v850e3v5, "v850e3v5", FALSE, arch_info_struct + 1),
+  N (bfd_mach_v850e3v5, "v850e2v4", FALSE, arch_info_struct + 2),
+  N (bfd_mach_v850e2v3, "v850e2v3", FALSE, arch_info_struct + 3),
+  N (bfd_mach_v850e2,  "v850e2",   FALSE, arch_info_struct + 4),
+  N (bfd_mach_v850e1,  "v850e1",   FALSE, arch_info_struct + 5),
+  N (bfd_mach_v850e,   "v850e",    FALSE, NULL)
 };
 
-#undef  NEXT
-#define NEXT & arch_info_struct[0]
-
 const bfd_arch_info_type bfd_v850_arch =
-  N (bfd_mach_v850, "v850", TRUE, NEXT);
+  N (bfd_mach_v850,     "v850",     TRUE,  arch_info_struct + 0);
index f7cd9207bdaf2f5d7328b7e2bbd450daaa8b8976..4c84226f23a7bef23d40345c1ba0394f6d7f8191 100644 (file)
@@ -24,8 +24,8 @@
 #include "safe-ctype.h"
 
 #define R(number, print, default, next)  \
- 32, 32, 8, bfd_arch_v850_rh850, number, "v850", print, 2, default, \
-   bfd_default_compatible, bfd_default_scan, bfd_arch_default_fill, next }
+ { 32, 32, 8, bfd_arch_v850_rh850, number, "v850", print, 2, default, \
+   bfd_default_compatible, bfd_default_scan, bfd_arch_default_fill, next, 0 }
 
 static const bfd_arch_info_type arch_info_struct[] =
 {
index c4c9f08078f460e3ab6a0d6bba94a24f21e0f755..3e9a4024a71d543ba4110aa1fa7128fe9323018c 100644 (file)
 #include "libbfd.h"
 
 const bfd_arch_info_type bfd_vax_arch =
-  {
-    32,        /* 32 bits in a word */
-    32,        /* 32 bits in an address */
-    8, /* 8 bits in a byte */
-    bfd_arch_vax,
-    0, /* only 1 machine */
-    "vax",
-    "vax",
-    3,
-    TRUE, /* the one and only */
-    bfd_default_compatible,
-    bfd_default_scan,
-    bfd_arch_default_fill,
-    0,
-  };
+{
+  32,  /* Bits in a word.  */
+  32,  /* Bits in an address.  */
+  8,   /* Bits in a byte.  */
+  bfd_arch_vax,
+  0,   /* Only 1 machine.  */
+  "vax",
+  "vax",
+  3,
+  TRUE, /* The one and only.  */
+  bfd_default_compatible,
+  bfd_default_scan,
+  bfd_arch_default_fill,
+  NULL,
+  0 /* Maximum offset of a reloc from the start of an insn.  */
+};
index 0543839c66b198e111571a21d09c4b68d74e518c..a1204de99135ed3814ba35e24504266b0252cbb6 100644 (file)
 
 const bfd_arch_info_type bfd_visium_arch =
 {
-  32,                          /* bits per word */
-  32,                          /* bits per address */
-  8,                           /* bits per byte */
-  bfd_arch_visium,             /* architecture */
-  bfd_mach_visium,             /* machine */
-  "visium",                    /* architecture name */
-  "visium",                    /* printable name */
-  2,                           /* section align power */
-  TRUE,                                /* the default ? */
-  bfd_default_compatible,      /* architecture comparison fn */
-  bfd_default_scan,            /* string to architecture convert fn */
-  bfd_arch_default_fill,       /* default fill */
-  NULL                         /* next in list */
+  32,                          /* Bits per word.  */
+  32,                          /* Bits per address.  */
+  8,                           /* Bits per byte.  */
+  bfd_arch_visium,             /* Architecture number.  */
+  bfd_mach_visium,             /* Machine number.  */
+  "visium",                    /* Architecture name.  */
+  "visium",                    /* Machine name.  */
+  2,                           /* Section align power.  */
+  TRUE,                                /* The default ?  */
+  bfd_default_compatible,      /* Architecture comparison fn.  */
+  bfd_default_scan,            /* String to architecture convert fn.  */
+  bfd_arch_default_fill,       /* Default fill.  */
+  NULL,                                /* Next in list.  */
+  0 /* Maximum offset of a reloc from the start of an insn.  */
 };
index 7f2f5629c90f0ff07858331485dcb5679eab5894..142e3c2853ad946fe3df7a6b71dcb914e0fbff32 100644 (file)
@@ -24,8 +24,8 @@
 #include "libiberty.h"
 
 #define N(number, print, default, next)  \
- 32, 32, 8, bfd_arch_wasm32, number, "wasm32", "wasm32", 4, default, bfd_default_compatible, \
-   bfd_default_scan, bfd_arch_default_fill, next }
+ { 32, 32, 8, bfd_arch_wasm32, number, "wasm32", "wasm32", 4, default, bfd_default_compatible, \
+   bfd_default_scan, bfd_arch_default_fill, next, 0 }
 
 static const bfd_arch_info_type arch_info_struct[] =
 {
index 5a3f78b723dd3ece9057443b64ee3f5c5c7f84c5..3605c3c34bd8e7290e767651acdfdb365a4f6c78 100644 (file)
 #include "bfd.h"
 #include "libbfd.h"
 
+#define N(BITS_ADDR, NUMBER, PRINT, DEFAULT, NEXT)     \
+  {                                                    \
+    16,        /* Bits in a word.  */                  \
+    BITS_ADDR, /* Bits in an address.  */              \
+    8,        /* Bits in a byte.  */                   \
+    bfd_arch_xc16x,                                    \
+    NUMBER,                                            \
+    "xc16x",                                           \
+    PRINT,                                             \
+    1,         /* Section alignment power.  */         \
+    DEFAULT,                                           \
+    bfd_default_compatible,                            \
+    bfd_default_scan,                                  \
+    bfd_arch_default_fill,                             \
+    NEXT,                                              \
+    0 /* Maximum offset of a reloc from the start of an insn.  */ \
+  }
+
 const bfd_arch_info_type xc16xs_info_struct =
-{
-  16,                          /* Bits per word.  */
-  16,                          /* Bits per address.  */
-  8,                           /* Bits per byte.  */
-  bfd_arch_xc16x,              /* Architecture.  */
-  bfd_mach_xc16xs,             /* Machine.  */
-  "xc16x",                     /* Architecture name.  */
-  "xc16xs",                    /* Printable name.  */
-  1,                           /* Section alignment - 16 bit.  */
-  TRUE,                                /* The default ?  */
-  bfd_default_compatible,      /* Architecture comparison fn.  */
-  bfd_default_scan,            /* String to architecture convert fn.  */
-  bfd_arch_default_fill,       /* Default fill.  */
-  NULL                         /* Next in list.  */
-};
+  N (16, bfd_mach_xc16xs, "xc16xs", FALSE, NULL);
 
 const bfd_arch_info_type xc16xl_info_struct =
-{
-  16,                          /* Bits per word.  */
-  32,                          /* Bits per address.  */
-  8,                           /* Bits per byte.  */
-  bfd_arch_xc16x,              /* Architecture.  */
-  bfd_mach_xc16xl,             /* Machine.  */
-  "xc16x",                     /* Architecture name.  */
-  "xc16xl",                    /* Printable name.  */
-  1,                           /* Section alignment - 16 bit.  */
-  TRUE,                                /* The default ?  */
-  bfd_default_compatible,      /* Architecture comparison fn.  */
-  bfd_default_scan,            /* String to architecture convert fn.  */
-  bfd_arch_default_fill,       /* Default fill.  */
-  & xc16xs_info_struct         /* Next in list.  */
-};
+  N (32, bfd_mach_xc16xl, "xc16xl", FALSE, & xc16xs_info_struct);
 
 const bfd_arch_info_type bfd_xc16x_arch =
-{
-  16,                          /* Bits per word.  */
-  16,                          /* Bits per address.  */
-  8,                           /* Bits per byte.  */
-  bfd_arch_xc16x,              /* Architecture.  */
-  bfd_mach_xc16x,              /* Machine.  */
-  "xc16x",                     /* Architecture name.  */
-  "xc16x",                     /* Printable name.  */
-  1,                           /* Section alignment - 16 bit.  */
-  TRUE,                                /* The default ?  */
-  bfd_default_compatible,      /* Architecture comparison fn.  */
-  bfd_default_scan,            /* String to architecture convert fn.  */
-  bfd_arch_default_fill,       /* Default fill.  */
-  & xc16xl_info_struct         /* Next in list.  */
-};
+  N (16, bfd_mach_xc16x, "xc16x", TRUE, & xc16xl_info_struct);
+
index 85f1861946a1121a022772a4e7ad5179eb52a39d..720a7382a5cb45452f15282981054af0429c4f34 100644 (file)
 
 const bfd_arch_info_type bfd_xgate_arch =
 {
-    16, /* 16 bits in a word.  */
-    32, /* 32 bits used as 16 bit address and PPAGE value.  */
-    8,  /* 8 bits in a byte.  */
-    bfd_arch_xgate,
-    bfd_mach_xgate,
-    "xgate",
-    "xgate",
-    4, /* Section alignment power.  */
-    TRUE,
-    bfd_default_compatible,
-    bfd_default_scan,
-    bfd_arch_default_fill,
-    0,
+  16, /* Bits in a word.  */
+  32, /* Bits used as 16 bit address and PPAGE value.  */
+  8,  /* Bits in a byte.  */
+  bfd_arch_xgate,
+  bfd_mach_xgate,
+  "xgate",
+  "xgate",
+  4,   /* Section alignment power.  */
+  TRUE,
+  bfd_default_compatible,
+  bfd_default_scan,
+  bfd_arch_default_fill,
+  NULL,
+  0 /* Maximum offset of a reloc from the start of an insn.  */
 };
index f6e461dbe79a567e707fccbc356c45f7af8edd76..84aa391a9cc9d721295c7bc3849d91ca50cb1b0f 100644 (file)
 
 const bfd_arch_info_type bfd_xstormy16_arch =
 {
-  16,                          /* bits per word */
-  32,                          /* bits per address */
-  8,                           /* bits per byte */
-  bfd_arch_xstormy16,          /* architecture */
-  bfd_mach_xstormy16,          /* machine */
-  "xstormy16",                 /* architecture name */
-  "xstormy16",                 /* printable name */
-  2,                           /* section align power */
-  TRUE,                                /* the default ? */
-  bfd_default_compatible,      /* architecture comparison fn */
-  bfd_default_scan,            /* string to architecture convert fn */
+  16,                          /* Bits per word.  */
+  32,                          /* Bits per address.  */
+  8,                           /* Bits per byte.  */
+  bfd_arch_xstormy16,          /* Architecture.  */
+  bfd_mach_xstormy16,          /* Machine.  */
+  "xstormy16",                 /* Architecture name.  */
+  "xstormy16",                 /* Printable name.  */
+  2,                           /* Section align power.  */
+  TRUE,                                /* The default ?  */
+  bfd_default_compatible,      /* Architecture comparison fn.  */
+  bfd_default_scan,            /* String to architecture convert fn.  */
   bfd_arch_default_fill,       /* Default fill.  */
-  NULL                         /* next in list */
+  NULL,                                /* Next in list.  */
+  0 /* Maximum offset of a reloc from the start of an insn.  */
 };
index 24e25a31a1c1d168f0317b5d37e9c0519e267fc3..47668d6e2a48876c50d5a905167d4c47f2b4a395 100644 (file)
@@ -36,5 +36,6 @@ const bfd_arch_info_type bfd_xtensa_arch =
   bfd_default_compatible,      /* Architecture comparison fn.  */
   bfd_default_scan,            /* String to architecture convert fn.  */
   bfd_arch_default_fill,       /* Default fill.  */
-  NULL                         /* Next in list.  */
+  NULL,                                /* Next in list.  */
+  0 /* Maximum offset of a reloc from the start of an insn.  */
 };
index 145aa4f7a9f5134a1bb88062ae199a5458aa5cb8..7d3b8649e38cd1e8ff356b00bae7b0e9f51008e7 100644 (file)
@@ -41,8 +41,8 @@ compatible (const bfd_arch_info_type *a, const bfd_arch_info_type *b)
 }
 
 #define N(name,print,default,next)  \
-{ 16, 16, 8, bfd_arch_z80, name, "z80", print, 0, default, \
-  compatible, bfd_default_scan, bfd_arch_default_fill, next }
+ { 16, 16, 8, bfd_arch_z80, name, "z80", print, 0, default, \
+   compatible, bfd_default_scan, bfd_arch_default_fill, next, 0 }
 
 #define M(n) &arch_info_struct[n]
 
index 48c17debb2d6b165b371cac1b7d1eef157aea2f8..56ee56aac0711dcd5543fb17f9acba9f0eb2a21c 100644 (file)
@@ -37,12 +37,12 @@ compatible (const bfd_arch_info_type *a, const bfd_arch_info_type *b)
 static const bfd_arch_info_type arch_info_struct[] =
 {
   { 32, 16, 8, bfd_arch_z8k, bfd_mach_z8002, "z8k", "z8002", 1, FALSE,
-    compatible, bfd_default_scan, bfd_arch_default_fill, 0 }
+    compatible, bfd_default_scan, bfd_arch_default_fill, NULL, 0 }
 };
 
 const bfd_arch_info_type bfd_z8k_arch =
 {
   32, 32, 8, bfd_arch_z8k, bfd_mach_z8001, "z8k", "z8001", 1, TRUE,
   compatible, bfd_default_scan, bfd_arch_default_fill,
-  &arch_info_struct[0]
+  &arch_info_struct[0], 0
 };
index 5e8e03d6048b36248561b17a8ee4da8e84dba06b..7ccf842955bf21f6dcd62085111bf21e6698b48a 100644 (file)
@@ -1,3 +1,13 @@
+2019-09-10  Nick Clifton  <nickc@redhat.com>
+
+       PR 24907
+       * objdump.c (null_print): New function.
+       (disassemble_bytes): Delete previous_octets local and replace with
+       a test of the max_reloc_offset_into_insn field of the
+       bfd_arch_info structure.  If a reloc is a potential match for the
+       next insn, then perform a dummy disassembly in order to calculate
+       its real length.
+
 2019-09-09  Phil Blundell  <pb@pbcl.net>
 
        binutils 2.33 branch created.
index 33d5d72d3d55d496b8f866a818d8004e68869c0e..2303fe4abf810b3cf9090e3a3ef4349dac809781 100644 (file)
@@ -1836,6 +1836,12 @@ objdump_sprintf (SFILE *f, const char *format, ...)
 
 #define DEFAULT_SKIP_ZEROES_AT_END 3
 
+static int
+null_print (const void * stream ATTRIBUTE_UNUSED, const char * format ATTRIBUTE_UNUSED, ...)
+{
+  return 1;
+}
+
 /* Disassemble some data in memory between given values.  */
 
 static void
@@ -1903,10 +1909,7 @@ disassemble_bytes (struct disassemble_info * inf,
     {
       bfd_vma z;
       bfd_boolean need_nl = FALSE;
-      int previous_octets;
 
-      /* Remember the length of the previous instruction.  */
-      previous_octets = octets;
       octets = 0;
 
       /* Make sure we don't use relocs from previous instructions.  */
@@ -1990,26 +1993,43 @@ disassemble_bytes (struct disassemble_info * inf,
                  && *relppp < relppend)
                {
                  bfd_signed_vma distance_to_rel;
+                 int insn_size = 0;
 
                  distance_to_rel = (**relppp)->address
                    - (rel_offset + addr_offset);
 
+                 if (distance_to_rel > 0
+                     && aux->abfd->arch_info->max_reloc_offset_into_insn <= distance_to_rel)
+                   {
+                     /* This reloc *might* apply to the current insn,
+                        starting somewhere inside it.  Discover the length
+                        of the current insn so that the check below will
+                        work.  */
+                     if (insn_width)
+                       insn_size = insn_width;
+                     else
+                       {
+                         /* We find the length by calling the dissassembler
+                            function with a dummy print handler.  This should
+                            work unless the disassembler is not expecting to
+                            be called multiple times for the same address.
+
+                            This does mean disassembling the instruction
+                            twice, but we only do this when there is a high
+                            probability that there is a reloc that will
+                            affect the instruction.  */
+                         inf->fprintf_func = (fprintf_ftype) null_print;
+                         insn_size = disassemble_fn (section->vma
+                                                     + addr_offset, inf);
+                         inf->fprintf_func = (fprintf_ftype) objdump_sprintf;
+                       }
+                   }
+
                  /* Check to see if the current reloc is associated with
                     the instruction that we are about to disassemble.  */
                  if (distance_to_rel == 0
-                     /* FIXME: This is wrong.  We are trying to catch
-                        relocs that are addressed part way through the
-                        current instruction, as might happen with a packed
-                        VLIW instruction.  Unfortunately we do not know the
-                        length of the current instruction since we have not
-                        disassembled it yet.  Instead we take a guess based
-                        upon the length of the previous instruction.  The
-                        proper solution is to have a new target-specific
-                        disassembler function which just returns the length
-                        of an instruction at a given address without trying
-                        to display its disassembly. */
                      || (distance_to_rel > 0
-                         && distance_to_rel < (bfd_signed_vma) (previous_octets/ opb)))
+                         && distance_to_rel < (bfd_signed_vma) (insn_size / opb)))
                    {
                      inf->flags |= INSN_HAS_RELOC;
                      aux->reloc = **relppp;
index 9c484d3bc6338e081a4c5fa6135cfbd7b2e3c9db..444bd16987bf9e33122c4553d919668d4793f488 100644 (file)
@@ -1,3 +1,9 @@
+2019-09-10  Nick Clifton  <nickc@redhat.com>
+
+       PR 24907
+       * testsuite/gas/arm/pr24907.s: New test.
+       * testsuite/gas/arm/pr24907.d: Expected disassembly.
+
 2019-09-09  Phil Blundell  <pb@pbcl.net>
 
        binutils 2.33 branch created.
diff --git a/gas/testsuite/gas/arm/pr24907.d b/gas/testsuite/gas/arm/pr24907.d
new file mode 100644 (file)
index 0000000..8268d4b
--- /dev/null
@@ -0,0 +1,19 @@
+# name: Disassembling variable width insns with relocs (PR 24907)
+# as:
+# objdump: -d
+# This test is only valid on ELF based ports.
+#notarget: *-*-pe *-*-wince *-*-vxworks
+
+.*: +file format .*arm.*
+
+Disassembly of section \.text:
+
+0+000 <foo>:
+   0:  46c0            nop                     ; .*
+   2:  f7ff fffe       bl      0 <log_func>
+   6:  e002            b\.n    e <func\+0x2>
+   8:  f7ff fffe       bl      c <func>
+
+0+000c <func>:
+   c:  46c0            nop                     ; .*
+   e:  46c0            nop                     ; .*
diff --git a/gas/testsuite/gas/arm/pr24907.s b/gas/testsuite/gas/arm/pr24907.s
new file mode 100644 (file)
index 0000000..ee8114e
--- /dev/null
@@ -0,0 +1,16 @@
+       .syntax unified
+       .text
+       .thumb
+
+.global foo
+foo:
+       nop
+       bl  log_func
+       b.n .L1
+       bl  func
+
+.global func
+func:
+       nop
+.L1:
+       nop
This page took 0.100922 seconds and 4 git commands to generate.