From: Alan Modra Date: Fri, 14 Dec 2001 01:52:27 +0000 (+0000) Subject: * elflink.h (elf_bfd_discard_info): Fix segfault when dynobj NULL. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=72dd63313e8cb74677909607af86966d7f6a9f8e;p=binutils-gdb.git * elflink.h (elf_bfd_discard_info): Fix segfault when dynobj NULL. --- diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 36539921d44..81e491306e5 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,7 @@ +2001-12-14 Alan Modra + + * elflink.h (elf_bfd_discard_info): Fix segfault when dynobj NULL. + 2001-12-13 Jakub Jelinek * elf-bfd.h (enum elf_link_info_type): New. diff --git a/bfd/elflink.h b/bfd/elflink.h index 37ea63d4ece..a5e348d15be 100644 --- a/bfd/elflink.h +++ b/bfd/elflink.h @@ -7950,8 +7950,10 @@ elf_bfd_discard_info (output_bfd, info) || ! is_elf_hash_table (info)) return false; - ehdr = bfd_get_section_by_name (elf_hash_table (info)->dynobj, - ".eh_frame_hdr"); + ehdr = NULL; + if (elf_hash_table (info)->dynobj != NULL) + ehdr = bfd_get_section_by_name (elf_hash_table (info)->dynobj, + ".eh_frame_hdr"); for (abfd = info->input_bfds; abfd != NULL; abfd = abfd->link_next) {