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

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