Remove sh-symbianelf support
[deliverable/binutils-gdb.git] / bfd / elf64-sh64.c
index 0c6ae2e3ceee8b3939cba2fb1782f63c567ac9f3..b771759c8602205df81740b04148c3377a5be25e 100644 (file)
@@ -1400,7 +1400,7 @@ sh_elf64_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
 
    See sh_elf_info_to_howto in elf32-sh.c for the original.  */
 
-static void
+static bfd_boolean
 sh_elf64_info_to_howto (bfd *abfd ATTRIBUTE_UNUSED, arelent *cache_ptr,
                        Elf_Internal_Rela *dst)
 {
@@ -1408,13 +1408,21 @@ sh_elf64_info_to_howto (bfd *abfd ATTRIBUTE_UNUSED, arelent *cache_ptr,
 
   r = ELF64_R_TYPE (dst->r_info);
 
-  BFD_ASSERT (r <= (unsigned int) R_SH_64_PCREL);
+  if (r > (unsigned int) R_SH_64_PCREL)
+    {
+      /* xgettext:c-format */
+      _bfd_error_handler (_("%pB: unsupported relocation type %#x"), abfd, r);
+      bfd_set_error (bfd_error_bad_value);
+      return FALSE;
+    }
+    
   BFD_ASSERT (r < R_SH_FIRST_INVALID_RELOC || r > R_SH_LAST_INVALID_RELOC);
   BFD_ASSERT (r < R_SH_DIR8WPN || r > R_SH_LAST_INVALID_RELOC_2);
   BFD_ASSERT (r < R_SH_FIRST_INVALID_RELOC_3 || r > R_SH_GOTPLT32);
   BFD_ASSERT (r < R_SH_FIRST_INVALID_RELOC_4 || r > R_SH_LAST_INVALID_RELOC_4);
 
   cache_ptr->howto = &sh_elf64_howto_table[r];
+  return cache_ptr->howto != NULL;
 }
 
 /* Relocate an SH ELF section.
@@ -1505,7 +1513,7 @@ sh_elf64_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED,
          if ((sym->st_other & STO_SH5_ISA32) != 0)
            (*info->callbacks->reloc_dangerous)
              (info,
-              _("Unexpected STO_SH5_ISA32 on local symbol is not handled"),
+              _("unexpected STO_SH5_ISA32 on local symbol is not handled"),
               input_bfd, input_section, rel->r_offset);
 
          if (sec != NULL && discarded_section (sec))
@@ -1536,9 +1544,10 @@ sh_elf64_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED,
                {
                  _bfd_error_handler
                    /* xgettext:c-format */
-                   (_("%B(%A+%#Lx): %s relocation against SEC_MERGE section"),
+                   (_("%pB(%pA+%#" PRIx64 "): "
+                      "%s relocation against SEC_MERGE section"),
                     input_bfd, input_section,
-                    rel->r_offset, howto->name);
+                    (uint64_t) rel->r_offset, howto->name);
                  return FALSE;
                }
 
@@ -1633,10 +1642,11 @@ sh_elf64_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED,
                {
                  _bfd_error_handler
                    /* xgettext:c-format */
-                   (_("%B(%A+%#Lx): unresolvable %s relocation against symbol `%s'"),
+                   (_("%pB(%pA+%#" PRIx64 "): "
+                      "unresolvable %s relocation against symbol `%s'"),
                     input_bfd,
                     input_section,
-                    rel->r_offset,
+                    (uint64_t) rel->r_offset,
                     howto->name,
                     h->root.root.string);
                }
@@ -1677,9 +1687,10 @@ sh_elf64_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED,
        {
          _bfd_error_handler
            /* xgettext:c-format */
-           (_("%B: error: unaligned relocation type %d at %08Lx reloc %08Lx"),
-            input_bfd, (int) r_type, rel->r_offset,
-            relocation);
+           (_("%pB: error: unaligned relocation type %d at "
+              "%08" PRIx64 " reloc %08" PRIx64 ""),
+            input_bfd, (int) r_type,
+            (uint64_t) rel->r_offset, (uint64_t) relocation);
          bfd_set_error (bfd_error_bad_value);
          return FALSE;
        }
@@ -2274,14 +2285,14 @@ sh_elf64_merge_private_data (bfd *ibfd, struct bfd_link_info *info)
       if (bfd_get_arch_size (ibfd) == 32
          && bfd_get_arch_size (obfd) == 64)
        /* xgettext:c-format */
-       msg = _("%B: compiled as 32-bit object and %B is 64-bit");
+       msg = _("%pB: compiled as 32-bit object and %pB is 64-bit");
       else if (bfd_get_arch_size (ibfd) == 64
               && bfd_get_arch_size (obfd) == 32)
        /* xgettext:c-format */
-       msg = _("%B: compiled as 64-bit object and %B is 32-bit");
+       msg = _("%pB: compiled as 64-bit object and %pB is 32-bit");
       else
        /* xgettext:c-format */
-       msg = _("%B: object size does not match that of target %B");
+       msg = _("%pB: object size does not match that of target %pB");
 
       _bfd_error_handler (msg, ibfd, obfd);
       bfd_set_error (bfd_error_wrong_format);
@@ -2302,7 +2313,7 @@ sh_elf64_merge_private_data (bfd *ibfd, struct bfd_link_info *info)
   else if ((new_flags & EF_SH_MACH_MASK) != EF_SH5)
     {
       _bfd_error_handler
-       ("%B: does not use the SH64 64-bit ABI as previous modules do", ibfd);
+       ("%pB: does not use the SH64 64-bit ABI as previous modules do", ibfd);
       bfd_set_error (bfd_error_bad_value);
       return FALSE;
     }
@@ -2769,7 +2780,7 @@ sh64_elf64_add_symbol_hook (bfd *abfd, struct bfd_link_info *info,
        {
          /* Make sure we don't get confused on invalid input.  */
          _bfd_error_handler
-           (_("%B: encountered datalabel symbol in input"), abfd);
+           (_("%pB: encountered datalabel symbol in input"), abfd);
          bfd_set_error (bfd_error_bad_value);
          return FALSE;
        }
This page took 0.027551 seconds and 4 git commands to generate.