Fix elf64-ppc.c electric fence warning
[deliverable/binutils-gdb.git] / bfd / elf32-sh.c
index a13a6f6276db37e7199636a6ed457ac6e2728c41..567ef249f711a4b8e30110d382728ec8580c8cdd 100644 (file)
@@ -256,10 +256,8 @@ sh_elf_reloc (bfd *abfd, arelent *reloc_entry, asymbol *symbol_in,
     return bfd_reloc_undefined;
 
   /* PR 17512: file: 9891ca98.  */
-  if (addr > bfd_get_section_limit (abfd, input_section)
-      - bfd_get_reloc_size (reloc_entry->howto)
-      || bfd_get_reloc_size (reloc_entry->howto)
-      > bfd_get_section_limit (abfd, input_section))
+  if (addr * bfd_octets_per_byte (abfd) + bfd_get_reloc_size (reloc_entry->howto)
+      > bfd_get_section_limit_octets (abfd, input_section))
     return bfd_reloc_outofrange;
 
   if (bfd_is_com_section (symbol_in->section))
@@ -489,7 +487,7 @@ sh_elf_info_to_howto (bfd *abfd, arelent *cache_ptr, Elf_Internal_Rela *dst)
       || (r >= R_SH_FIRST_INVALID_RELOC_5 && r <= R_SH_LAST_INVALID_RELOC_5)
       || (r >= R_SH_FIRST_INVALID_RELOC_6 && r <= R_SH_LAST_INVALID_RELOC_6))
     {
-      (*_bfd_error_handler) (_("%A: unrecognised SH reloc number: %d"),
+      (*_bfd_error_handler) (_("%B: unrecognised SH reloc number: %d"),
                             abfd, r);
       bfd_set_error (bfd_error_bad_value);
       r = R_SH_NONE;
This page took 0.023763 seconds and 4 git commands to generate.