+2005-04-27 Nick Clifton <nickc@redhat.com>
+
+ * elflink.c (elf_link_input_bfd): Handle the case where a badly
+ formatted input file results in a reloc which has no associated
+ global symbol.
+
2005-04-26 Jerome Guitton <guitton@gnat.com>
* bfd.m4 (BFD_NEED_DECLARATION): Restore.
&& finfo->sections[r_symndx] == NULL))
{
h = sym_hashes[r_symndx - extsymoff];
+
+ /* Badly formatted input files can contain relocs that
+ reference non-existant symbols. Check here so that
+ we do not seg fault. */
+ if (h == NULL)
+ {
+ char buffer [32];
+
+ sprintf_vma (buffer, rel->r_info);
+ (*_bfd_error_handler)
+ (_("error: %B contains a reloc (0x%s) for section %A "
+ "that references a non-existent global symbol"),
+ input_bfd, o, buffer);
+ bfd_set_error (bfd_error_bad_value);
+ return FALSE;
+ }
+
while (h->root.type == bfd_link_hash_indirect
|| h->root.type == bfd_link_hash_warning)
h = (struct elf_link_hash_entry *) h->root.u.i.link;