Add support for marking ARM ELF binaries as support the Cirrus EP9312 Maverick
[deliverable/binutils-gdb.git] / bfd / archures.c
index 583098a8ef4e417e5a010b7619e26caa3519ba23..62edda109bb19688f5021a367c978ecdd9c486ae 100644 (file)
@@ -1,6 +1,6 @@
 /* BFD library support routines for architectures.
    Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-   2000, 2001, 2002
+   2000, 2001, 2002, 2003
    Free Software Foundation, Inc.
    Hacked by John Gilmore and Steve Chamberlain of Cygnus Support.
 
@@ -145,6 +145,7 @@ DESCRIPTION
 .#define bfd_mach_mips5                 5
 .#define bfd_mach_mips_sb1              12310201 {* octal 'SB', 01 *}
 .#define bfd_mach_mipsisa32             32
+.#define bfd_mach_mipsisa32r2           33
 .#define bfd_mach_mipsisa64             64
 .  bfd_arch_i386,      {* Intel 386 *}
 .#define bfd_mach_i386_i386 1
@@ -201,6 +202,9 @@ DESCRIPTION
 .  bfd_arch_dlx,       {* DLX *}
 .  bfd_arch_m68hc11,   {* Motorola 68HC11 *}
 .  bfd_arch_m68hc12,   {* Motorola 68HC12 *}
+.#define bfd_mach_m6812_default 0
+.#define bfd_mach_m6812         1
+.#define bfd_mach_m6812s        2
 .  bfd_arch_z8k,       {* Zilog Z8000 *}
 .#define bfd_mach_z8001                1
 .#define bfd_mach_z8002                2
@@ -209,6 +213,7 @@ DESCRIPTION
 .#define bfd_mach_sh            1
 .#define bfd_mach_sh2        0x20
 .#define bfd_mach_sh_dsp     0x2d
+.#define bfd_mach_sh2e       0x2e
 .#define bfd_mach_sh3        0x30
 .#define bfd_mach_sh3_dsp    0x3d
 .#define bfd_mach_sh3e       0x3e
@@ -229,6 +234,7 @@ DESCRIPTION
 .#define bfd_mach_arm_5T       8
 .#define bfd_mach_arm_5TE      9
 .#define bfd_mach_arm_XScale   10
+.#define bfd_mach_arm_ep9312   11
 .  bfd_arch_ns32k,     {* National Semiconductors ns32000 *}
 .  bfd_arch_w65,       {* WDC 65816 *}
 .  bfd_arch_tic30,     {* Texas Instruments TMS320C30 *}
@@ -268,6 +274,9 @@ DESCRIPTION
 .  bfd_arch_ip2k,      {* Ubicom IP2K microcontrollers. *}
 .#define bfd_mach_ip2022       1
 .#define bfd_mach_ip2022ext    2
+. bfd_arch_iq2000,     {* Vitesse IQ2000.  *}
+.#define bfd_mach_iq2000        1
+.#define bfd_mach_iq10          2
 .  bfd_arch_pj,
 .  bfd_arch_avr,       {* Atmel AVR microcontrollers.  *}
 .#define bfd_mach_avr1         1
@@ -283,6 +292,20 @@ DESCRIPTION
 .  bfd_arch_mmix,      {* Donald Knuth's educational processor.  *}
 .  bfd_arch_xstormy16,
 .#define bfd_mach_xstormy16    1
+.  bfd_arch_msp430,    {* Texas Instruments MSP430 architecture.  *}
+.#define bfd_mach_msp110         110
+.#define bfd_mach_msp11          11
+.#define bfd_mach_msp12          12
+.#define bfd_mach_msp13          13
+.#define bfd_mach_msp14          14
+.#define bfd_mach_msp41          41
+.#define bfd_mach_msp31          31
+.#define bfd_mach_msp32          32
+.#define bfd_mach_msp33          33
+.#define bfd_mach_msp43          43
+.#define bfd_mach_msp44          44
+.#define bfd_mach_msp15          15
+.#define bfd_mach_msp16          16  
 .  bfd_arch_last
 .  };
 */
@@ -342,6 +365,7 @@ extern const bfd_arch_info_type bfd_i860_arch;
 extern const bfd_arch_info_type bfd_i960_arch;
 extern const bfd_arch_info_type bfd_ia64_arch;
 extern const bfd_arch_info_type bfd_ip2k_arch;
+extern const bfd_arch_info_type bfd_iq2000_arch;
 extern const bfd_arch_info_type bfd_m32r_arch;
 extern const bfd_arch_info_type bfd_m68hc11_arch;
 extern const bfd_arch_info_type bfd_m68hc12_arch;
@@ -352,6 +376,7 @@ extern const bfd_arch_info_type bfd_mips_arch;
 extern const bfd_arch_info_type bfd_mmix_arch;
 extern const bfd_arch_info_type bfd_mn10200_arch;
 extern const bfd_arch_info_type bfd_mn10300_arch;
+extern const bfd_arch_info_type bfd_msp430_arch;
 extern const bfd_arch_info_type bfd_ns32k_arch;
 extern const bfd_arch_info_type bfd_openrisc_arch;
 extern const bfd_arch_info_type bfd_or32_arch;
@@ -399,6 +424,7 @@ static const bfd_arch_info_type * const bfd_archures_list[] =
     &bfd_i960_arch,
     &bfd_ia64_arch,
     &bfd_ip2k_arch,
+    &bfd_iq2000_arch,
     &bfd_m32r_arch,
     &bfd_m68hc11_arch,
     &bfd_m68hc12_arch,
@@ -409,6 +435,7 @@ static const bfd_arch_info_type * const bfd_archures_list[] =
     &bfd_mmix_arch,
     &bfd_mn10200_arch,
     &bfd_mn10300_arch,
+    &bfd_msp430_arch,
     &bfd_ns32k_arch,
     &bfd_openrisc_arch,
     &bfd_or32_arch,
@@ -544,27 +571,39 @@ FUNCTION
 SYNOPSIS
        const bfd_arch_info_type *bfd_arch_get_compatible(
                const bfd *abfd,
-               const bfd *bbfd);
+               const bfd *bbfd,
+               bfd_boolean accept_unknowns);
 
 DESCRIPTION
-       Determine whether two BFDs'
-       architectures and machine types are compatible.  Calculates
-       the lowest common denominator between the two architectures
-       and machine types implied by the BFDs and returns a pointer to
-       an <<arch_info>> structure describing the compatible machine.
+       Determine whether two BFDs' architectures and machine types
+       are compatible.  Calculates the lowest common denominator
+       between the two architectures and machine types implied by
+       the BFDs and returns a pointer to an <<arch_info>> structure
+       describing the compatible machine.
 */
 
 const bfd_arch_info_type *
-bfd_arch_get_compatible (abfd, bbfd)
+bfd_arch_get_compatible (abfd, bbfd, accept_unknowns)
      const bfd *abfd;
      const bfd *bbfd;
+     bfd_boolean accept_unknowns;
 {
-  /* If either architecture is unknown, then all we can do is assume
-     the user knows what he's doing.  */
-  if (abfd->arch_info->arch == bfd_arch_unknown)
-    return bbfd->arch_info;
-  if (bbfd->arch_info->arch == bfd_arch_unknown)
-    return abfd->arch_info;
+  const bfd * ubfd = NULL;
+
+  /* Look for an unknown architecture.  */
+  if (((ubfd = abfd) && ubfd->arch_info->arch == bfd_arch_unknown)
+      || ((ubfd = bbfd) && ubfd->arch_info->arch == bfd_arch_unknown))
+    {
+      /* We can allow an unknown architecture if accept_unknowns
+        is true, or if the target is the "binary" format, which
+        has an unknown architecture.  Since the binary format can
+        only be set by explicit request from the user, it is safe
+        to assume that they know what they are doing.  */
+      if (accept_unknowns
+         || strcmp (bfd_get_target (ubfd), "binary") == 0)
+       return ubfd->arch_info;
+      return NULL;
+    }
 
   /* Otherwise architecture-specific code has to decide.  */
   return abfd->arch_info->compatible (abfd->arch_info, bbfd->arch_info);
This page took 0.026958 seconds and 4 git commands to generate.