gdb: Split func_command into two parts.
[deliverable/binutils-gdb.git] / bfd / elf32-v850.c
index 9a1b19555e2fea5ed7badd96be959c79432efbcf..430153abc5e5f7f1dcd523692c3c19d2f88e9b67 100644 (file)
@@ -150,19 +150,19 @@ v850_elf_check_relocs (bfd *abfd,
                  switch (h->other & V850_OTHER_MASK)
                    {
                    default:
-                     msg = _("Variable `%s' cannot occupy in multiple small data regions");
+                     msg = _("variable `%s' cannot occupy in multiple small data regions");
                      break;
                    case V850_OTHER_SDA | V850_OTHER_ZDA | V850_OTHER_TDA:
-                     msg = _("Variable `%s' can only be in one of the small, zero, and tiny data regions");
+                     msg = _("variable `%s' can only be in one of the small, zero, and tiny data regions");
                      break;
                    case V850_OTHER_SDA | V850_OTHER_ZDA:
-                     msg = _("Variable `%s' cannot be in both small and zero data regions simultaneously");
+                     msg = _("variable `%s' cannot be in both small and zero data regions simultaneously");
                      break;
                    case V850_OTHER_SDA | V850_OTHER_TDA:
-                     msg = _("Variable `%s' cannot be in both small and tiny data regions simultaneously");
+                     msg = _("variable `%s' cannot be in both small and tiny data regions simultaneously");
                      break;
                    case V850_OTHER_ZDA | V850_OTHER_TDA:
-                     msg = _("Variable `%s' cannot be in both zero and tiny data regions simultaneously");
+                     msg = _("variable `%s' cannot be in both zero and tiny data regions simultaneously");
                      break;
                    }
 
@@ -460,7 +460,7 @@ v850_elf_perform_lo16_relocation (bfd *abfd, unsigned long *insn,
        }
       else
        {
-         _bfd_error_handler (_("FAILED to find previous HI16 reloc"));
+         _bfd_error_handler (_("failed to find previous HI16 reloc"));
          return FALSE;
        }
     }
@@ -1885,7 +1885,7 @@ v850_elf_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
 \f
 /* Set the howto pointer for an V850 ELF reloc.  */
 
-static void
+static bfd_boolean
 v850_elf_info_to_howto_rel (bfd *abfd,
                            arelent *cache_ptr,
                            Elf_Internal_Rela *dst)
@@ -1898,16 +1898,18 @@ v850_elf_info_to_howto_rel (bfd *abfd,
       /* xgettext:c-format */
       _bfd_error_handler (_("%pB: unsupported relocation type %#x"),
                          abfd, r_type);
-      r_type = 0;
+      bfd_set_error (bfd_error_bad_value);
+      return FALSE;
     }
   cache_ptr->howto = &v850_elf_howto_table[r_type];
+  return TRUE;
 }
 
 /* Set the howto pointer for a V850 ELF reloc (type RELA).  */
 
-static void
+static bfd_boolean
 v850_elf_info_to_howto_rela (bfd *abfd,
-                            arelent *cache_ptr,
+                            arelent * cache_ptr,
                             Elf_Internal_Rela *dst)
 {
   unsigned int r_type;
@@ -1918,9 +1920,11 @@ v850_elf_info_to_howto_rela (bfd *abfd,
       /* xgettext:c-format */
       _bfd_error_handler (_("%pB: unsupported relocation type %#x"),
                          abfd, r_type);
-      r_type = 0;
+      bfd_set_error (bfd_error_bad_value);
+      return FALSE;
     }
   cache_ptr->howto = &v850_elf_howto_table[r_type];
+  return TRUE;
 }
 \f
 static bfd_boolean
@@ -2813,7 +2817,7 @@ v850_elf_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info)
       if ((in_flags & EF_V800_850E3) != (out_flags & EF_V800_850E3))
        {
          _bfd_error_handler
-           (_("%pB: Architecture mismatch with previous modules"), ibfd);
+           (_("%pB: architecture mismatch with previous modules"), ibfd);
          elf_elfheader (obfd)->e_flags |= EF_V800_850E3;
        }
 
@@ -2869,7 +2873,7 @@ v850_elf_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info)
        }
 
       _bfd_error_handler
-       (_("%pB: Architecture mismatch with previous modules"), ibfd);
+       (_("%pB: architecture mismatch with previous modules"), ibfd);
     }
 
   return result;
@@ -3602,9 +3606,9 @@ v850_elf_relax_section (bfd *abfd,
                {
                  _bfd_error_handler
                    /* xgettext:c-format */
-                   (_("%pB: %#" PRIx64 ": warning: R_V850_LONGCALL points to "
+                   (_("%pB: %#" PRIx64 ": warning: %s points to "
                       "unrecognized insns"),
-                    abfd, (uint64_t) irel->r_offset);
+                    abfd, (uint64_t) irel->r_offset, "R_V850_LONGCALL");
                  continue;
                }
 
@@ -3612,10 +3616,11 @@ v850_elf_relax_section (bfd *abfd,
                {
                  _bfd_error_handler
                    /* xgettext:c-format */
-                   (_("%pB: %#" PRIx64 ": warning: R_V850_LONGCALL points to "
+                   (_("%pB: %#" PRIx64 ": warning: %s points to "
                       "unrecognized insn %#x"),
                     abfd,
                     (uint64_t) (irel->r_offset + no_match),
+                    "R_V850_LONGCALL",
                     insn[no_match]);
                  continue;
                }
@@ -3657,9 +3662,9 @@ v850_elf_relax_section (bfd *abfd,
                {
                  _bfd_error_handler
                    /* xgettext:c-format */
-                   (_("%pB: %#" PRIx64 ": warning: R_V850_LONGCALL points to "
+                   (_("%pB: %#" PRIx64 ": warning: %s points to "
                       "unrecognized reloc"),
-                    abfd, (uint64_t) irel->r_offset);
+                    abfd, (uint64_t) irel->r_offset, "R_V850_LONGCALL");
 
                  continue;
                }
@@ -3697,9 +3702,9 @@ v850_elf_relax_section (bfd *abfd,
                {
                  _bfd_error_handler
                    /* xgettext:c-format */
-                   (_("%pB: %#" PRIx64 ": warning: R_V850_LONGCALL points to "
+                   (_("%pB: %#" PRIx64 ": warning: %s points to "
                       "unrecognized reloc %#" PRIx64),
-                    abfd, (uint64_t) irel->r_offset,
+                    abfd, (uint64_t) irel->r_offset, "R_V850_LONGCALL",
                     (uint64_t) irelcall->r_offset);
                  continue;
                }
@@ -3840,9 +3845,9 @@ v850_elf_relax_section (bfd *abfd,
                {
                  _bfd_error_handler
                    /* xgettext:c-format */
-                   (_("%pB: %#" PRIx64 ": warning: R_V850_LONGJUMP points to "
+                   (_("%pB: %#" PRIx64 ": warning: %s points to "
                       "unrecognized insns"),
-                    abfd, (uint64_t) irel->r_offset);
+                    abfd, (uint64_t) irel->r_offset, "R_V850_LONGJUMP");
                  continue;
                }
 
@@ -3850,10 +3855,11 @@ v850_elf_relax_section (bfd *abfd,
                {
                  _bfd_error_handler
                    /* xgettext:c-format */
-                   (_("%pB: %#" PRIx64 ": warning: R_V850_LONGJUMP points to "
+                   (_("%pB: %#" PRIx64 ": warning: %s points to "
                       "unrecognized insn %#x"),
                     abfd,
                     (uint64_t) (irel->r_offset + no_match),
+                    "R_V850_LONGJUMP",
                     insn[no_match]);
                  continue;
                }
@@ -3884,9 +3890,9 @@ v850_elf_relax_section (bfd *abfd,
                {
                  _bfd_error_handler
                    /* xgettext:c-format */
-                   (_("%pB: %#" PRIx64 ": warning: R_V850_LONGJUMP points to "
+                   (_("%pB: %#" PRIx64 ": warning: %s points to "
                       "unrecognized reloc"),
-                    abfd, (uint64_t) irel->r_offset);
+                    abfd, (uint64_t) irel->r_offset, "R_V850_LONGJUMP");
                  continue;
                }
 
@@ -4245,25 +4251,30 @@ v800_elf_reloc_name_lookup (bfd * abfd, const char * r_name)
 
 /* Set the howto pointer in CACHE_PTR for a V800 ELF reloc.  */
 
-static void
+static bfd_boolean
 v800_elf_info_to_howto (bfd *              abfd,
                        arelent *           cache_ptr,
                        Elf_Internal_Rela * dst)
 {
   unsigned int r_type = ELF32_R_TYPE (dst->r_info);
 
-  BFD_ASSERT (bfd_get_arch (abfd) == bfd_arch_v850_rh850);
-
-  BFD_ASSERT (r_type < (unsigned int) R_V800_max);
-
   if (r_type == R_V800_NONE)
     r_type = R_V810_NONE;
 
-  BFD_ASSERT (r_type >= (unsigned int) R_V810_NONE);
-  r_type -= R_V810_NONE;
-  BFD_ASSERT (r_type < ARRAY_SIZE (v800_elf_howto_table));
+  if (bfd_get_arch (abfd) != bfd_arch_v850_rh850
+      || r_type >= (unsigned int) R_V800_max
+      || r_type < (unsigned int) R_V810_NONE
+      || (r_type - R_V810_NONE) >= ARRAY_SIZE (v800_elf_howto_table))
+    {
+      /* xgettext:c-format */
+      _bfd_error_handler (_("%pB: unsupported relocation type %#x"),
+                         abfd, r_type);
+      bfd_set_error (bfd_error_bad_value);
+      return FALSE;
+    }
 
-  cache_ptr->howto = v800_elf_howto_table + r_type;
+  cache_ptr->howto = v800_elf_howto_table + (r_type - R_V810_NONE);
+  return TRUE;
 }
 \f
 #undef  TARGET_LITTLE_SYM
This page took 0.039631 seconds and 4 git commands to generate.