]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
* elf32-i386.c (elf_i386_relocate_section): Report some detail on
authorAlan Modra <amodra@gmail.com>
Mon, 15 Oct 2001 12:58:48 +0000 (12:58 +0000)
committerAlan Modra <amodra@gmail.com>
Mon, 15 Oct 2001 12:58:48 +0000 (12:58 +0000)
bfd_reloc_outofrange and similar errors.

bfd/ChangeLog
bfd/elf32-i386.c

index 8abfc90d90d36aff80de9eb253225900726fbfa9..634843dc1523875ddc8e9028570107fae1923e37 100644 (file)
@@ -1,5 +1,8 @@
 2001-10-15  Alan Modra  <amodra@bigpond.net.au>
 
+       * elf32-i386.c (elf_i386_relocate_section): Report some detail on
+       bfd_reloc_outofrange and similar errors.
+
        * elf.c (_bfd_elf_link_hash_copy_indirect): Test ind->root.type
        rather than ind->weakdef.
        * elf32-hppa.c (elf32_hppa_copy_indirect_symbol): Likewise.
index fe702b54872d50202fdd003f8a36182e81c00f1e..211a19cb081ac283b2c2c9365b185cdad11341d7 100644 (file)
@@ -2037,38 +2037,40 @@ elf_i386_relocate_section (output_bfd, info, input_bfd, input_section,
                                    contents, rel->r_offset,
                                    relocation, (bfd_vma) 0);
 
-      switch (r)
+      if (r != bfd_reloc_ok)
        {
-       case bfd_reloc_ok:
-         break;
+         const char *name;
 
-       case bfd_reloc_overflow:
-         {
-           const char *name;
-
-           if (h != NULL)
-             name = h->root.root.string;
-           else
-             {
-               name = bfd_elf_string_from_elf_section (input_bfd,
-                                                       symtab_hdr->sh_link,
-                                                       sym->st_name);
-               if (name == NULL)
-                 return false;
-               if (*name == '\0')
-                 name = bfd_section_name (input_bfd, sec);
-             }
-           if (! ((*info->callbacks->reloc_overflow)
-                  (info, name, howto->name, (bfd_vma) 0,
-                   input_bfd, input_section, rel->r_offset)))
-             return false;
-         }
-         break;
+         if (h != NULL)
+           name = h->root.root.string;
+         else
+           {
+             name = bfd_elf_string_from_elf_section (input_bfd,
+                                                     symtab_hdr->sh_link,
+                                                     sym->st_name);
+             if (name == NULL)
+               return false;
+             if (*name == '\0')
+               name = bfd_section_name (input_bfd, sec);
+           }
 
-       default:
-       case bfd_reloc_outofrange:
-         abort ();
-         break;
+         if (r == bfd_reloc_overflow)
+           {
+
+             if (! ((*info->callbacks->reloc_overflow)
+                    (info, name, howto->name, (bfd_vma) 0,
+                     input_bfd, input_section, rel->r_offset)))
+               return false;
+           }
+         else
+           {
+             (*_bfd_error_handler)
+               (_("%s(%s+0x%lx): reloc against `%s': error %d"),
+                bfd_archive_filename (input_bfd),
+                bfd_get_section_name (input_bfd, input_section),
+                (long) rel->r_offset, name, (int) r);
+             return false;
+           }
        }
     }