Have info_to_howto functions return a success/fail status. Check this result. Stop...
[deliverable/binutils-gdb.git] / bfd / elfnn-ia64.c
index 84b1af1456edf7cd29bc7a33eddd4efad914358c..e6551df204627b4ac1fb8497148b3c1b8d912500 100644 (file)
@@ -197,13 +197,24 @@ static asection *get_pltoff
 
 /* Given a ELF reloc, return the matching HOWTO structure.  */
 
-static void
+static bfd_boolean
 elfNN_ia64_info_to_howto (bfd *abfd ATTRIBUTE_UNUSED,
                          arelent *bfd_reloc,
                          Elf_Internal_Rela *elf_reloc)
 {
-  bfd_reloc->howto
-    = ia64_elf_lookup_howto ((unsigned int) ELFNN_R_TYPE (elf_reloc->r_info));
+  unsigned int r_type = ELF32_R_TYPE (elf_reloc->r_info);
+
+  bfd_reloc->howto = ia64_elf_lookup_howto (r_type);
+  if (bfd_reloc->howto == NULL)
+    {
+      /* xgettext:c-format */
+      _bfd_error_handler (_("%pB: unsupported relocation type %#x"),
+                         abfd, r_type);
+      bfd_set_error (bfd_error_bad_value);
+      return FALSE;
+    }
+
+  return TRUE;
 }
 \f
 #define PLT_HEADER_SIZE                (3 * 16)
@@ -3857,6 +3868,12 @@ elfNN_ia64_relocate_section (bfd *output_bfd,
        }
 
       howto = ia64_elf_lookup_howto (r_type);
+      if (howto == NULL)
+       {
+         ret_val = FALSE;
+         continue;
+       }
+      
       r_symndx = ELFNN_R_SYM (rel->r_info);
       h = NULL;
       sym = NULL;
This page took 0.026464 seconds and 4 git commands to generate.