bfd/
[binutils-gdb.git] / bfd / coff-tic80.c
index 7329b7b0dcdde1ac2377f641713f66552fc6bad8..9a71c9d2cd219ebc027ece3107fbf643df95bf7f 100644 (file)
@@ -1,5 +1,6 @@
 /* BFD back-end for Texas Instruments TMS320C80 Multimedia Video Processor (MVP).
-   Copyright 1996, 1997, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+   Copyright 1996, 1997, 1999, 2000, 2001, 2002, 2003, 2004, 2005
+   Free Software Foundation, Inc.
 
    Written by Fred Fish (fnf@cygnus.com)
 
@@ -21,7 +22,7 @@ GNU General Public License for more details.
 You should have received a copy of the GNU General Public License
 along with this program; if not, write to the Free Software
 Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA.  */
+Boston, MA 02110-1301, USA.  */
 
 #include "bfd.h"
 #include "bfdlink.h"
@@ -576,7 +577,7 @@ coff_tic80_relocate_section (output_bfd, info, input_bfd,
                     + sec->output_offset);
              }
 
-         else if (! info->relocateable)
+         else if (! info->relocatable)
            {
              if (! ((*info->callbacks->undefined_symbol)
                     (info, h->root.root.string, input_bfd, input_section,
@@ -683,10 +684,8 @@ coff_tic80_relocate_section (output_bfd, info, input_bfd,
          break;
        case bfd_reloc_outofrange:
          (*_bfd_error_handler)
-           (_("%s: bad reloc address 0x%lx in section `%s'"),
-            bfd_archive_filename (input_bfd),
-            (unsigned long) rel->r_vaddr,
-            bfd_get_section_name (input_bfd, input_section));
+           (_("%B: bad reloc address 0x%lx in section `%A'"),
+            input_bfd, input_section, (unsigned long) rel->r_vaddr);
          return FALSE;
        case bfd_reloc_overflow:
          {
@@ -696,7 +695,7 @@ coff_tic80_relocate_section (output_bfd, info, input_bfd,
            if (symndx == -1)
              name = "*ABS*";
            else if (h != NULL)
-             name = h->root.root.string;
+             name = NULL;
            else
              {
                name = _bfd_coff_internal_syment_name (input_bfd, sym, buf);
@@ -705,8 +704,9 @@ coff_tic80_relocate_section (output_bfd, info, input_bfd,
              }
 
            if (! ((*info->callbacks->reloc_overflow)
-                  (info, name, howto->name, (bfd_vma) 0, input_bfd,
-                   input_section, rel->r_vaddr - input_section->vma)))
+                  (info, (h ? &h->root : NULL), name, howto->name,
+                   (bfd_vma) 0, input_bfd, input_section,
+                   rel->r_vaddr - input_section->vma)))
              return FALSE;
          }
        }
@@ -714,6 +714,15 @@ coff_tic80_relocate_section (output_bfd, info, input_bfd,
   return TRUE;
 }
 \f
+/* Clear the r_reserved field in relocs.  */
+#define SWAP_OUT_RELOC_EXTRA(abfd,src,dst) \
+  do \
+    { \
+      dst->r_reserved[0] = 0; \
+      dst->r_reserved[1] = 0; \
+    } \
+  while (0)
+
 #define TIC80COFF 1            /* Customize coffcode.h */
 #undef C_AUTOARG               /* Clashes with TIc80's C_UEXT */
 #undef C_LASTENT               /* Clashes with TIc80's C_STATLAB */