From: Jeff Law Date: Wed, 12 Jun 2002 18:14:05 +0000 (+0000) Subject: * elflink.h (elf_bfd_final_link): Improve error handling for missing X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=2cb69dd3614423dfe81f0a1e52a70ba9c2dd4863;p=binutils-gdb.git * elflink.h (elf_bfd_final_link): Improve error handling for missing dynamic sections. --- diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 907ba4995d8..7ba8476c65b 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,5 +1,8 @@ 2002-06-12 John David Anglin + * elflink.h (elf_bfd_final_link): Improve error handling for missing + dynamic sections. + * elf64-hppa.c (allocate_global_data_opd): We don't need an opd entry for a symbol that has no output section. (allocate_dynrel_entries): Correct comment. diff --git a/bfd/elflink.h b/bfd/elflink.h index 30ba4c146e8..9ba13fd0a28 100644 --- a/bfd/elflink.h +++ b/bfd/elflink.h @@ -5692,7 +5692,13 @@ elf_bfd_final_link (abfd, info) name = ".fini_array"; get_size: o = bfd_get_section_by_name (abfd, name); - BFD_ASSERT (o != NULL); + if (o == NULL) + { + (*_bfd_error_handler) + (_("%s: could not find output section %s"), + bfd_get_filename (abfd), name); + goto error_return; + } if (o->_raw_size == 0) (*_bfd_error_handler) (_("warning: %s section has zero size"), name); @@ -5729,7 +5735,13 @@ elf_bfd_final_link (abfd, info) name = ".gnu.version"; get_vma: o = bfd_get_section_by_name (abfd, name); - BFD_ASSERT (o != NULL); + if (o == NULL) + { + (*_bfd_error_handler) + (_("%s: could not find output section %s"), + bfd_get_filename (abfd), name); + goto error_return; + } dyn.d_un.d_ptr = o->vma; elf_swap_dyn_out (dynobj, &dyn, dyncon); break;