aboutsummaryrefslogtreecommitdiff
path: root/bfd/elflink.h
diff options
context:
space:
mode:
authorJeff Law <law@redhat.com>2002-06-12 18:14:05 +0000
committerJeff Law <law@redhat.com>2002-06-12 18:14:05 +0000
commit2cb69dd3614423dfe81f0a1e52a70ba9c2dd4863 (patch)
tree9e3d43d7c824831af8cc535e7c4531087524f9be /bfd/elflink.h
parent3db4b612459073a0949b77472ff2eb7473d32ec2 (diff)
downloadgdb-2cb69dd3614423dfe81f0a1e52a70ba9c2dd4863.zip
gdb-2cb69dd3614423dfe81f0a1e52a70ba9c2dd4863.tar.gz
gdb-2cb69dd3614423dfe81f0a1e52a70ba9c2dd4863.tar.bz2
* elflink.h (elf_bfd_final_link): Improve error handling for missing
dynamic sections.
Diffstat (limited to 'bfd/elflink.h')
-rw-r--r--bfd/elflink.h16
1 files changed, 14 insertions, 2 deletions
diff --git a/bfd/elflink.h b/bfd/elflink.h
index 30ba4c1..9ba13fd 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;