update copyright dates
[deliverable/binutils-gdb.git] / bfd / coff-sh.c
index ade10fca0253040ec5f9f5c066a4b26c697cd1e7..06fd17df0b3919563caf0cb1be8fb3ea2a2b0bfe 100644 (file)
@@ -1,6 +1,6 @@
 /* BFD back-end for Renesas Super-H COFF binaries.
    Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-   2003, 2004 Free Software Foundation, Inc.
+   2003, 2004, 2005 Free Software Foundation, Inc.
    Contributed by Cygnus Support.
    Written by Steve Chamberlain, <sac@cygnus.com>.
    Relaxing code written by Ian Lance Taylor, <ian@cygnus.com>.
@@ -762,9 +762,8 @@ sh_relax_section (abfd, sec, link_info, again)
       laddr += ((irel->r_offset & 0xffffffff) ^ 0x80000000) - 0x80000000;
       if (laddr >= sec->size)
        {
-         (*_bfd_error_handler) ("%s: 0x%lx: warning: bad R_SH_USES offset",
-                                bfd_archive_filename (abfd),
-                                (unsigned long) irel->r_vaddr);
+         (*_bfd_error_handler) ("%B: 0x%lx: warning: bad R_SH_USES offset",
+                                abfd, (unsigned long) irel->r_vaddr);
          continue;
        }
       insn = bfd_get_16 (abfd, contents + laddr);
@@ -773,8 +772,8 @@ sh_relax_section (abfd, sec, link_info, again)
       if ((insn & 0xf000) != 0xd000)
        {
          ((*_bfd_error_handler)
-          ("%s: 0x%lx: warning: R_SH_USES points to unrecognized insn 0x%x",
-           bfd_archive_filename (abfd), (unsigned long) irel->r_vaddr, insn));
+          ("%B: 0x%lx: warning: R_SH_USES points to unrecognized insn 0x%x",
+           abfd, (unsigned long) irel->r_vaddr, insn));
          continue;
        }
 
@@ -790,8 +789,8 @@ sh_relax_section (abfd, sec, link_info, again)
       if (paddr >= sec->size)
        {
          ((*_bfd_error_handler)
-          ("%s: 0x%lx: warning: bad R_SH_USES load offset",
-           bfd_archive_filename (abfd), (unsigned long) irel->r_vaddr));
+          ("%B: 0x%lx: warning: bad R_SH_USES load offset",
+           abfd, (unsigned long) irel->r_vaddr));
          continue;
        }
 
@@ -814,8 +813,8 @@ sh_relax_section (abfd, sec, link_info, again)
       if (irelfn >= irelend)
        {
          ((*_bfd_error_handler)
-          ("%s: 0x%lx: warning: could not find expected reloc",
-           bfd_archive_filename (abfd), (unsigned long) paddr));
+          ("%B: 0x%lx: warning: could not find expected reloc",
+           abfd, (unsigned long) paddr));
          continue;
        }
 
@@ -830,8 +829,8 @@ sh_relax_section (abfd, sec, link_info, again)
       if (sym.n_scnum != 0 && sym.n_scnum != sec->target_index)
        {
          ((*_bfd_error_handler)
-          ("%s: 0x%lx: warning: symbol in unexpected section",
-           bfd_archive_filename (abfd), (unsigned long) paddr));
+          ("%B: 0x%lx: warning: symbol in unexpected section",
+           abfd, (unsigned long) paddr));
          continue;
        }
 
@@ -955,8 +954,8 @@ sh_relax_section (abfd, sec, link_info, again)
       if (irelcount >= irelend)
        {
          ((*_bfd_error_handler)
-          ("%s: 0x%lx: warning: could not find expected COUNT reloc",
-           bfd_archive_filename (abfd), (unsigned long) paddr));
+          ("%B: 0x%lx: warning: could not find expected COUNT reloc",
+           abfd, (unsigned long) paddr));
          continue;
        }
 
@@ -964,9 +963,8 @@ sh_relax_section (abfd, sec, link_info, again)
          just deleted one.  */
       if (irelcount->r_offset == 0)
        {
-         ((*_bfd_error_handler) ("%s: 0x%lx: warning: bad count",
-                                 bfd_archive_filename (abfd),
-                                 (unsigned long) paddr));
+         ((*_bfd_error_handler) ("%B: 0x%lx: warning: bad count",
+                                 abfd, (unsigned long) paddr));
          continue;
        }
 
@@ -1337,8 +1335,8 @@ sh_relax_delete_bytes (abfd, sec, addr, count)
          if (overflow)
            {
              ((*_bfd_error_handler)
-              ("%s: 0x%lx: fatal: reloc overflow while relaxing",
-               bfd_archive_filename (abfd), (unsigned long) irel->r_vaddr));
+              ("%B: 0x%lx: fatal: reloc overflow while relaxing",
+               abfd, (unsigned long) irel->r_vaddr));
              bfd_set_error (bfd_error_bad_value);
              return FALSE;
            }
@@ -1432,8 +1430,7 @@ sh_relax_delete_bytes (abfd, sec, addr, count)
       || obj_raw_syments (abfd) != NULL)
     {
       ((*_bfd_error_handler)
-       ("%s: fatal: generic symbols retrieved before relaxing",
-       bfd_archive_filename (abfd)));
+       ("%B: fatal: generic symbols retrieved before relaxing", abfd));
       bfd_set_error (bfd_error_invalid_operation);
       return FALSE;
     }
@@ -1659,26 +1656,6 @@ static const struct sh_opcode sh_opcode01[] =
   { 0x00ba, SETS1 | USESSP }                   /* sts y1,rn */
 };
 
-/* These sixteen instructions can be handled with one table entry below.  */
-#if 0
-  { 0x0002, SETS1 | USESSP },                  /* stc sr,rn */
-  { 0x0012, SETS1 | USESSP },                  /* stc gbr,rn */
-  { 0x0022, SETS1 | USESSP },                  /* stc vbr,rn */
-  { 0x0032, SETS1 | USESSP },                  /* stc ssr,rn */
-  { 0x0042, SETS1 | USESSP },                  /* stc spc,rn */
-  { 0x0052, SETS1 | USESSP },                  /* stc mod,rn */
-  { 0x0062, SETS1 | USESSP },                  /* stc rs,rn */
-  { 0x0072, SETS1 | USESSP },                  /* stc re,rn */
-  { 0x0082, SETS1 | USESSP },                  /* stc r0_bank,rn */
-  { 0x0092, SETS1 | USESSP },                  /* stc r1_bank,rn */
-  { 0x00a2, SETS1 | USESSP },                  /* stc r2_bank,rn */
-  { 0x00b2, SETS1 | USESSP },                  /* stc r3_bank,rn */
-  { 0x00c2, SETS1 | USESSP },                  /* stc r4_bank,rn */
-  { 0x00d2, SETS1 | USESSP },                  /* stc r5_bank,rn */
-  { 0x00e2, SETS1 | USESSP },                  /* stc r6_bank,rn */
-  { 0x00f2, SETS1 | USESSP }                   /* stc r7_bank,rn */
-#endif
-
 static const struct sh_opcode sh_opcode02[] =
 {
   { 0x0002, SETS1 | USESSP },                  /* stc <special_reg>,rn */
@@ -1809,44 +1786,6 @@ static const struct sh_opcode sh_opcode40[] =
   { 0x40b2, STORE | SETS1 | USES1 | USESSP },  /* sts.l y1,@-rn */
   { 0x40b6, LOAD | SETS1 | SETSSP | USES1 },   /* lds.l @rm+,y1 */
   { 0x40ba, SETSSP | USES1 }                   /* lds.l rm,y1 */
-#if 0 /* These groups sixteen insns can be
-         handled with one table entry each below.  */
-  { 0x4003, STORE | SETS1 | USES1 | USESSP },  /* stc.l sr,@-rn */
-  { 0x4013, STORE | SETS1 | USES1 | USESSP },  /* stc.l gbr,@-rn */
-  { 0x4023, STORE | SETS1 | USES1 | USESSP },  /* stc.l vbr,@-rn */
-  { 0x4033, STORE | SETS1 | USES1 | USESSP },  /* stc.l ssr,@-rn */
-  { 0x4043, STORE | SETS1 | USES1 | USESSP },  /* stc.l spc,@-rn */
-  { 0x4053, STORE | SETS1 | USES1 | USESSP },  /* stc.l mod,@-rn */
-  { 0x4063, STORE | SETS1 | USES1 | USESSP },  /* stc.l rs,@-rn */
-  { 0x4073, STORE | SETS1 | USES1 | USESSP },  /* stc.l re,@-rn */
-  { 0x4083, STORE | SETS1 | USES1 | USESSP },  /* stc.l r0_bank,@-rn */
-  ..
-  { 0x40f3, STORE | SETS1 | USES1 | USESSP },  /* stc.l r7_bank,@-rn */
-
-  { 0x4007, LOAD | SETS1 | SETSSP | USES1 },   /* ldc.l @rm+,sr */
-  { 0x4017, LOAD | SETS1 | SETSSP | USES1 },   /* ldc.l @rm+,gbr */
-  { 0x4027, LOAD | SETS1 | SETSSP | USES1 },   /* ldc.l @rm+,vbr */
-  { 0x4037, LOAD | SETS1 | SETSSP | USES1 },   /* ldc.l @rm+,ssr */
-  { 0x4047, LOAD | SETS1 | SETSSP | USES1 },   /* ldc.l @rm+,spc */
-  { 0x4057, LOAD | SETS1 | SETSSP | USES1 },   /* ldc.l @rm+,mod */
-  { 0x4067, LOAD | SETS1 | SETSSP | USES1 },   /* ldc.l @rm+,rs */
-  { 0x4077, LOAD | SETS1 | SETSSP | USES1 },   /* ldc.l @rm+,re */
-  { 0x4087, LOAD | SETS1 | SETSSP | USES1 },   /* ldc.l @rm+,r0_bank */
-  ..
-  { 0x40f7, LOAD | SETS1 | SETSSP | USES1 },   /* ldc.l @rm+,r7_bank */
-
-  { 0x400e, SETSSP | USES1 },                  /* ldc rm,sr */
-  { 0x401e, SETSSP | USES1 },                  /* ldc rm,gbr */
-  { 0x402e, SETSSP | USES1 },                  /* ldc rm,vbr */
-  { 0x403e, SETSSP | USES1 },                  /* ldc rm,ssr */
-  { 0x404e, SETSSP | USES1 },                  /* ldc rm,spc */
-  { 0x405e, SETSSP | USES1 },                  /* ldc rm,mod */
-  { 0x406e, SETSSP | USES1 },                  /* ldc rm,rs */
-  { 0x407e, SETSSP | USES1 }                   /* ldc rm,re */
-  { 0x408e, SETSSP | USES1 }                   /* ldc rm,r0_bank */
-  ..
-  { 0x40fe, SETSSP | USES1 }                   /* ldc rm,r7_bank */
-#endif
 };
 
 static const struct sh_opcode sh_opcode41[] =
@@ -2788,8 +2727,8 @@ sh_swap_insns (abfd, sec, relocs, contents, addr)
          if (overflow)
            {
              ((*_bfd_error_handler)
-              ("%s: 0x%lx: fatal: reloc overflow while relaxing",
-               bfd_archive_filename (abfd), (unsigned long) irel->r_vaddr));
+              ("%B: 0x%lx: fatal: reloc overflow while relaxing",
+               abfd, (unsigned long) irel->r_vaddr));
              bfd_set_error (bfd_error_bad_value);
              return FALSE;
            }
@@ -2852,8 +2791,8 @@ sh_relocate_section (output_bfd, info, input_bfd, input_section, contents,
              || (unsigned long) symndx >= obj_raw_syment_count (input_bfd))
            {
              (*_bfd_error_handler)
-               ("%s: illegal symbol index %ld in relocs",
-                bfd_archive_filename (input_bfd), symndx);
+               ("%B: illegal symbol index %ld in relocs",
+                input_bfd, symndx);
              bfd_set_error (bfd_error_bad_value);
              return FALSE;
            }
@@ -2949,7 +2888,7 @@ sh_relocate_section (output_bfd, info, input_bfd, input_section, contents,
            if (symndx == -1)
              name = "*ABS*";
            else if (h != NULL)
-             name = h->root.root.string;
+             name = NULL;
            else if (sym->_n._n_n._n_zeroes == 0
                     && sym->_n._n_n._n_offset != 0)
              name = obj_coff_strings (input_bfd) + sym->_n._n_n._n_offset;
@@ -2961,8 +2900,9 @@ sh_relocate_section (output_bfd, info, input_bfd, input_section, contents,
              }
 
            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;
          }
        }
This page took 0.028102 seconds and 4 git commands to generate.