From 44b5ac092b2b5ae8842117f24fb565a885238941 Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Fri, 14 Dec 2001 01:52:27 +0000 Subject: [PATCH] * elflink.h (elf_bfd_discard_info): Fix segfault when dynobj NULL. --- bfd/ChangeLog | 4 ++++ bfd/elflink.h | 6 ++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 36539921d4..81e491306e 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 37ea63d4ec..a5e348d15b 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) { -- 2.11.0