Blame SOURCES/binutils-2.27-s390x-check-for-NULL-pointers.patch

be6651
--- binutils.orig/bfd/elf64-s390.c	2017-09-06 09:03:23.142216202 +0100
be6651
+++ binutils-2.27/bfd/elf64-s390.c	2017-09-06 09:11:05.209080947 +0100
be6651
@@ -3895,8 +3895,13 @@ elf_s390_additional_program_headers (bfd
be6651
 {
be6651
   struct elf_s390_link_hash_table *htab;
be6651
 
be6651
-  htab = elf_s390_hash_table (info);
be6651
-  return htab->params->pgste;
be6651
+  if (info)
be6651
+    {
be6651
+      htab = elf_s390_hash_table (info);
be6651
+      if (htab)
be6651
+	return htab->params->pgste;
be6651
+    }
be6651
+  return 0;
be6651
 }
be6651
 
be6651
 
be6651
@@ -3909,6 +3914,9 @@ elf_s390_modify_segment_map (bfd *abfd A
be6651
   struct elf_s390_link_hash_table *htab;
be6651
   struct elf_segment_map *m, *pm = NULL;
be6651
 
be6651
+  if (!abfd || !info)
be6651
+    return TRUE;
be6651
+
be6651
   htab = elf_s390_hash_table (info);
be6651
   if (!htab->params->pgste)
be6651
     return TRUE;
be6651
@@ -3944,8 +3952,12 @@ bfd_elf_s390_set_options (struct bfd_lin
be6651
 {
be6651
   struct elf_s390_link_hash_table *htab;
be6651
 
be6651
-  htab = elf_s390_hash_table (info);
be6651
-  htab->params = params;
be6651
+  if (info)
be6651
+    {
be6651
+      htab = elf_s390_hash_table (info);
be6651
+      if (htab)
be6651
+	htab->params = params;
be6651
+    }
be6651
 
be6651
   return TRUE;
be6651
 }