From 263d4a626b6f359bd3182370e744683c2d8a9e30 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Wed, 2 Oct 1996 16:02:56 +0000 Subject: [PATCH] * cofflink.c (_bfd_coff_link_input_bfd): Don't crash if there is no hash table entry for a global symbol. --- bfd/ChangeLog | 5 +++++ bfd/cofflink.c | 8 +++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 430501521cd..45761e5717a 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,8 @@ +Wed Oct 2 12:02:02 1996 Ian Lance Taylor + + * cofflink.c (_bfd_coff_link_input_bfd): Don't crash if there is + no hash table entry for a global symbol. + Tue Oct 1 16:14:22 1996 Joel Sherrill * config.bfd (mips*-*-rtems*): New target, like mips*-*-elf*. diff --git a/bfd/cofflink.c b/bfd/cofflink.c index 9d6201340f2..ea378653892 100644 --- a/bfd/cofflink.c +++ b/bfd/cofflink.c @@ -1514,7 +1514,13 @@ _bfd_coff_link_input_bfd (finfo, input_bfd) indx = ((esym - (bfd_byte *) obj_coff_external_syms (input_bfd)) / isymesz); h = obj_coff_sym_hashes (input_bfd)[indx]; - BFD_ASSERT (h != NULL); + if (h == NULL) + { + /* This can happen if there were errors earlier in + the link. */ + bfd_set_error (bfd_error_bad_value); + return false; + } h->indx = output_index; } -- 2.30.2