869a11
--- binutils.orig/bfd/elf.c	2018-05-10 10:09:03.622147305 +0100
869a11
+++ binutils-2.30/bfd/elf.c	2018-05-10 10:29:09.895577234 +0100
869a11
@@ -4021,16 +4021,23 @@ ignore_section_sym (bfd *abfd, asymbol *
869a11
 {
869a11
   elf_symbol_type *type_ptr;
869a11
 
869a11
+  if (sym == NULL)
869a11
+    return FALSE;
869a11
+
869a11
   if ((sym->flags & BSF_SECTION_SYM) == 0)
869a11
     return FALSE;
869a11
 
869a11
+  if (sym->section == NULL)
869a11
+    return TRUE;
869a11
+
869a11
   type_ptr = elf_symbol_from (abfd, sym);
869a11
   return ((type_ptr != NULL
869a11
 	   && type_ptr->internal_elf_sym.st_shndx != 0
869a11
 	   && bfd_is_abs_section (sym->section))
869a11
 	  || !(sym->section->owner == abfd
869a11
-	       || (sym->section->output_section->owner == abfd
869a11
-		   && sym->section->output_offset == 0)
869a11
+              || (sym->section->output_section != NULL
869a11
+                  && sym->section->output_section->owner == abfd
869a11
+		  && sym->section->output_offset == 0)
869a11
 	       || bfd_is_abs_section (sym->section)));
869a11
 }
869a11