x86: drop NoRex64 from {,v}pmov{s,z}x*
[deliverable/binutils-gdb.git] / bfd / elf-hppa.h
index b87ee836ea19336d6687b92bc5ddf739b4f6e0a3..5eac12996d1b8b9049db3f0fe5a5800b475247c5 100644 (file)
@@ -1020,26 +1020,58 @@ _bfd_elf_hppa_gen_reloc_type (bfd *abfd,
 
 /* Translate from an elf into field into a howto relocation pointer.  */
 
-static void
-elf_hppa_info_to_howto (bfd *abfd ATTRIBUTE_UNUSED,
+static bfd_boolean
+elf_hppa_info_to_howto (bfd *abfd,
                        arelent *bfd_reloc,
                        Elf_Internal_Rela *elf_reloc)
 {
-  BFD_ASSERT (ELF_R_TYPE (elf_reloc->r_info)
-             < (unsigned int) R_PARISC_UNIMPLEMENTED);
-  bfd_reloc->howto = &elf_hppa_howto_table[ELF_R_TYPE (elf_reloc->r_info)];
+  unsigned int r_type = ELF32_R_TYPE (elf_reloc->r_info);
+  unsigned int type = r_type;
+  reloc_howto_type *howto = NULL;
+
+  if (r_type < (unsigned int) R_PARISC_UNIMPLEMENTED)
+    {
+      howto = &elf_hppa_howto_table[r_type];
+      type = howto->type;
+    }
+  if (type >= (unsigned int) R_PARISC_UNIMPLEMENTED)
+    {
+      /* xgettext:c-format */
+      _bfd_error_handler (_("%pB: unsupported relocation type %#x"),
+                         abfd, r_type);
+      bfd_set_error (bfd_error_bad_value);
+      return FALSE;
+    }
+  bfd_reloc->howto = howto;
+  return TRUE;
 }
 
 /* Translate from an elf into field into a howto relocation pointer.  */
 
-static void
-elf_hppa_info_to_howto_rel (bfd *abfd ATTRIBUTE_UNUSED,
+static bfd_boolean
+elf_hppa_info_to_howto_rel (bfd *abfd,
                            arelent *bfd_reloc,
                            Elf_Internal_Rela *elf_reloc)
 {
-  BFD_ASSERT (ELF_R_TYPE (elf_reloc->r_info)
-             < (unsigned int) R_PARISC_UNIMPLEMENTED);
-  bfd_reloc->howto = &elf_hppa_howto_table[ELF_R_TYPE (elf_reloc->r_info)];
+  unsigned int r_type = ELF_R_TYPE (elf_reloc->r_info);
+  unsigned int type = r_type;
+  reloc_howto_type *howto = NULL;
+
+  if (r_type < (unsigned int) R_PARISC_UNIMPLEMENTED)
+    {
+      howto = &elf_hppa_howto_table[r_type];
+      type = howto->type;
+    }
+  if (type >= (unsigned int) R_PARISC_UNIMPLEMENTED)
+    {
+      /* xgettext:c-format */
+      _bfd_error_handler (_("%pB: unsupported relocation type %#x"),
+                         abfd, r_type);
+      bfd_set_error (bfd_error_bad_value);
+      return FALSE;
+    }
+  bfd_reloc->howto = howto;
+  return TRUE;
 }
 
 /* Return the address of the howto table entry to perform the CODE
This page took 0.025151 seconds and 4 git commands to generate.