Add support for the Z80 processor family
[deliverable/binutils-gdb.git] / bfd / coffcode.h
index 917c0e4522bb91e5c26e1ae76b29e8d59c6bd02d..aaf79c10325fe8091ed1e59d1a91930cf6bbe8ed 100644 (file)
@@ -1888,12 +1888,6 @@ coff_set_arch_mach_hook (bfd *abfd, void * filehdr)
       arch = bfd_arch_ia64;
       break;
 #endif
-#ifdef A29K_MAGIC_BIG
-    case A29K_MAGIC_BIG:
-    case A29K_MAGIC_LITTLE:
-      arch = bfd_arch_a29k;
-      break;
-#endif
 #ifdef ARMMAGIC
     case ARMMAGIC:
     case ARMPEMAGIC:
@@ -1961,6 +1955,23 @@ coff_set_arch_mach_hook (bfd *abfd, void * filehdr)
       machine = 88100;
       break;
 #endif
+#ifdef Z80MAGIC
+    case Z80MAGIC:
+      arch = bfd_arch_z80;
+      switch (internal_f->f_flags & F_MACHMASK)
+       {
+       case 0:
+       case bfd_mach_z80strict << 12:
+       case bfd_mach_z80 << 12:
+       case bfd_mach_z80full << 12:
+       case bfd_mach_r800 << 12:
+         machine = ((unsigned)internal_f->f_flags & F_MACHMASK) >> 12;
+         break;
+       default:
+         return FALSE;
+       }
+      break;
+#endif
 #ifdef Z8KMAGIC
     case Z8KMAGIC:
       arch = bfd_arch_z8k;
@@ -2561,6 +2572,24 @@ coff_set_flags (bfd * abfd,
 {
   switch (bfd_get_arch (abfd))
     {
+#ifdef Z80MAGIC
+    case bfd_arch_z80:
+      *magicp = Z80MAGIC;
+      switch (bfd_get_mach (abfd))
+       {
+       case 0:
+       case bfd_mach_z80strict:
+       case bfd_mach_z80:
+       case bfd_mach_z80full:
+       case bfd_mach_r800:
+         *flagsp = bfd_get_mach (abfd) << 12;
+         break;
+       default:
+         return FALSE;
+       }
+      return TRUE;
+#endif
+
 #ifdef Z8KMAGIC
     case bfd_arch_z8k:
       *magicp = Z8KMAGIC;
@@ -2781,15 +2810,6 @@ coff_set_flags (bfd * abfd,
       break;
 #endif
 
-#ifdef A29K_MAGIC_BIG
-    case bfd_arch_a29k:
-      if (bfd_big_endian (abfd))
-       *magicp = A29K_MAGIC_BIG;
-      else
-       *magicp = A29K_MAGIC_LITTLE;
-      return TRUE;
-#endif
-
 #ifdef WE32KMAGIC
     case bfd_arch_we32k:
       *magicp = WE32KMAGIC;
@@ -3771,18 +3791,6 @@ coff_write_object_contents (bfd * abfd)
     internal_f.f_flags |= flags;
     /* ...and the "opt"hdr...  */
 
-#ifdef A29K
-#ifdef ULTRA3                  /* NYU's machine */
-    /* FIXME: This is a bogus check.  I really want to see if there
-       is a .shbss or a .shdata section, if so then set the magic
-       number to indicate a shared data executable.  */
-    if (internal_f.f_nscns >= 7)
-      internal_a.magic = SHMAGIC; /* Shared magic.  */
-    else
-#endif /* ULTRA3 */
-      internal_a.magic = NMAGIC; /* Assume separate i/d.  */
-#define __A_MAGIC_SET__
-#endif /* A29K */
 #ifdef TICOFF_AOUT_MAGIC
     internal_a.magic = TICOFF_AOUT_MAGIC;
 #define __A_MAGIC_SET__
@@ -4481,11 +4489,6 @@ coff_slurp_symbol_table (bfd * abfd)
 
            case C_MOS:         /* Member of structure.  */
            case C_EOS:         /* End of structure.  */
-#ifdef NOTDEF                  /* C_AUTOARG has the same value.  */
-#ifdef C_GLBLREG
-           case C_GLBLREG:     /* A29k-specific storage class.  */
-#endif
-#endif
            case C_REGPARM:     /* Register parameter.  */
            case C_REG:         /* register variable.  */
               /* C_AUTOARG conflicts with TI COFF C_UEXT.  */
@@ -4830,7 +4833,7 @@ coff_slurp_reloc_table (bfd * abfd, sec_ptr asect, asymbol ** symbols)
   amt = (bfd_size_type) asect->reloc_count * sizeof (arelent);
   reloc_cache = bfd_alloc (abfd, amt);
 
-  if (reloc_cache == NULL)
+  if (reloc_cache == NULL || native_relocs == NULL)
     return FALSE;
 
   for (idx = 0; idx < asect->reloc_count; idx++)
This page took 0.081811 seconds and 4 git commands to generate.