Add support for interwotking between Thumb code and non-interworking aware ARM code.
[binutils-gdb.git] / bfd / cpu-h8300.c
index 649847810bbf20cd03ef187b8aa99014a17a54bd..31972050d25d068c51e321badc933b4dd1fad55e 100644 (file)
@@ -1,5 +1,5 @@
 /* BFD library support routines for the Hitachi H8/300 architecture.
-   Copyright (C) 1990-1991 Free Software Foundation, Inc.
+   Copyright (C) 1990, 91, 92, 93, 94 Free Software Foundation, Inc.
    Hacked by Steve Chamberlain of Cygnus Support.
 
 This file is part of BFD, the Binary File Descriptor library.
@@ -22,19 +22,20 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
 #include "sysdep.h"
 #include "libbfd.h"
 
+#if 0 /* not used currently */
 /*
 Relocations for the H8
 
 */
 static bfd_reloc_status_type
-DEFUN (howto16_callback, (abfd, reloc_entry, symbol_in, data,
-                         ignore_input_section, ignore_bfd),
-       bfd * abfd AND
-       arelent * reloc_entry AND
-       struct symbol_cache_entry *symbol_in AND
-       PTR data AND
-       asection * ignore_input_section AND
-       bfd * ignore_bfd)
+howto16_callback (abfd, reloc_entry, symbol_in, data,
+                 ignore_input_section, ignore_bfd)
+     bfd * abfd;
+     arelent * reloc_entry;
+     struct symbol_cache_entry *symbol_in;
+     PTR data;
+     asection * ignore_input_section;
+     bfd * ignore_bfd;
 {
   long relocation = 0;
   bfd_vma addr = reloc_entry->address;
@@ -50,14 +51,14 @@ DEFUN (howto16_callback, (abfd, reloc_entry, symbol_in, data,
 
 
 static bfd_reloc_status_type
-DEFUN (howto8_callback, (abfd, reloc_entry, symbol_in, data,
-                        ignore_input_section, ignore_bfd),
-       bfd * abfd AND
-       arelent * reloc_entry AND
-       struct symbol_cache_entry *symbol_in AND
-       PTR data AND
-       asection * ignore_input_section AND
-       bfd * ignore_bfd)
+howto8_callback (abfd, reloc_entry, symbol_in, data,
+                ignore_input_section, ignore_bfd)
+     bfd * abfd;
+     arelent * reloc_entry;
+     struct symbol_cache_entry *symbol_in;
+     PTR data;
+     asection * ignore_input_section;
+     bfd * ignore_bfd;
 {
   long relocation = 0;
   bfd_vma addr = reloc_entry->address;
@@ -73,14 +74,14 @@ DEFUN (howto8_callback, (abfd, reloc_entry, symbol_in, data,
 
 
 static bfd_reloc_status_type
-DEFUN (howto8_FFnn_callback, (abfd, reloc_entry, symbol_in, data,
-                             ignore_input_section, ignore_bfd),
-       bfd * abfd AND
-       arelent * reloc_entry AND
-       struct symbol_cache_entry *symbol_in AND
-       PTR data AND
-       asection * ignore_input_section AND
-       bfd * ignore_bfd)
+howto8_FFnn_callback (abfd, reloc_entry, symbol_in, data,
+                     ignore_input_section, ignore_bfd)
+     bfd * abfd;
+     arelent * reloc_entry;
+     struct symbol_cache_entry *symbol_in;
+     PTR data;
+     asection * ignore_input_section;
+     bfd * ignore_bfd;
 {
   long relocation = 0;
   bfd_vma addr = reloc_entry->address;
@@ -96,14 +97,14 @@ DEFUN (howto8_FFnn_callback, (abfd, reloc_entry, symbol_in, data,
 }
 
 static bfd_reloc_status_type
-DEFUN (howto8_pcrel_callback, (abfd, reloc_entry, symbol_in, data,
-                              ignore_input_section, ignore_bfd),
-       bfd * abfd AND
-       arelent * reloc_entry AND
-       struct symbol_cache_entry *symbol_in AND
-       PTR data AND
-       asection * ignore_input_section AND
-       bfd * ignore_bfd)
+howto8_pcrel_callback (abfd, reloc_entry, symbol_in, data,
+                      ignore_input_section, ignore_bfd)
+     bfd * abfd;
+     arelent * reloc_entry;
+     struct symbol_cache_entry *symbol_in;
+     PTR data;
+     asection * ignore_input_section;
+     bfd * ignore_bfd;
 {
   long relocation = 0;
   bfd_vma addr = reloc_entry->address;
@@ -117,8 +118,6 @@ DEFUN (howto8_pcrel_callback, (abfd, reloc_entry, symbol_in, data,
   return bfd_reloc_ok;
 }
 
-
-
 static reloc_howto_type howto_16
 = NEWHOWTO (howto16_callback, "abs16", 1, false, false);
 static reloc_howto_type howto_8
@@ -130,12 +129,11 @@ static reloc_howto_type howto_8_FFnn
 static reloc_howto_type howto_8_pcrel
 = NEWHOWTO (howto8_pcrel_callback, "pcrel8", 0, false, true);
 
-
-static CONST struct reloc_howto_struct *
-DEFUN (local_bfd_reloc_type_lookup, (arch, code),
-       CONST struct bfd_arch_info *arch AND
-       bfd_reloc_code_real_type code)
-  {
+static reloc_howto_type *
+local_bfd_reloc_type_lookup (arch, code)
+     CONST struct bfd_arch_info *arch;
+     bfd_reloc_code_real_type code;
+{
     switch (code)
       {
       case BFD_RELOC_16:
@@ -150,15 +148,16 @@ DEFUN (local_bfd_reloc_type_lookup, (arch, code),
        return (reloc_howto_type *) NULL;
       }
   }
+#endif
 
 int bfd_default_scan_num_mach ();
 
 static boolean
-DEFUN (h8300_scan, (info, string),
-       CONST struct bfd_arch_info *info AND
-       CONST char *string)
+h8300_scan (info, string)
+     CONST struct bfd_arch_info *info;
+     CONST char *string;
 {
-  if (*string != 'h' && *string == 'H')
+  if (*string != 'h' && *string != 'H')
     return false;
 
   string++;
@@ -180,7 +179,7 @@ DEFUN (h8300_scan, (info, string),
   string++;
   if (*string == '-')
     string++;
-  if (*string == 'h' && *string == 'H')
+  if (*string == 'h' || *string == 'H')
     {
       return (info->mach == bfd_mach_h8300h);
     }
@@ -191,14 +190,14 @@ DEFUN (h8300_scan, (info, string),
 }
 
 
-/* This routine is provided two arch_infos and works out the i960
+/* This routine is provided two arch_infos and works out the 
    machine which would be compatible with both and returns a pointer
    to its info structure */
 
-CONST bfd_arch_info_type *
-DEFUN (compatible, (in, out),
-       CONST bfd_arch_info_type * in AND
-       CONST bfd_arch_info_type * out)
+static CONST bfd_arch_info_type *
+compatible (in, out)
+     CONST bfd_arch_info_type * in;
+     CONST bfd_arch_info_type * out;
 {
   /* If the output is non-H and the input is -H, that's bad */
   if (in->mach == bfd_mach_h8300h &&
@@ -249,7 +248,7 @@ static bfd_arch_info_type h8300h_info_struct =
 };
 
 void
-DEFUN_VOID (bfd_h8300_arch)
+bfd_h8300_arch()
 {
   bfd_arch_linkin (&h8300_info_struct);
   bfd_arch_linkin (&h8300h_info_struct);