2002-06-12 John David Anglin <dave@hiauly1.hia.nrc.ca>
+ * 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.
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);
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;