This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] S/390: Add pgste marker


On 06/25/2017 06:49 AM, Alan Modra wrote:
> On Tue, Jun 20, 2017 at 05:02:31PM +0200, Andreas Krebbel wrote:
>> This patch adds a new S/390 specific segment type: PT_S390_PGSTE.  For
>> binaries marked with that segment the kernel will allocate 4k page
>> tables.  The only user so far will be qemu.
>>
>> I'll commit the patch after waiting a few days for feedback.
> 
> Lots of testsuite regressions on s390x-linux, and no Changelog
> committed.

I've committed the missing changelog entries and the following fix.  Not sure how I messed up my
regression test this badly. Thanks for making me aware of this!

diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index c5f1f23..f9d1a70 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,10 @@
+2017-06-26  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>
+
+	* elf64-s390.c (elf_s390_additional_program_headers): Add NULL
+	pointer checks.
+	(elf_s390_modify_segment_map): Likewise.
+	(bfd_elf_s390_set_options): Lisewise.
+
 2017-06-26  Alan Modra  <amodra@gmail.com>

 	* elflink.c (_bfd_elf_link_create_dynstrtab): Don't make dynobj
diff --git a/bfd/elf64-s390.c b/bfd/elf64-s390.c
index 1af1200..f85f8cd 100644
--- a/bfd/elf64-s390.c
+++ b/bfd/elf64-s390.c
@@ -3978,22 +3978,29 @@ elf_s390_additional_program_headers (bfd *abfd ATTRIBUTE_UNUSED,
 {
   struct elf_s390_link_hash_table *htab;

-  htab = elf_s390_hash_table (info);
-  return htab->params->pgste;
+  if (info)
+    {
+      htab = elf_s390_hash_table (info);
+      if (htab)
+	return htab->params->pgste;
+    }
+  return 0;
 }


 /* Add the PT_S390_PGSTE program header.  */

 static bfd_boolean
-elf_s390_modify_segment_map (bfd *abfd ATTRIBUTE_UNUSED,
-			     struct bfd_link_info *info)
+elf_s390_modify_segment_map (bfd *abfd, struct bfd_link_info *info)
 {
   struct elf_s390_link_hash_table *htab;
   struct elf_segment_map *m, *pm = NULL;

+  if (!abfd || !info)
+    return TRUE;
+
   htab = elf_s390_hash_table (info);
-  if (!htab->params->pgste)
+  if (!htab || !htab->params->pgste)
     return TRUE;

   /* If there is already a PT_S390_PGSTE header, avoid adding
@@ -4027,8 +4034,12 @@ bfd_elf_s390_set_options (struct bfd_link_info *info,
 {
   struct elf_s390_link_hash_table *htab;

-  htab = elf_s390_hash_table (info);
-  htab->params = params;
+  if (info)
+    {
+      htab = elf_s390_hash_table (info);
+      if (htab)
+	htab->params = params;
+    }

   return TRUE;
 }
-- 
2.9.1


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]