aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf32-i386.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2001-10-15 12:58:48 +0000
committerAlan Modra <amodra@gmail.com>2001-10-15 12:58:48 +0000
commitcf5c0c5bc6c2f7810ed42bb930a32ed703a473f6 (patch)
tree2e2c41954273e76d8a6a1b74bd6085b3ddc0c6f9 /bfd/elf32-i386.c
parent1e370bd243d55d65b5a6f5653ac932d0be6c9434 (diff)
downloadgdb-cf5c0c5bc6c2f7810ed42bb930a32ed703a473f6.zip
gdb-cf5c0c5bc6c2f7810ed42bb930a32ed703a473f6.tar.gz
gdb-cf5c0c5bc6c2f7810ed42bb930a32ed703a473f6.tar.bz2
* elf32-i386.c (elf_i386_relocate_section): Report some detail on
bfd_reloc_outofrange and similar errors.
Diffstat (limited to 'bfd/elf32-i386.c')
-rw-r--r--bfd/elf32-i386.c60
1 files changed, 31 insertions, 29 deletions
diff --git a/bfd/elf32-i386.c b/bfd/elf32-i386.c
index fe702b5..211a19c 100644
--- a/bfd/elf32-i386.c
+++ b/bfd/elf32-i386.c
@@ -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;
+ }
}
}