* elf-hppa.h (elf_hppa_reloc_final_type): Handle R_PARISC_GPREL64,
[deliverable/binutils-gdb.git] / bfd / coff-tic30.c
index a3bbc4c8d23be377da718c59d583d62011f6538e..033f79db05ed5b204390d6764b59d62ecf6e7aa9 100644 (file)
@@ -1,12 +1,13 @@
 /* BFD back-end for TMS320C30 coff binaries.
 /* BFD back-end for TMS320C30 coff binaries.
-   Copyright 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
+   Copyright 1998, 1999, 2000, 2001, 2002, 2007, 2008
+   Free Software Foundation, Inc.
    Contributed by Steven Haworth (steve@pm.cse.rmit.edu.au)
 
    This file is part of BFD, the Binary File Descriptor library.
 
    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
    Contributed by Steven Haworth (steve@pm.cse.rmit.edu.au)
 
    This file is part of BFD, the Binary File Descriptor library.
 
    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,
 
    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
 
    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
-   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-   02111-1307, USA.  */
+   Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
+   02110-1301, USA.  */
 
 
-#include "bfd.h"
 #include "sysdep.h"
 #include "sysdep.h"
+#include "bfd.h"
 #include "libbfd.h"
 #include "bfdlink.h"
 #include "coff/tic30.h"
 #include "libbfd.h"
 #include "bfdlink.h"
 #include "coff/tic30.h"
@@ -37,21 +38,22 @@ reloc_howto_type * tic30_coff_reloc_type_lookup PARAMS ((bfd *, bfd_reloc_code_r
 
 reloc_howto_type tic30_coff_howto_table[] =
   {
 
 reloc_howto_type tic30_coff_howto_table[] =
   {
-    HOWTO (R_TIC30_ABS16, 2, 1, 16, false, 0, 0, NULL,
-          "16", false, 0x0000FFFF, 0x0000FFFF, false),
-    HOWTO (R_TIC30_ABS24, 2, 2, 24, false, 8, complain_overflow_bitfield, NULL,
-          "24", false, 0xFFFFFF00, 0xFFFFFF00, false),
-    HOWTO (R_TIC30_LDP, 18, 0, 24, false, 0, complain_overflow_bitfield, NULL,
-          "LDP", false, 0x00FF0000, 0x000000FF, false),
-    HOWTO (R_TIC30_ABS32, 2, 2, 32, false, 0, complain_overflow_bitfield, NULL,
-          "32", false, 0xFFFFFFFF, 0xFFFFFFFF, false),
-    HOWTO (R_TIC30_PC16, 2, 1, 16, true, 0, complain_overflow_signed, NULL,
-          "PCREL", false, 0x0000FFFF, 0x0000FFFF, false),
+    HOWTO (R_TIC30_ABS16, 2, 1, 16, FALSE, 0, 0, NULL,
+          "16", FALSE, 0x0000FFFF, 0x0000FFFF, FALSE),
+    HOWTO (R_TIC30_ABS24, 2, 2, 24, FALSE, 8, complain_overflow_bitfield, NULL,
+          "24", FALSE, 0xFFFFFF00, 0xFFFFFF00, FALSE),
+    HOWTO (R_TIC30_LDP, 18, 0, 24, FALSE, 0, complain_overflow_bitfield, NULL,
+          "LDP", FALSE, 0x00FF0000, 0x000000FF, FALSE),
+    HOWTO (R_TIC30_ABS32, 2, 2, 32, FALSE, 0, complain_overflow_bitfield, NULL,
+          "32", FALSE, 0xFFFFFFFF, 0xFFFFFFFF, FALSE),
+    HOWTO (R_TIC30_PC16, 2, 1, 16, TRUE, 0, complain_overflow_signed, NULL,
+          "PCREL", FALSE, 0x0000FFFF, 0x0000FFFF, FALSE),
     EMPTY_HOWTO (-1)
   };
 
 #ifndef coff_bfd_reloc_type_lookup
 #define coff_bfd_reloc_type_lookup tic30_coff_reloc_type_lookup
     EMPTY_HOWTO (-1)
   };
 
 #ifndef coff_bfd_reloc_type_lookup
 #define coff_bfd_reloc_type_lookup tic30_coff_reloc_type_lookup
+#define coff_bfd_reloc_name_lookup tic30_coff_reloc_name_lookup
 
 /* For the case statement use the code values used in tc_gen_reloc to
    map to the howto table entries that match those in both the aout
 
 /* For the case statement use the code values used in tc_gen_reloc to
    map to the howto table entries that match those in both the aout
@@ -80,6 +82,23 @@ tic30_coff_reloc_type_lookup (abfd, code)
     }
 }
 
     }
 }
 
+static reloc_howto_type *
+tic30_coff_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
+                             const char *r_name)
+{
+  unsigned int i;
+
+  for (i = 0;
+       i < (sizeof (tic30_coff_howto_table)
+           / sizeof (tic30_coff_howto_table[0]));
+       i++)
+    if (tic30_coff_howto_table[i].name != NULL
+       && strcasecmp (tic30_coff_howto_table[i].name, r_name) == 0)
+      return &tic30_coff_howto_table[i];
+
+  return NULL;
+}
+
 #endif
 
 /* Turn a howto into a reloc number.  */
 #endif
 
 /* Turn a howto into a reloc number.  */
@@ -163,6 +182,10 @@ reloc_processing (relent, reloc, symbols, abfd, section)
   relent->address -= section->vma;
 }
 
   relent->address -= section->vma;
 }
 
+#ifndef bfd_pe_print_pdata
+#define bfd_pe_print_pdata     NULL
+#endif
+
 #include "coffcode.h"
 
 const bfd_target tic30_coff_vec =
 #include "coffcode.h"
 
 const bfd_target tic30_coff_vec =
This page took 0.025261 seconds and 4 git commands to generate.