* elflink.h (elf_bfd_discard_info): Fix segfault when dynobj NULL.
authorAlan Modra <amodra@gmail.com>
Fri, 14 Dec 2001 01:52:27 +0000 (01:52 +0000)
committerAlan Modra <amodra@gmail.com>
Fri, 14 Dec 2001 01:52:27 +0000 (01:52 +0000)
bfd/ChangeLog
bfd/elflink.h

index 36539921d4457add4a5ec82d5723438522916a3f..81e491306e545fe2f6df99ce3984f6031cc8a364 100644 (file)
@@ -1,3 +1,7 @@
+2001-12-14  Alan Modra  <amodra@bigpond.net.au>
+
+       * elflink.h (elf_bfd_discard_info): Fix segfault when dynobj NULL.
+
 2001-12-13  Jakub Jelinek  <jakub@redhat.com>
 
        * elf-bfd.h (enum elf_link_info_type): New.
index 37ea63d4ecee797698e0941644db4e7ceebd759c..a5e348d15be596cfd30c00cc5173f8a1badb437b 100644 (file)
@@ -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)
     {