2010-06-17 Tristan Gingold <gingold@adacore.com>
[deliverable/binutils-gdb.git] / bfd / aout-tic30.c
index 0feb99decb16f45c3a0a6253ea6bc52836e972f0..05e1a80191cf289d0885be225322eaf6d59b58b4 100644 (file)
@@ -1,5 +1,6 @@
 /* BFD back-end for TMS320C30 a.out binaries.
 /* BFD back-end for TMS320C30 a.out binaries.
-   Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
+   Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2009,
+   2010
    Free Software Foundation, Inc.
    Contributed by Steven Haworth (steve@pm.cse.rmit.edu.au)
 
    Free Software Foundation, Inc.
    Contributed by Steven Haworth (steve@pm.cse.rmit.edu.au)
 
@@ -7,7 +8,7 @@
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2 of the License, or
+   the Free Software Foundation; either version 3 of the License, or
    (at your option) any later version.
 
    This program is distributed in the hope that it will be useful,
    (at your option) any later version.
 
    This program is distributed in the hope that it will be useful,
@@ -35,8 +36,8 @@
 #define TARGETNAME "a.out-tic30"
 #define NAME(x,y) CONCAT3 (tic30_aout,_32_,y)
 
 #define TARGETNAME "a.out-tic30"
 #define NAME(x,y) CONCAT3 (tic30_aout,_32_,y)
 
-#include "bfd.h"
 #include "sysdep.h"
 #include "sysdep.h"
+#include "bfd.h"
 #include "libaout.h"
 #include "aout/aout64.h"
 #include "aout/stab_gnu.h"
 #include "libaout.h"
 #include "aout/aout64.h"
 #include "aout/stab_gnu.h"
@@ -270,6 +271,23 @@ tic30_aout_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED,
     }
 }
 
     }
 }
 
+static reloc_howto_type *
+tic30_aout_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
+                             const char *r_name)
+{
+  unsigned int i;
+
+  for (i = 0;
+       i < (sizeof (tic30_aout_howto_table)
+           / sizeof (tic30_aout_howto_table[0]));
+       i++)
+    if (tic30_aout_howto_table[i].name != NULL
+       && strcasecmp (tic30_aout_howto_table[i].name, r_name) == 0)
+      return &tic30_aout_howto_table[i];
+
+  return NULL;
+}
+
 static reloc_howto_type *
 tic30_aout_reloc_howto (bfd *abfd,
                        struct reloc_std_external *relocs,
 static reloc_howto_type *
 tic30_aout_reloc_howto (bfd *abfd,
                        struct reloc_std_external *relocs,
@@ -279,7 +297,7 @@ tic30_aout_reloc_howto (bfd *abfd,
 {
   unsigned int r_length;
   unsigned int r_pcrel_done;
 {
   unsigned int r_length;
   unsigned int r_pcrel_done;
-  int index;
+  int howto_index;
 
   *r_pcrel = 0;
   if (bfd_header_big_endian (abfd))
 
   *r_pcrel = 0;
   if (bfd_header_big_endian (abfd))
@@ -296,8 +314,8 @@ tic30_aout_reloc_howto (bfd *abfd,
       r_pcrel_done = (0 != (relocs->r_type[0] & RELOC_STD_BITS_PCREL_LITTLE));
       r_length = ((relocs->r_type[0] & RELOC_STD_BITS_LENGTH_LITTLE) >> RELOC_STD_BITS_LENGTH_SH_LITTLE);
     }
       r_pcrel_done = (0 != (relocs->r_type[0] & RELOC_STD_BITS_PCREL_LITTLE));
       r_length = ((relocs->r_type[0] & RELOC_STD_BITS_LENGTH_LITTLE) >> RELOC_STD_BITS_LENGTH_SH_LITTLE);
     }
-  index = r_length + 4 * r_pcrel_done;
-  return tic30_aout_howto_table + index;
+  howto_index = r_length + 4 * r_pcrel_done;
+  return tic30_aout_howto_table + howto_index;
 }
 
 /* These macros will get 24-bit values from the bfd definition.
 }
 
 /* These macros will get 24-bit values from the bfd definition.
@@ -820,6 +838,9 @@ tic30_aout_set_arch_mach (bfd *abfd,
 #ifndef MY_read_ar_hdr
 #define MY_read_ar_hdr                 _bfd_generic_read_ar_hdr
 #endif
 #ifndef MY_read_ar_hdr
 #define MY_read_ar_hdr                 _bfd_generic_read_ar_hdr
 #endif
+#ifndef MY_write_ar_hdr
+#define MY_write_ar_hdr                        _bfd_generic_write_ar_hdr
+#endif
 #ifndef        MY_truncate_arname
 #define        MY_truncate_arname              bfd_bsd_truncate_arname
 #endif
 #ifndef        MY_truncate_arname
 #define        MY_truncate_arname              bfd_bsd_truncate_arname
 #endif
@@ -933,9 +954,15 @@ tic30_aout_set_arch_mach (bfd *abfd,
 #define MY_section_already_linked \
   _bfd_generic_section_already_linked
 #endif
 #define MY_section_already_linked \
   _bfd_generic_section_already_linked
 #endif
+#ifndef MY_bfd_define_common_symbol
+#define MY_bfd_define_common_symbol bfd_generic_define_common_symbol
+#endif
 #ifndef MY_bfd_reloc_type_lookup
 #define MY_bfd_reloc_type_lookup tic30_aout_reloc_type_lookup
 #endif
 #ifndef MY_bfd_reloc_type_lookup
 #define MY_bfd_reloc_type_lookup tic30_aout_reloc_type_lookup
 #endif
+#ifndef MY_bfd_reloc_name_lookup
+#define MY_bfd_reloc_name_lookup tic30_aout_reloc_name_lookup
+#endif
 #ifndef MY_bfd_make_debug_symbol
 #define MY_bfd_make_debug_symbol 0
 #endif
 #ifndef MY_bfd_make_debug_symbol
 #define MY_bfd_make_debug_symbol 0
 #endif
@@ -957,6 +984,10 @@ tic30_aout_set_arch_mach (bfd *abfd,
 #ifndef MY_bfd_link_just_syms
 #define MY_bfd_link_just_syms _bfd_generic_link_just_syms
 #endif
 #ifndef MY_bfd_link_just_syms
 #define MY_bfd_link_just_syms _bfd_generic_link_just_syms
 #endif
+#ifndef MY_bfd_copy_link_hash_symbol_type
+#define MY_bfd_copy_link_hash_symbol_type \
+  _bfd_generic_copy_link_hash_symbol_type
+#endif
 #ifndef MY_bfd_link_split_section
 #define MY_bfd_link_split_section  _bfd_generic_link_split_section
 #endif
 #ifndef MY_bfd_link_split_section
 #define MY_bfd_link_split_section  _bfd_generic_link_split_section
 #endif
This page took 0.030074 seconds and 4 git commands to generate.