Blame SOURCES/binutils-PT_GNU_PROPERTY-segment.patch

0519c2
diff -rup binutils.orig/bfd/elf-bfd.h binutils-2.30/bfd/elf-bfd.h
0519c2
--- binutils.orig/bfd/elf-bfd.h	2020-04-07 11:32:17.269776457 +0100
0519c2
+++ binutils-2.30/bfd/elf-bfd.h	2020-04-07 13:34:03.897784103 +0100
0519c2
@@ -1467,12 +1467,16 @@ struct elf_backend_data
0519c2
 						  unsigned int);
0519c2
 
0519c2
   /* Merge GNU properties.  Return TRUE if property is updated.  */
0519c2
-  bfd_boolean (*merge_gnu_properties) (struct bfd_link_info *, bfd *,
0519c2
+  bfd_boolean (*merge_gnu_properties) (struct bfd_link_info *, bfd *, bfd *,
0519c2
 				       elf_property *, elf_property *);
0519c2
 
0519c2
   /* Set up GNU properties.  */
0519c2
   bfd *(*setup_gnu_properties) (struct bfd_link_info *);
0519c2
 
0519c2
+  /* Fix up GNU properties.  */
0519c2
+  void (*fixup_gnu_properties) (struct bfd_link_info *,
0519c2
+				elf_property_list **);
0519c2
+
0519c2
   /* Encoding used for compact EH tables.  */
0519c2
   int (*compact_eh_encoding) (struct bfd_link_info *);
0519c2
 
0519c2
@@ -2673,6 +2677,10 @@ extern elf_property * _bfd_elf_get_prope
0519c2
   (bfd *, unsigned int, unsigned int);
0519c2
 extern bfd *_bfd_elf_link_setup_gnu_properties
0519c2
   (struct bfd_link_info *);
0519c2
+extern bfd_size_type _bfd_elf_convert_gnu_property_size
0519c2
+  (bfd *, bfd *);
0519c2
+extern bfd_boolean _bfd_elf_convert_gnu_properties
0519c2
+  (bfd *, asection *, bfd *, bfd_byte **, bfd_size_type *);
0519c2
 
0519c2
 /* The linker may need to keep track of the number of relocs that it
0519c2
    decides to copy as dynamic relocs in check_relocs for each symbol.
0519c2
diff -rup binutils.orig/bfd/elf-properties.c binutils-2.30/bfd/elf-properties.c
0519c2
--- binutils.orig/bfd/elf-properties.c	2020-04-07 11:32:17.280776377 +0100
0519c2
+++ binutils-2.30/bfd/elf-properties.c	2020-04-07 13:34:03.899784089 +0100
0519c2
@@ -198,7 +198,7 @@ next:
0519c2
    with ABFD.  */
0519c2
 
0519c2
 static bfd_boolean
0519c2
-elf_merge_gnu_properties (struct bfd_link_info *info, bfd *abfd,
0519c2
+elf_merge_gnu_properties (struct bfd_link_info *info, bfd *abfd, bfd *bbfd,
0519c2
 			  elf_property *aprop, elf_property *bprop)
0519c2
 {
0519c2
   const struct elf_backend_data *bed = get_elf_backend_data (abfd);
0519c2
@@ -207,7 +207,7 @@ elf_merge_gnu_properties (struct bfd_lin
0519c2
   if (bed->merge_gnu_properties != NULL
0519c2
       && pr_type >= GNU_PROPERTY_LOPROC
0519c2
       && pr_type < GNU_PROPERTY_LOUSER)
0519c2
-    return bed->merge_gnu_properties (info, abfd, aprop, bprop);
0519c2
+    return bed->merge_gnu_properties (info, abfd, bbfd, aprop, bprop);
0519c2
 
0519c2
   switch (pr_type)
0519c2
     {
0519c2
@@ -241,7 +241,7 @@ elf_merge_gnu_properties (struct bfd_lin
0519c2
 
0519c2
 static elf_property *
0519c2
 elf_find_and_remove_property (elf_property_list **listp,
0519c2
-			      unsigned int type)
0519c2
+			      unsigned int type, bfd_boolean remove)
0519c2
 {
0519c2
   elf_property_list *list;
0519c2
 
0519c2
@@ -250,7 +250,8 @@ elf_find_and_remove_property (elf_proper
0519c2
       if (type == list->property.pr_type)
0519c2
 	{
0519c2
 	  /* Remove this property.  */
0519c2
-	  *listp = list->next;
0519c2
+	  if (remove)
0519c2
+	    *listp = list->next;
0519c2
 	  return &list->property;
0519c2
 	}
0519c2
       else if (type < list->property.pr_type)
0519c2
@@ -261,47 +262,241 @@ elf_find_and_remove_property (elf_proper
0519c2
   return NULL;
0519c2
 }
0519c2
 
0519c2
-/* Merge GNU property list *LISTP with ABFD.  */
0519c2
+/* Merge GNU property list *LISTP in ABFD with FIRST_PBFD.  */
0519c2
 
0519c2
 static void
0519c2
-elf_merge_gnu_property_list (struct bfd_link_info *info, bfd *abfd,
0519c2
-			     elf_property_list **listp)
0519c2
+elf_merge_gnu_property_list (struct bfd_link_info *info, bfd *first_pbfd,
0519c2
+			     bfd *abfd, elf_property_list **listp)
0519c2
 {
0519c2
   elf_property_list *p, **lastp;
0519c2
   elf_property *pr;
0519c2
+  bfd_boolean number_p;
0519c2
+  bfd_vma number = 0;
0519c2
 
0519c2
-  /* Merge each GNU property in ABFD with the one on *LISTP.  */
0519c2
-  lastp = &elf_properties (abfd);
0519c2
+  /* Merge each GNU property in FIRST_PBFD with the one on *LISTP.  */
0519c2
+  lastp = &elf_properties (first_pbfd);
0519c2
   for (p = *lastp; p; p = p->next)
0519c2
+    if (p->property.pr_kind != property_remove)
0519c2
+      {
0519c2
+	if (p->property.pr_kind == property_number)
0519c2
+	  {
0519c2
+	    number_p = TRUE;
0519c2
+	    number = p->property.u.number;
0519c2
+	  }
0519c2
+	else
0519c2
+	  number_p = FALSE;
0519c2
+	pr = elf_find_and_remove_property (listp, p->property.pr_type,
0519c2
+					   TRUE);
0519c2
+	/* Pass NULL to elf_merge_gnu_properties for the property which
0519c2
+	   isn't on *LISTP.  */
0519c2
+	elf_merge_gnu_properties (info, first_pbfd, abfd, &p->property, pr);
0519c2
+	if (p->property.pr_kind == property_remove)
0519c2
+	  {
0519c2
+	    if (number_p)
0519c2
+	      {
0519c2
+		if (pr != NULL)
0519c2
+		  info->callbacks->minfo
0519c2
+		    (_("Removed property %W to merge %pB (0x%v) "
0519c2
+		       "and %pB (0x%v)\n"),
0519c2
+		     (bfd_vma) p->property.pr_type, first_pbfd,
0519c2
+		     number, abfd, pr->u.number);
0519c2
+		else
0519c2
+		  info->callbacks->minfo
0519c2
+		    (_("Removed property %W to merge %pB (0x%v) "
0519c2
+		       "and %pB (not found)\n"),
0519c2
+		     (bfd_vma) p->property.pr_type, first_pbfd,
0519c2
+		     number, abfd);
0519c2
+	      }
0519c2
+	    else
0519c2
+	      {
0519c2
+		if (pr != NULL)
0519c2
+		  info->callbacks->minfo
0519c2
+		    (_("Removed property %W to merge %pB and %pB\n"),
0519c2
+		     (bfd_vma) p->property.pr_type, first_pbfd, abfd);
0519c2
+		else
0519c2
+		  info->callbacks->minfo
0519c2
+		    (_("Removed property %W to merge %pB and %pB "
0519c2
+		       "(not found)\n"),
0519c2
+		     (bfd_vma) p->property.pr_type, first_pbfd, abfd);
0519c2
+	      }
0519c2
+
0519c2
+	    /* Remove this property.  */
0519c2
+	    *lastp = p->next;
0519c2
+	    continue;
0519c2
+	  }
0519c2
+	else if (number_p)
0519c2
+	  {
0519c2
+	    if (pr != NULL)
0519c2
+	      {
0519c2
+		if (p->property.u.number != number
0519c2
+		    || p->property.u.number != pr->u.number)
0519c2
+		  info->callbacks->minfo
0519c2
+		    (_("Updated property %W (0x%v) to merge %pB (0x%v) "
0519c2
+		       "and %pB (0x%v)\n"),
0519c2
+		     (bfd_vma) p->property.pr_type, p->property.u.number,
0519c2
+		     first_pbfd, number, abfd, pr->u.number);
0519c2
+	      }
0519c2
+	    else
0519c2
+	      {
0519c2
+		if (p->property.u.number != number)
0519c2
+		  info->callbacks->minfo
0519c2
+		    (_("Updated property %W (%v) to merge %pB (0x%v) "
0519c2
+		       "and %pB (not found)\n"),
0519c2
+		     (bfd_vma) p->property.pr_type, p->property.u.number,
0519c2
+		     first_pbfd, number, abfd);
0519c2
+	      }
0519c2
+	  }
0519c2
+	lastp = &p->next;
0519c2
+      }
0519c2
+
0519c2
+  /* Merge the remaining properties on *LISTP with FIRST_PBFD.  */
0519c2
+  for (p = *listp; p != NULL; p = p->next)
0519c2
     {
0519c2
-      pr = elf_find_and_remove_property (listp, p->property.pr_type);
0519c2
-      /* Pass NULL to elf_merge_gnu_properties for the property which
0519c2
-	 isn't on *LISTP.  */
0519c2
-      elf_merge_gnu_properties (info, abfd, &p->property, pr);
0519c2
-      if (p->property.pr_kind == property_remove)
0519c2
+      if (p->property.pr_kind == property_number)
0519c2
 	{
0519c2
-	  /* Remove this property.  */
0519c2
-	  *lastp = p->next;
0519c2
-	  continue;
0519c2
+	  number_p = TRUE;
0519c2
+	  number = p->property.u.number;
0519c2
+	}
0519c2
+      else
0519c2
+	number_p = FALSE;
0519c2
+
0519c2
+      if (elf_merge_gnu_properties (info, first_pbfd, abfd, NULL, &p->property))
0519c2
+	{
0519c2
+	  if (p->property.pr_type == GNU_PROPERTY_NO_COPY_ON_PROTECTED)
0519c2
+	    elf_has_no_copy_on_protected (first_pbfd) = TRUE;
0519c2
+
0519c2
+	  pr = _bfd_elf_get_property (first_pbfd, p->property.pr_type,
0519c2
+				      p->property.pr_datasz);
0519c2
+	  /* It must be a new property.  */
0519c2
+	  if (pr->pr_kind != property_unknown)
0519c2
+	    abort ();
0519c2
+	  /* Add a new property.  */
0519c2
+	  *pr = p->property;
0519c2
+	}
0519c2
+      else
0519c2
+	{
0519c2
+	  pr = elf_find_and_remove_property (&elf_properties (first_pbfd),
0519c2
+					     p->property.pr_type,
0519c2
+					     FALSE);
0519c2
+	  if (pr == NULL)
0519c2
+	    {
0519c2
+	      if (number_p)
0519c2
+		info->callbacks->minfo
0519c2
+		  (_("Removed property %W to merge %pB (not found) and "
0519c2
+		     "%pB (0x%v)\n"),
0519c2
+		   (bfd_vma) p->property.pr_type, first_pbfd, abfd,
0519c2
+		   number);
0519c2
+	      else
0519c2
+		info->callbacks->minfo
0519c2
+		  (_("Removed property %W to merge %pB and %pB\n"),
0519c2
+		   (bfd_vma) p->property.pr_type, first_pbfd, abfd);
0519c2
+	    }
0519c2
+	  else if (pr->pr_kind != property_remove)
0519c2
+	    abort ();
0519c2
 	}
0519c2
-      lastp = &p->next;
0519c2
     }
0519c2
+}
0519c2
 
0519c2
-  /* Merge the remaining properties on *LISTP with ABFD.  */
0519c2
-  for (p = *listp; p != NULL; p = p->next)
0519c2
-    if (elf_merge_gnu_properties (info, abfd, NULL, &p->property))
0519c2
-      {
0519c2
-	if (p->property.pr_type == GNU_PROPERTY_NO_COPY_ON_PROTECTED)
0519c2
-	  elf_has_no_copy_on_protected (abfd) = TRUE;
0519c2
+/* Get GNU property section size.  */
0519c2
+
0519c2
+static bfd_size_type
0519c2
+elf_get_gnu_property_section_size (elf_property_list *list,
0519c2
+				   unsigned int align_size)
0519c2
+{
0519c2
+  bfd_size_type size;
0519c2
+  unsigned int descsz;
0519c2
+
0519c2
+  /* Compute the output section size.  */
0519c2
+  descsz = offsetof (Elf_External_Note, name[sizeof "GNU"]);
0519c2
+  descsz = (descsz + 3) & -(unsigned int) 4;
0519c2
+  size = descsz;
0519c2
+  for (; list != NULL; list = list->next)
0519c2
+    {
0519c2
+      unsigned int datasz;
0519c2
+      /* Check if this property should be skipped.  */
0519c2
+      if (list->property.pr_kind == property_remove)
0519c2
+	continue;
0519c2
+      /* There are 4 byte type + 4 byte datasz for each property.  */
0519c2
+      if (list->property.pr_type == GNU_PROPERTY_STACK_SIZE)
0519c2
+	datasz = align_size;
0519c2
+      else
0519c2
+	datasz = list->property.pr_datasz;
0519c2
+      size += 4 + 4 + datasz;
0519c2
+      /* Align each property.  */
0519c2
+      size = (size + (align_size - 1)) & ~(align_size - 1);
0519c2
+    }
0519c2
+
0519c2
+  return size;
0519c2
+}
0519c2
+
0519c2
+/* Write GNU properties.  */
0519c2
+
0519c2
+static void
0519c2
+elf_write_gnu_properties (bfd *abfd, bfd_byte *contents,
0519c2
+			  elf_property_list *list, unsigned int size,
0519c2
+			  unsigned int align_size)
0519c2
+{
0519c2
+  unsigned int descsz;
0519c2
+  unsigned int datasz;
0519c2
+  Elf_External_Note *e_note;
0519c2
+
0519c2
+  e_note = (Elf_External_Note *) contents;
0519c2
+  descsz = offsetof (Elf_External_Note, name[sizeof "GNU"]);
0519c2
+  descsz = (descsz + 3) & -(unsigned int) 4;
0519c2
+  bfd_h_put_32 (abfd, sizeof "GNU", &e_note->namesz);
0519c2
+  bfd_h_put_32 (abfd, size - descsz, &e_note->descsz);
0519c2
+  bfd_h_put_32 (abfd, NT_GNU_PROPERTY_TYPE_0, &e_note->type);
0519c2
+  memcpy (e_note->name, "GNU", sizeof "GNU");
0519c2
+
0519c2
+  size = descsz;
0519c2
+  for (; list != NULL; list = list->next)
0519c2
+    {
0519c2
+      /* Check if this property should be skipped.  */
0519c2
+      if (list->property.pr_kind == property_remove)
0519c2
+	continue;
0519c2
+      /* There are 4 byte type + 4 byte datasz for each property.  */
0519c2
+      if (list->property.pr_type == GNU_PROPERTY_STACK_SIZE)
0519c2
+	datasz = align_size;
0519c2
+      else
0519c2
+	datasz = list->property.pr_datasz;
0519c2
+      bfd_h_put_32 (abfd, list->property.pr_type, contents + size);
0519c2
+      bfd_h_put_32 (abfd, datasz, contents + size + 4);
0519c2
+      size += 4 + 4;
0519c2
+
0519c2
+      /* Write out property value.  */
0519c2
+      switch (list->property.pr_kind)
0519c2
+	{
0519c2
+	case property_number:
0519c2
+	  switch (datasz)
0519c2
+	    {
0519c2
+	    default:
0519c2
+	      /* Never should happen.  */
0519c2
+	      abort ();
0519c2
+
0519c2
+	    case 0:
0519c2
+	      break;
0519c2
+
0519c2
+	    case 4:
0519c2
+	      bfd_h_put_32 (abfd, list->property.u.number,
0519c2
+			    contents + size);
0519c2
+	      break;
0519c2
 
0519c2
-	pr = _bfd_elf_get_property (abfd, p->property.pr_type,
0519c2
-				    p->property.pr_datasz);
0519c2
-	/* It must be a new property.  */
0519c2
-	if (pr->pr_kind != property_unknown)
0519c2
+	    case 8:
0519c2
+	      bfd_h_put_64 (abfd, list->property.u.number,
0519c2
+			    contents + size);
0519c2
+	      break;
0519c2
+	    }
0519c2
+	  break;
0519c2
+
0519c2
+	default:
0519c2
+	  /* Never should happen.  */
0519c2
 	  abort ();
0519c2
-	/* Add a new property.  */
0519c2
-	*pr = p->property;
0519c2
-      }
0519c2
+	}
0519c2
+      size += datasz;
0519c2
+
0519c2
+      /* Align each property.  */
0519c2
+      size = (size + (align_size - 1)) & ~ (align_size - 1);
0519c2
+    }
0519c2
 }
0519c2
 
0519c2
 /* Set up GNU properties.  Return the first relocatable ELF input with
0519c2
@@ -349,8 +544,13 @@ _bfd_elf_link_setup_gnu_properties (stru
0519c2
     return NULL;
0519c2
 
0519c2
   /* Merge .note.gnu.property sections.  */
0519c2
+  info->callbacks->minfo (_("\n"));
0519c2
+  info->callbacks->minfo (_("Merging program properties\n"));
0519c2
+  info->callbacks->minfo (_("\n"));
0519c2
+
0519c2
   for (abfd = info->input_bfds; abfd != NULL; abfd = abfd->link.next)
0519c2
-    if (abfd != first_pbfd && (abfd->flags & DYNAMIC) == 0)
0519c2
+    if (abfd != first_pbfd
0519c2
+	&& (abfd->flags & (DYNAMIC | BFD_PLUGIN | BFD_LINKER_CREATED)) == 0)
0519c2
       {
0519c2
 	elf_property_list *null_ptr = NULL;
0519c2
 	elf_property_list **listp = &null_ptr;
0519c2
@@ -374,7 +574,7 @@ _bfd_elf_link_setup_gnu_properties (stru
0519c2
 	   when all properties are from ELF objects with different
0519c2
 	   machine code or class.  */
0519c2
 	if (first_pbfd != NULL)
0519c2
-	  elf_merge_gnu_property_list (info, first_pbfd, listp);
0519c2
+	  elf_merge_gnu_property_list (info, first_pbfd, abfd, listp);
0519c2
 
0519c2
 	if (list != NULL)
0519c2
 	  {
0519c2
@@ -390,11 +590,9 @@ _bfd_elf_link_setup_gnu_properties (stru
0519c2
      always sorted by type even if input GNU properties aren't sorted.  */
0519c2
   if (first_pbfd != NULL)
0519c2
     {
0519c2
-      unsigned int size;
0519c2
-      unsigned int descsz;
0519c2
+      bfd_size_type size;
0519c2
       bfd_byte *contents;
0519c2
-      Elf_External_Note *e_note;
0519c2
-      unsigned int align_size = bed->s->elfclass == ELFCLASS64 ? 8 : 4;
0519c2
+      unsigned int align_size = elfclass == ELFCLASS64 ? 8 : 4;
0519c2
 
0519c2
       sec = bfd_get_section_by_name (first_pbfd,
0519c2
 				     NOTE_GNU_PROPERTY_SECTION_NAME);
0519c2
@@ -426,76 +624,28 @@ _bfd_elf_link_setup_gnu_properties (stru
0519c2
 	  return NULL;
0519c2
 	}
0519c2
 
0519c2
-      /* Compute the section size.  */
0519c2
-      descsz = offsetof (Elf_External_Note, name[sizeof "GNU"]);
0519c2
-      descsz = (descsz + 3) & -(unsigned int) 4;
0519c2
-      size = descsz;
0519c2
-      for (list = elf_properties (first_pbfd);
0519c2
-	   list != NULL;
0519c2
-	   list = list->next)
0519c2
+      /* Fix up GNU properties.  */
0519c2
+      if (bed->fixup_gnu_properties)
0519c2
+	bed->fixup_gnu_properties (info, &elf_properties (first_pbfd));
0519c2
+
0519c2
+      if (elf_properties (first_pbfd) == NULL)
0519c2
 	{
0519c2
-	  /* There are 4 byte type + 4 byte datasz for each property.  */
0519c2
-	  size += 4 + 4 + list->property.pr_datasz;
0519c2
-	  /* Align each property.  */
0519c2
-	  size = (size + (align_size - 1)) & ~(align_size - 1);
0519c2
+	  /* Discard .note.gnu.property section if all properties have
0519c2
+	     been removed.  */
0519c2
+	  sec->output_section = bfd_abs_section_ptr;
0519c2
+	  return NULL;
0519c2
 	}
0519c2
 
0519c2
+      /* Compute the section size.  */
0519c2
+      list = elf_properties (first_pbfd);
0519c2
+      size = elf_get_gnu_property_section_size (list, align_size);
0519c2
+
0519c2
       /* Update .note.gnu.property section now.  */
0519c2
       sec->size = size;
0519c2
       contents = (bfd_byte *) bfd_zalloc (first_pbfd, size);
0519c2
 
0519c2
-      e_note = (Elf_External_Note *) contents;
0519c2
-      bfd_h_put_32 (first_pbfd, sizeof "GNU", &e_note->namesz);
0519c2
-      bfd_h_put_32 (first_pbfd, size - descsz, &e_note->descsz);
0519c2
-      bfd_h_put_32 (first_pbfd, NT_GNU_PROPERTY_TYPE_0, &e_note->type);
0519c2
-      memcpy (e_note->name, "GNU", sizeof "GNU");
0519c2
-
0519c2
-      size = descsz;
0519c2
-      for (list = elf_properties (first_pbfd);
0519c2
-	   list != NULL;
0519c2
-	   list = list->next)
0519c2
-	{
0519c2
-	  /* There are 4 byte type + 4 byte datasz for each property.  */
0519c2
-	  bfd_h_put_32 (first_pbfd, list->property.pr_type,
0519c2
-			contents + size);
0519c2
-	  bfd_h_put_32 (first_pbfd, list->property.pr_datasz,
0519c2
-			contents + size + 4);
0519c2
-	  size += 4 + 4;
0519c2
-
0519c2
-	  /* Write out property value.  */
0519c2
-	  switch (list->property.pr_kind)
0519c2
-	    {
0519c2
-	    case property_number:
0519c2
-	      switch (list->property.pr_datasz)
0519c2
-		{
0519c2
-		default:
0519c2
-		  /* Never should happen.  */
0519c2
-		  abort ();
0519c2
-
0519c2
-		case 0:
0519c2
-		  break;
0519c2
-
0519c2
-		case 4:
0519c2
-		  bfd_h_put_32 (first_pbfd, list->property.u.number,
0519c2
-				contents + size);
0519c2
-		  break;
0519c2
-
0519c2
-		case 8:
0519c2
-		  bfd_h_put_64 (first_pbfd, list->property.u.number,
0519c2
-				contents + size);
0519c2
-		  break;
0519c2
-		}
0519c2
-	      break;
0519c2
-
0519c2
-	    default:
0519c2
-	      /* Never should happen.  */
0519c2
-	      abort ();
0519c2
-	    }
0519c2
-	  size += list->property.pr_datasz;
0519c2
-
0519c2
-	  /* Align each property.  */
0519c2
-	  size = (size + (align_size - 1)) & ~ (align_size - 1);
0519c2
-	}
0519c2
+      elf_write_gnu_properties (first_pbfd, contents, list, size,
0519c2
+				align_size);
0519c2
 
0519c2
       /* Cache the section contents for elf_link_input_bfd.  */
0519c2
       elf_section_data (sec)->this_hdr.contents = contents;
0519c2
@@ -508,3 +658,58 @@ _bfd_elf_link_setup_gnu_properties (stru
0519c2
 
0519c2
   return first_pbfd;
0519c2
 }
0519c2
+
0519c2
+/* Convert GNU property size.  */
0519c2
+
0519c2
+bfd_size_type
0519c2
+_bfd_elf_convert_gnu_property_size (bfd *ibfd, bfd *obfd)
0519c2
+{
0519c2
+  unsigned int align_size;
0519c2
+  const struct elf_backend_data *bed;
0519c2
+  elf_property_list *list = elf_properties (ibfd);
0519c2
+
0519c2
+  bed = get_elf_backend_data (obfd);
0519c2
+  align_size = bed->s->elfclass == ELFCLASS64 ? 8 : 4;
0519c2
+
0519c2
+  /* Get the output .note.gnu.property section size.  */
0519c2
+  return elf_get_gnu_property_section_size (list, align_size);
0519c2
+}
0519c2
+
0519c2
+/* Convert GNU properties.  */
0519c2
+
0519c2
+bfd_boolean
0519c2
+_bfd_elf_convert_gnu_properties (bfd *ibfd, asection *isec,
0519c2
+				 bfd *obfd, bfd_byte **ptr,
0519c2
+				 bfd_size_type *ptr_size)
0519c2
+{
0519c2
+  unsigned int size;
0519c2
+  bfd_byte *contents;
0519c2
+  unsigned int align_shift;
0519c2
+  const struct elf_backend_data *bed;
0519c2
+  elf_property_list *list = elf_properties (ibfd);
0519c2
+
0519c2
+  bed = get_elf_backend_data (obfd);
0519c2
+  align_shift = bed->s->elfclass == ELFCLASS64 ? 3 : 2;
0519c2
+
0519c2
+  /* Get the output .note.gnu.property section size.  */
0519c2
+  size = bfd_get_section_size (isec->output_section);
0519c2
+
0519c2
+  /* Update the output .note.gnu.property section alignment.  */
0519c2
+  bfd_set_section_alignment (obfd, isec->output_section, align_shift);
0519c2
+
0519c2
+  if (size > bfd_get_section_size (isec))
0519c2
+    {
0519c2
+      contents = (bfd_byte *) bfd_malloc (size);
0519c2
+      free (*ptr);
0519c2
+      *ptr = contents;
0519c2
+    }
0519c2
+  else
0519c2
+    contents = *ptr;
0519c2
+
0519c2
+  *ptr_size = size;
0519c2
+
0519c2
+  /* Generate the output .note.gnu.property section.  */
0519c2
+  elf_write_gnu_properties (ibfd, contents, list, size, 1 << align_shift);
0519c2
+
0519c2
+  return TRUE;
0519c2
+}
0519c2
diff -rup binutils.orig/bfd/elf.c binutils-2.30/bfd/elf.c
0519c2
--- binutils.orig/bfd/elf.c	2020-04-07 11:32:17.260776522 +0100
0519c2
+++ binutils-2.30/bfd/elf.c	2020-04-07 13:34:03.898784096 +0100
0519c2
@@ -4376,6 +4376,14 @@ get_program_header_size (bfd *abfd, stru
0519c2
       ++segs;
0519c2
     }
0519c2
 
0519c2
+  s = bfd_get_section_by_name (abfd,
0519c2
+			       NOTE_GNU_PROPERTY_SECTION_NAME);
0519c2
+  if (s != NULL && s->size != 0)
0519c2
+    {
0519c2
+      /* We need a PT_GNU_PROPERTY segment.  */
0519c2
+      ++segs;
0519c2
+    }
0519c2
+
0519c2
   for (s = abfd->sections; s != NULL; s = s->next)
0519c2
     {
0519c2
       if ((s->flags & SEC_LOAD) != 0
0519c2
@@ -5028,6 +5036,24 @@ _bfd_elf_map_sections_to_segments (bfd *
0519c2
 	      pm = &m->next;
0519c2
 	    }
0519c2
 
0519c2
+      s = bfd_get_section_by_name (abfd,
0519c2
+				   NOTE_GNU_PROPERTY_SECTION_NAME);
0519c2
+      if (s != NULL && s->size != 0)
0519c2
+	{
0519c2
+	  amt = sizeof (struct elf_segment_map) + sizeof (asection *);
0519c2
+	  m = bfd_zalloc (abfd, amt);
0519c2
+	  if (m == NULL)
0519c2
+	    goto error_return;
0519c2
+	  m->next = NULL;
0519c2
+	  m->p_type = PT_GNU_PROPERTY;
0519c2
+	  m->count = 1;
0519c2
+	  m->p_flags_valid = 1;
0519c2
+	  m->sections[0] = s;
0519c2
+	  m->p_flags = PF_R;
0519c2
+	  *pm = m;
0519c2
+	  pm = &m->next;
0519c2
+	}
0519c2
+
0519c2
       /* If there is a .eh_frame_hdr section, throw in a PT_GNU_EH_FRAME
0519c2
 	 segment.  */
0519c2
       eh_frame_hdr = elf_eh_frame_hdr (abfd);
0519c2
diff -rup binutils.orig/bfd/elfxx-target.h binutils-2.30/bfd/elfxx-target.h
0519c2
--- binutils.orig/bfd/elfxx-target.h	2020-04-07 11:32:17.267776472 +0100
0519c2
+++ binutils-2.30/bfd/elfxx-target.h	2020-04-07 13:34:03.899784089 +0100
0519c2
@@ -543,6 +543,9 @@
0519c2
 #ifndef elf_backend_setup_gnu_properties
0519c2
 #define elf_backend_setup_gnu_properties	_bfd_elf_link_setup_gnu_properties
0519c2
 #endif
0519c2
+#ifndef elf_backend_fixup_gnu_properties
0519c2
+#define elf_backend_fixup_gnu_properties	NULL
0519c2
+#endif
0519c2
 #ifndef elf_backend_static_tls_alignment
0519c2
 #define elf_backend_static_tls_alignment	1
0519c2
 #endif
0519c2
@@ -884,6 +887,7 @@ static struct elf_backend_data elfNN_bed
0519c2
   elf_backend_parse_gnu_properties,
0519c2
   elf_backend_merge_gnu_properties,
0519c2
   elf_backend_setup_gnu_properties,
0519c2
+  elf_backend_fixup_gnu_properties,
0519c2
   elf_backend_compact_eh_encoding,
0519c2
   elf_backend_cant_unwind_opcode,
0519c2
   elf_backend_init_secondary_reloc_section,
0519c2
diff -rup binutils.orig/bfd/elfxx-x86.c binutils-2.30/bfd/elfxx-x86.c
0519c2
--- binutils.orig/bfd/elfxx-x86.c	2020-04-07 11:32:17.271776442 +0100
0519c2
+++ binutils-2.30/bfd/elfxx-x86.c	2020-04-07 13:34:03.899784089 +0100
0519c2
@@ -2271,33 +2271,29 @@ _bfd_x86_elf_parse_gnu_properties (bfd *
0519c2
 {
0519c2
   elf_property *prop;
0519c2
 
0519c2
-  switch (type)
0519c2
+  if (type == GNU_PROPERTY_X86_COMPAT_ISA_1_USED
0519c2
+      || type == GNU_PROPERTY_X86_COMPAT_ISA_1_NEEDED
0519c2
+      || (type >= GNU_PROPERTY_X86_UINT32_AND_LO
0519c2
+	  && type <= GNU_PROPERTY_X86_UINT32_AND_HI)
0519c2
+      || (type >= GNU_PROPERTY_X86_UINT32_OR_LO
0519c2
+	  && type <= GNU_PROPERTY_X86_UINT32_OR_HI)
0519c2
+      || (type >= GNU_PROPERTY_X86_UINT32_OR_AND_LO
0519c2
+	  && type <= GNU_PROPERTY_X86_UINT32_OR_AND_HI))
0519c2
     {
0519c2
-    case GNU_PROPERTY_X86_ISA_1_USED:
0519c2
-    case GNU_PROPERTY_X86_ISA_1_NEEDED:
0519c2
-    case GNU_PROPERTY_X86_FEATURE_1_AND:
0519c2
       if (datasz != 4)
0519c2
 	{
0519c2
 	  _bfd_error_handler
0519c2
-	    ((type == GNU_PROPERTY_X86_ISA_1_USED
0519c2
-	      ? _("error: %B: <corrupt x86 ISA used size: 0x%x>")
0519c2
-	      : (type == GNU_PROPERTY_X86_ISA_1_NEEDED
0519c2
-		 ? _("error: %B: <corrupt x86 ISA needed size: 0x%x>")
0519c2
-		 : _("error: %B: <corrupt x86 feature size: 0x%x>"))),
0519c2
-	     abfd, datasz);
0519c2
+	    (_("error: %pB: <corrupt x86 property (0x%x) size: 0x%x>"),
0519c2
+	     abfd, type, datasz);
0519c2
 	  return property_corrupt;
0519c2
 	}
0519c2
       prop = _bfd_elf_get_property (abfd, type, datasz);
0519c2
-      /* Combine properties of the same type.  */
0519c2
       prop->u.number |= bfd_h_get_32 (abfd, ptr);
0519c2
       prop->pr_kind = property_number;
0519c2
-      break;
0519c2
-
0519c2
-    default:
0519c2
-      return property_ignored;
0519c2
+      return property_number;
0519c2
     }
0519c2
 
0519c2
-  return property_number;
0519c2
+  return property_ignored;
0519c2
 }
0519c2
 
0519c2
 /* Merge x86 GNU property BPROP with APROP.  If APROP isn't NULL,
0519c2
@@ -2307,6 +2303,7 @@ _bfd_x86_elf_parse_gnu_properties (bfd *
0519c2
 bfd_boolean
0519c2
 _bfd_x86_elf_merge_gnu_properties (struct bfd_link_info *info,
0519c2
 				   bfd *abfd ATTRIBUTE_UNUSED,
0519c2
+				   bfd *bbfd ATTRIBUTE_UNUSED,
0519c2
 				   elf_property *aprop,
0519c2
 				   elf_property *bprop)
0519c2
 {
0519c2
@@ -2314,15 +2311,38 @@ _bfd_x86_elf_merge_gnu_properties (struc
0519c2
   bfd_boolean updated = FALSE;
0519c2
   unsigned int pr_type = aprop != NULL ? aprop->pr_type : bprop->pr_type;
0519c2
 
0519c2
-  switch (pr_type)
0519c2
+  if (pr_type == GNU_PROPERTY_X86_COMPAT_ISA_1_USED
0519c2
+      || (pr_type >= GNU_PROPERTY_X86_UINT32_OR_AND_LO
0519c2
+	  && pr_type <= GNU_PROPERTY_X86_UINT32_OR_AND_HI))
0519c2
+    {
0519c2
+      if (aprop == NULL || bprop == NULL)
0519c2
+	{
0519c2
+	  /* Only one of APROP and BPROP can be NULL.  */
0519c2
+	  if (aprop != NULL)
0519c2
+	    {
0519c2
+	      /* Remove this property since the other input file doesn't
0519c2
+		 have it.  */
0519c2
+	      aprop->pr_kind = property_remove;
0519c2
+	      updated = TRUE;
0519c2
+	    }
0519c2
+	}
0519c2
+      else
0519c2
+	{
0519c2
+	  number = aprop->u.number;
0519c2
+	  aprop->u.number = number | bprop->u.number;
0519c2
+	  updated = number != (unsigned int) aprop->u.number;
0519c2
+	}
0519c2
+      return updated;
0519c2
+    }
0519c2
+  else if (pr_type == GNU_PROPERTY_X86_COMPAT_ISA_1_NEEDED
0519c2
+	   || (pr_type >= GNU_PROPERTY_X86_UINT32_OR_LO
0519c2
+	       && pr_type <= GNU_PROPERTY_X86_UINT32_OR_HI))
0519c2
     {
0519c2
-    case GNU_PROPERTY_X86_ISA_1_USED:
0519c2
-    case GNU_PROPERTY_X86_ISA_1_NEEDED:
0519c2
       if (aprop != NULL && bprop != NULL)
0519c2
 	{
0519c2
 	  number = aprop->u.number;
0519c2
 	  aprop->u.number = number | bprop->u.number;
0519c2
-	  /* Remove the property if ISA bits are empty.  */
0519c2
+	  /* Remove the property if all bits are empty.  */
0519c2
 	  if (aprop->u.number == 0)
0519c2
 	    {
0519c2
 	      aprop->pr_kind = property_remove;
0519c2
@@ -2338,27 +2358,35 @@ _bfd_x86_elf_merge_gnu_properties (struc
0519c2
 	    {
0519c2
 	      if (aprop->u.number == 0)
0519c2
 		{
0519c2
-		  /* Remove APROP if ISA bits are empty.  */
0519c2
+		  /* Remove APROP if all bits are empty.  */
0519c2
 		  aprop->pr_kind = property_remove;
0519c2
 		  updated = TRUE;
0519c2
 		}
0519c2
 	    }
0519c2
 	  else
0519c2
 	    {
0519c2
-	      /* Return TRUE if APROP is NULL and ISA bits of BPROP
0519c2
+	      /* Return TRUE if APROP is NULL and all bits of BPROP
0519c2
 		 aren't empty to indicate that BPROP should be added
0519c2
 		 to ABFD.  */
0519c2
 	      updated = bprop->u.number != 0;
0519c2
 	    }
0519c2
 	}
0519c2
-      break;
0519c2
-
0519c2
-    case GNU_PROPERTY_X86_FEATURE_1_AND:
0519c2
+      return updated;
0519c2
+    }
0519c2
+  else if (pr_type >= GNU_PROPERTY_X86_UINT32_AND_LO
0519c2
+	   && pr_type <= GNU_PROPERTY_X86_UINT32_AND_HI)
0519c2
+    {
0519c2
       /* Only one of APROP and BPROP can be NULL:
0519c2
 	 1. APROP & BPROP when both APROP and BPROP aren't NULL.
0519c2
 	 2. If APROP is NULL, remove x86 feature.
0519c2
 	 3. Otherwise, do nothing.
0519c2
        */
0519c2
+      const struct elf_backend_data *bed
0519c2
+	= get_elf_backend_data (info->output_bfd);
0519c2
+      struct elf_x86_link_hash_table *htab
0519c2
+	= elf_x86_hash_table (info, bed->target_id);
0519c2
+      if (!htab)
0519c2
+	abort ();
0519c2
       if (aprop != NULL && bprop != NULL)
0519c2
 	{
0519c2
 	  features = 0;
0519c2
@@ -2404,9 +2432,10 @@ _bfd_x86_elf_merge_gnu_properties (struc
0519c2
 	      updated = TRUE;
0519c2
 	    }
0519c2
 	}
0519c2
-      break;
0519c2
-
0519c2
-    default:
0519c2
+      return updated;
0519c2
+    }
0519c2
+  else
0519c2
+    {
0519c2
       /* Never should happen.  */
0519c2
       abort ();
0519c2
     }
0519c2
@@ -2434,12 +2463,12 @@ _bfd_x86_elf_link_setup_gnu_properties
0519c2
   const struct elf_backend_data *bed;
0519c2
   unsigned int class_align = ABI_64_P (info->output_bfd) ? 3 : 2;
0519c2
   unsigned int got_align;
0519c2
-
0519c2
-  features = 0;
0519c2
-  if (info->ibt)
0519c2
-    features = GNU_PROPERTY_X86_FEATURE_1_IBT;
0519c2
-  if (info->shstk)
0519c2
-    features |= GNU_PROPERTY_X86_FEATURE_1_SHSTK;
0519c2
+  enum report
0519c2
+  {
0519c2
+   report_none	= 0,	    /* Do nothing.  */
0519c2
+   report_ibt	= 1 << 2,   /* Report missing IBT property.  */
0519c2
+   report_shstk	= 1 << 3    /* Report missing SHSTK property.  */
0519c2
+  } report;
0519c2
 
0519c2
   /* Find a normal input file with GNU property note.  */
0519c2
   for (pbfd = info->input_bfds;
0519c2
@@ -2454,18 +2483,46 @@ _bfd_x86_elf_link_setup_gnu_properties
0519c2
 	  break;
0519c2
       }
0519c2
 
0519c2
-  if (ebfd != NULL && features)
0519c2
+  bed = get_elf_backend_data (info->output_bfd);
0519c2
+
0519c2
+  htab = elf_x86_hash_table (info, bed->target_id);
0519c2
+  if (htab == NULL)
0519c2
+    return pbfd;
0519c2
+
0519c2
+  features = 0;
0519c2
+  report = report_ibt | report_shstk;
0519c2
+
0519c2
+  if (info->ibt)
0519c2
     {
0519c2
-      /* If features is set, add GNU_PROPERTY_X86_FEATURE_1_IBT and
0519c2
-	 GNU_PROPERTY_X86_FEATURE_1_SHSTK.  */
0519c2
-      prop = _bfd_elf_get_property (ebfd,
0519c2
-				    GNU_PROPERTY_X86_FEATURE_1_AND,
0519c2
-				    4);
0519c2
-      prop->u.number |= features;
0519c2
-      prop->pr_kind = property_number;
0519c2
+      features = GNU_PROPERTY_X86_FEATURE_1_IBT;
0519c2
+      report &= ~ report_ibt;
0519c2
+    }
0519c2
+
0519c2
+  if (info->shstk)
0519c2
+    {
0519c2
+      features |= GNU_PROPERTY_X86_FEATURE_1_SHSTK;
0519c2
+      report &= ~ report_shstk;
0519c2
+    }
0519c2
+
0519c2
+  if (report == 0)
0519c2
+    info->cet_report = 0;
0519c2
+
0519c2
+  if (ebfd != NULL)
0519c2
+    {
0519c2
+      prop = NULL;
0519c2
+      if (features)
0519c2
+	{
0519c2
+	  /* If features is set, add GNU_PROPERTY_X86_FEATURE_1_IBT and
0519c2
+	     GNU_PROPERTY_X86_FEATURE_1_SHSTK.  */
0519c2
+	  prop = _bfd_elf_get_property (ebfd,
0519c2
+					GNU_PROPERTY_X86_FEATURE_1_AND,
0519c2
+					4);
0519c2
+	  prop->u.number |= features;
0519c2
+	  prop->pr_kind = property_number;
0519c2
+	}
0519c2
 
0519c2
       /* Create the GNU property note section if needed.  */
0519c2
-      if (pbfd == NULL)
0519c2
+      if (prop != NULL && pbfd == NULL)
0519c2
 	{
0519c2
 	  sec = bfd_make_section_with_flags (ebfd,
0519c2
 					     NOTE_GNU_PROPERTY_SECTION_NAME,
0519c2
@@ -2481,7 +2538,7 @@ _bfd_x86_elf_link_setup_gnu_properties
0519c2
 	  if (!bfd_set_section_alignment (ebfd, sec, class_align))
0519c2
 	    {
0519c2
 error_alignment:
0519c2
-	      info->callbacks->einfo (_("%F%A: failed to align section\n"),
0519c2
+	      info->callbacks->einfo (_("%F%pA: failed to align section\n"),
0519c2
 				      sec);
0519c2
 	    }
0519c2
 
0519c2
@@ -2489,13 +2546,53 @@ error_alignment:
0519c2
 	}
0519c2
     }
0519c2
 
0519c2
-  pbfd = _bfd_elf_link_setup_gnu_properties (info);
0519c2
+  if (info->cet_report)
0519c2
+    {
0519c2
+      /* Report missing IBT and SHSTK properties.  */
0519c2
+      bfd *abfd;
0519c2
+      const char *msg;
0519c2
+      elf_property_list *p;
0519c2
+      bfd_boolean missing_ibt, missing_shstk;
0519c2
+      bfd_boolean check_ibt   = !!(report & report_ibt);
0519c2
+      bfd_boolean check_shstk = !!(report & report_shstk);
0519c2
 
0519c2
-  bed = get_elf_backend_data (info->output_bfd);
0519c2
+      if (info->cet_report == 1)
0519c2
+	msg = _("%P: %B: warning: missing %s\n");
0519c2
+      else
0519c2
+	msg = _("%X%P: %B: error: missing %s\n");
0519c2
 
0519c2
-  htab = elf_x86_hash_table (info, bed->target_id);
0519c2
-  if (htab == NULL)
0519c2
-    return pbfd;
0519c2
+      for (abfd = info->input_bfds; abfd != NULL; abfd = abfd->link.next)
0519c2
+	if (!(abfd->flags & (DYNAMIC | BFD_PLUGIN | BFD_LINKER_CREATED))
0519c2
+	    && bfd_get_flavour (abfd) == bfd_target_elf_flavour)
0519c2
+	  {
0519c2
+	    for (p = elf_properties (abfd); p; p = p->next)
0519c2
+	      if (p->property.pr_type == GNU_PROPERTY_X86_FEATURE_1_AND)
0519c2
+		break;
0519c2
+
0519c2
+	    missing_ibt = check_ibt;
0519c2
+	    missing_shstk = check_shstk;
0519c2
+	    if (p)
0519c2
+	      {
0519c2
+		missing_ibt &= !(p->property.u.number
0519c2
+				 & GNU_PROPERTY_X86_FEATURE_1_IBT);
0519c2
+		missing_shstk &= !(p->property.u.number
0519c2
+				   & GNU_PROPERTY_X86_FEATURE_1_SHSTK);
0519c2
+	      }
0519c2
+	    if (missing_ibt || missing_shstk)
0519c2
+	      {
0519c2
+		const char *missing;
0519c2
+		if (missing_ibt && missing_shstk)
0519c2
+		  missing = _("IBT and SHSTK properties");
0519c2
+		else if (missing_ibt)
0519c2
+		  missing = _("IBT property");
0519c2
+		else
0519c2
+		  missing = _("SHSTK property");
0519c2
+		info->callbacks->einfo (msg, abfd, missing);
0519c2
+	      }
0519c2
+	  }
0519c2
+    }
0519c2
+
0519c2
+  pbfd = _bfd_elf_link_setup_gnu_properties (info);
0519c2
 
0519c2
   htab->r_info = init_table->r_info;
0519c2
   htab->r_sym = init_table->r_sym;
0519c2
@@ -2806,3 +2903,47 @@ error_alignment:
0519c2
 
0519c2
   return pbfd;
0519c2
 }
0519c2
+
0519c2
+/* Fix up x86 GNU properties.  */
0519c2
+
0519c2
+void
0519c2
+_bfd_x86_elf_link_fixup_gnu_properties
0519c2
+  (struct bfd_link_info *info ATTRIBUTE_UNUSED,
0519c2
+   elf_property_list **listp)
0519c2
+{
0519c2
+  elf_property_list *p;
0519c2
+
0519c2
+  for (p = *listp; p; p = p->next)
0519c2
+    {
0519c2
+      unsigned int type = p->property.pr_type;
0519c2
+
0519c2
+      if (type == GNU_PROPERTY_X86_COMPAT_ISA_1_USED
0519c2
+	  || type == GNU_PROPERTY_X86_COMPAT_ISA_1_NEEDED
0519c2
+	  || (type >= GNU_PROPERTY_X86_UINT32_AND_LO
0519c2
+	      && type <= GNU_PROPERTY_X86_UINT32_AND_HI)
0519c2
+	  || (type >= GNU_PROPERTY_X86_UINT32_OR_LO
0519c2
+	      && type <= GNU_PROPERTY_X86_UINT32_OR_HI)
0519c2
+	  || (type >= GNU_PROPERTY_X86_UINT32_OR_AND_LO
0519c2
+	      && type <= GNU_PROPERTY_X86_UINT32_OR_AND_HI))
0519c2
+	{
0519c2
+	  if (p->property.u.number == 0
0519c2
+	      && (type == GNU_PROPERTY_X86_COMPAT_ISA_1_NEEDED
0519c2
+		  || (type >= GNU_PROPERTY_X86_UINT32_AND_LO
0519c2
+		      && type <= GNU_PROPERTY_X86_UINT32_AND_HI)
0519c2
+		  || (type >= GNU_PROPERTY_X86_UINT32_OR_LO
0519c2
+		      && type <= GNU_PROPERTY_X86_UINT32_OR_HI)))
0519c2
+	    {
0519c2
+	      /* Remove empty property.  */
0519c2
+	      *listp = p->next;
0519c2
+	      continue;
0519c2
+	    }
0519c2
+
0519c2
+	  listp = &p->next;
0519c2
+	}
0519c2
+      else if (type > GNU_PROPERTY_HIPROC)
0519c2
+	{
0519c2
+	  /* The property list is sorted in order of type.  */
0519c2
+	  break;
0519c2
+	}
0519c2
+    }
0519c2
+}
0519c2
diff -rup binutils.orig/bfd/elfxx-x86.h binutils-2.30/bfd/elfxx-x86.h
0519c2
--- binutils.orig/bfd/elfxx-x86.h	2020-04-07 11:32:17.280776377 +0100
0519c2
+++ binutils-2.30/bfd/elfxx-x86.h	2020-04-07 13:34:03.900784082 +0100
0519c2
@@ -653,11 +653,14 @@ extern enum elf_property_kind _bfd_x86_e
0519c2
   (bfd *, unsigned int, bfd_byte *, unsigned int);
0519c2
 
0519c2
 extern bfd_boolean _bfd_x86_elf_merge_gnu_properties
0519c2
-  (struct bfd_link_info *, bfd *, elf_property *, elf_property *);
0519c2
+  (struct bfd_link_info *, bfd *, bfd *, elf_property *, elf_property *);
0519c2
 
0519c2
 extern bfd * _bfd_x86_elf_link_setup_gnu_properties
0519c2
   (struct bfd_link_info *, struct elf_x86_init_table *);
0519c2
 
0519c2
+extern void _bfd_x86_elf_link_fixup_gnu_properties
0519c2
+  (struct bfd_link_info *, elf_property_list **);
0519c2
+
0519c2
 #define bfd_elf64_mkobject \
0519c2
   _bfd_x86_elf_mkobject
0519c2
 #define bfd_elf32_mkobject \
0519c2
@@ -693,3 +696,5 @@ extern bfd * _bfd_x86_elf_link_setup_gnu
0519c2
   _bfd_x86_elf_parse_gnu_properties
0519c2
 #define elf_backend_merge_gnu_properties \
0519c2
   _bfd_x86_elf_merge_gnu_properties
0519c2
+#define elf_backend_fixup_gnu_properties \
0519c2
+  _bfd_x86_elf_link_fixup_gnu_properties
0519c2
diff -rup binutils.orig/binutils/readelf.c binutils-2.30/binutils/readelf.c
0519c2
--- binutils.orig/binutils/readelf.c	2020-04-07 11:32:17.244776638 +0100
0519c2
+++ binutils-2.30/binutils/readelf.c	2020-04-07 13:34:03.901784074 +0100
0519c2
@@ -3910,6 +3910,7 @@ get_segment_type (Filedata * filedata, u
0519c2
     case PT_GNU_EH_FRAME: return "GNU_EH_FRAME";
0519c2
     case PT_GNU_STACK:	return "GNU_STACK";
0519c2
     case PT_GNU_RELRO:  return "GNU_RELRO";
0519c2
+    case PT_GNU_PROPERTY: return "GNU_PROPERTY";
0519c2
 
0519c2
     default:
0519c2
       if (p_type >= PT_GNU_MBIND_LO && p_type <= PT_GNU_MBIND_HI)
0519c2
@@ -16843,8 +16844,87 @@ get_gnu_elf_note_type (unsigned e_type)
0519c2
 }
0519c2
 
0519c2
 static void
0519c2
+decode_x86_compat_isa (unsigned int bitmask)
0519c2
+{
0519c2
+  while (bitmask)
0519c2
+    {
0519c2
+      unsigned int bit = bitmask & (- bitmask);
0519c2
+
0519c2
+      bitmask &= ~ bit;
0519c2
+      switch (bit)
0519c2
+	{
0519c2
+	case GNU_PROPERTY_X86_COMPAT_ISA_1_486:
0519c2
+	  printf ("i486");
0519c2
+	  break;
0519c2
+	case GNU_PROPERTY_X86_COMPAT_ISA_1_586:
0519c2
+	  printf ("586");
0519c2
+	  break;
0519c2
+	case GNU_PROPERTY_X86_COMPAT_ISA_1_686:
0519c2
+	  printf ("686");
0519c2
+	  break;
0519c2
+	case GNU_PROPERTY_X86_COMPAT_ISA_1_SSE:
0519c2
+	  printf ("SSE");
0519c2
+	  break;
0519c2
+	case GNU_PROPERTY_X86_COMPAT_ISA_1_SSE2:
0519c2
+	  printf ("SSE2");
0519c2
+	  break;
0519c2
+	case GNU_PROPERTY_X86_COMPAT_ISA_1_SSE3:
0519c2
+	  printf ("SSE3");
0519c2
+	  break;
0519c2
+	case GNU_PROPERTY_X86_COMPAT_ISA_1_SSSE3:
0519c2
+	  printf ("SSSE3");
0519c2
+	  break;
0519c2
+	case GNU_PROPERTY_X86_COMPAT_ISA_1_SSE4_1:
0519c2
+	  printf ("SSE4_1");
0519c2
+	  break;
0519c2
+	case GNU_PROPERTY_X86_COMPAT_ISA_1_SSE4_2:
0519c2
+	  printf ("SSE4_2");
0519c2
+	  break;
0519c2
+	case GNU_PROPERTY_X86_COMPAT_ISA_1_AVX:
0519c2
+	  printf ("AVX");
0519c2
+	  break;
0519c2
+	case GNU_PROPERTY_X86_COMPAT_ISA_1_AVX2:
0519c2
+	  printf ("AVX2");
0519c2
+	  break;
0519c2
+	case GNU_PROPERTY_X86_COMPAT_ISA_1_AVX512F:
0519c2
+	  printf ("AVX512F");
0519c2
+	  break;
0519c2
+	case GNU_PROPERTY_X86_COMPAT_ISA_1_AVX512CD:
0519c2
+	  printf ("AVX512CD");
0519c2
+	  break;
0519c2
+	case GNU_PROPERTY_X86_COMPAT_ISA_1_AVX512ER:
0519c2
+	  printf ("AVX512ER");
0519c2
+	  break;
0519c2
+	case GNU_PROPERTY_X86_COMPAT_ISA_1_AVX512PF:
0519c2
+	  printf ("AVX512PF");
0519c2
+	  break;
0519c2
+	case GNU_PROPERTY_X86_COMPAT_ISA_1_AVX512VL:
0519c2
+	  printf ("AVX512VL");
0519c2
+	  break;
0519c2
+	case GNU_PROPERTY_X86_COMPAT_ISA_1_AVX512DQ:
0519c2
+	  printf ("AVX512DQ");
0519c2
+	  break;
0519c2
+	case GNU_PROPERTY_X86_COMPAT_ISA_1_AVX512BW:
0519c2
+	  printf ("AVX512BW");
0519c2
+	  break;
0519c2
+	default:
0519c2
+	  printf (_("<unknown: %x>"), bit);
0519c2
+	  break;
0519c2
+	}
0519c2
+      if (bitmask)
0519c2
+	printf (", ");
0519c2
+    }
0519c2
+}
0519c2
+
0519c2
+static void
0519c2
 decode_x86_isa (unsigned int bitmask)
0519c2
 {
0519c2
+  if (!bitmask)
0519c2
+    {
0519c2
+      printf (_("<None>"));
0519c2
+      return;
0519c2
+    }
0519c2
+
0519c2
   while (bitmask)
0519c2
     {
0519c2
       unsigned int bit = bitmask & (- bitmask);
0519c2
@@ -16852,25 +16932,84 @@ decode_x86_isa (unsigned int bitmask)
0519c2
       bitmask &= ~ bit;
0519c2
       switch (bit)
0519c2
 	{
0519c2
-	case GNU_PROPERTY_X86_ISA_1_486: printf ("i486"); break;
0519c2
-	case GNU_PROPERTY_X86_ISA_1_586: printf ("586"); break;
0519c2
-	case GNU_PROPERTY_X86_ISA_1_686: printf ("686"); break;
0519c2
-	case GNU_PROPERTY_X86_ISA_1_SSE: printf ("SSE"); break;
0519c2
-	case GNU_PROPERTY_X86_ISA_1_SSE2: printf ("SSE2"); break;
0519c2
-	case GNU_PROPERTY_X86_ISA_1_SSE3: printf ("SSE3"); break;
0519c2
-	case GNU_PROPERTY_X86_ISA_1_SSSE3: printf ("SSSE3"); break;
0519c2
-	case GNU_PROPERTY_X86_ISA_1_SSE4_1: printf ("SSE4_1"); break;
0519c2
-	case GNU_PROPERTY_X86_ISA_1_SSE4_2: printf ("SSE4_2"); break;
0519c2
-	case GNU_PROPERTY_X86_ISA_1_AVX: printf ("AVX"); break;
0519c2
-	case GNU_PROPERTY_X86_ISA_1_AVX2: printf ("AVX2"); break;
0519c2
-	case GNU_PROPERTY_X86_ISA_1_AVX512F: printf ("AVX512F"); break;
0519c2
-	case GNU_PROPERTY_X86_ISA_1_AVX512CD: printf ("AVX512CD"); break;
0519c2
-	case GNU_PROPERTY_X86_ISA_1_AVX512ER: printf ("AVX512ER"); break;
0519c2
-	case GNU_PROPERTY_X86_ISA_1_AVX512PF: printf ("AVX512PF"); break;
0519c2
-	case GNU_PROPERTY_X86_ISA_1_AVX512VL: printf ("AVX512VL"); break;
0519c2
-	case GNU_PROPERTY_X86_ISA_1_AVX512DQ: printf ("AVX512DQ"); break;
0519c2
-	case GNU_PROPERTY_X86_ISA_1_AVX512BW: printf ("AVX512BW"); break;
0519c2
-	default: printf (_("<unknown: %x>"), bit); break;
0519c2
+	case GNU_PROPERTY_X86_ISA_1_CMOV:
0519c2
+	  printf ("CMOV");
0519c2
+	  break;
0519c2
+	case GNU_PROPERTY_X86_ISA_1_SSE:
0519c2
+	  printf ("SSE");
0519c2
+	  break;
0519c2
+	case GNU_PROPERTY_X86_ISA_1_SSE2:
0519c2
+	  printf ("SSE2");
0519c2
+	  break;
0519c2
+	case GNU_PROPERTY_X86_ISA_1_SSE3:
0519c2
+	  printf ("SSE3");
0519c2
+	  break;
0519c2
+	case GNU_PROPERTY_X86_ISA_1_SSSE3:
0519c2
+	  printf ("SSSE3");
0519c2
+	  break;
0519c2
+	case GNU_PROPERTY_X86_ISA_1_SSE4_1:
0519c2
+	  printf ("SSE4_1");
0519c2
+	  break;
0519c2
+	case GNU_PROPERTY_X86_ISA_1_SSE4_2:
0519c2
+	  printf ("SSE4_2");
0519c2
+	  break;
0519c2
+	case GNU_PROPERTY_X86_ISA_1_AVX:
0519c2
+	  printf ("AVX");
0519c2
+	  break;
0519c2
+	case GNU_PROPERTY_X86_ISA_1_AVX2:
0519c2
+	  printf ("AVX2");
0519c2
+	  break;
0519c2
+	case GNU_PROPERTY_X86_ISA_1_FMA:
0519c2
+	  printf ("FMA");
0519c2
+	  break;
0519c2
+	case GNU_PROPERTY_X86_ISA_1_AVX512F:
0519c2
+	  printf ("AVX512F");
0519c2
+	  break;
0519c2
+	case GNU_PROPERTY_X86_ISA_1_AVX512CD:
0519c2
+	  printf ("AVX512CD");
0519c2
+	  break;
0519c2
+	case GNU_PROPERTY_X86_ISA_1_AVX512ER:
0519c2
+	  printf ("AVX512ER");
0519c2
+	  break;
0519c2
+	case GNU_PROPERTY_X86_ISA_1_AVX512PF:
0519c2
+	  printf ("AVX512PF");
0519c2
+	  break;
0519c2
+	case GNU_PROPERTY_X86_ISA_1_AVX512VL:
0519c2
+	  printf ("AVX512VL");
0519c2
+	  break;
0519c2
+	case GNU_PROPERTY_X86_ISA_1_AVX512DQ:
0519c2
+	  printf ("AVX512DQ");
0519c2
+	  break;
0519c2
+	case GNU_PROPERTY_X86_ISA_1_AVX512BW:
0519c2
+	  printf ("AVX512BW");
0519c2
+	  break;
0519c2
+	case GNU_PROPERTY_X86_ISA_1_AVX512_4FMAPS:
0519c2
+	  printf ("AVX512_4FMAPS");
0519c2
+	  break;
0519c2
+	case GNU_PROPERTY_X86_ISA_1_AVX512_4VNNIW:
0519c2
+	  printf ("AVX512_4VNNIW");
0519c2
+	  break;
0519c2
+	case GNU_PROPERTY_X86_ISA_1_AVX512_BITALG:
0519c2
+	  printf ("AVX512_BITALG");
0519c2
+	  break;
0519c2
+	case GNU_PROPERTY_X86_ISA_1_AVX512_IFMA:
0519c2
+	  printf ("AVX512_IFMA");
0519c2
+	  break;
0519c2
+	case GNU_PROPERTY_X86_ISA_1_AVX512_VBMI:
0519c2
+	  printf ("AVX512_VBMI");
0519c2
+	  break;
0519c2
+	case GNU_PROPERTY_X86_ISA_1_AVX512_VBMI2:
0519c2
+	  printf ("AVX512_VBMI2");
0519c2
+	  break;
0519c2
+	case GNU_PROPERTY_X86_ISA_1_AVX512_VNNI:
0519c2
+	  printf ("AVX512_VNNI");
0519c2
+	  break;
0519c2
+	case GNU_PROPERTY_X86_ISA_1_AVX512_BF16:
0519c2
+	  printf ("AVX512_BF16");
0519c2
+	  break;
0519c2
+	default:
0519c2
+	  printf (_("<unknown: %x>"), bit);
0519c2
+	  break;
0519c2
 	}
0519c2
       if (bitmask)
0519c2
 	printf (", ");
0519c2
@@ -16878,8 +17017,14 @@ decode_x86_isa (unsigned int bitmask)
0519c2
 }
0519c2
 
0519c2
 static void
0519c2
-decode_x86_feature (unsigned int type, unsigned int bitmask)
0519c2
+decode_x86_feature_1 (unsigned int bitmask)
0519c2
 {
0519c2
+  if (!bitmask)
0519c2
+    {
0519c2
+      printf (_("<None>"));
0519c2
+      return;
0519c2
+    }
0519c2
+
0519c2
   while (bitmask)
0519c2
     {
0519c2
       unsigned int bit = bitmask & (- bitmask);
0519c2
@@ -16888,26 +17033,65 @@ decode_x86_feature (unsigned int type, u
0519c2
       switch (bit)
0519c2
 	{
0519c2
 	case GNU_PROPERTY_X86_FEATURE_1_IBT:
0519c2
-	  switch (type)
0519c2
-	    {
0519c2
-	    case GNU_PROPERTY_X86_FEATURE_1_AND:
0519c2
-	      printf ("IBT");
0519c2
-	      break;
0519c2
-	    default:
0519c2
-	      /* This should never happen.  */
0519c2
-	      abort ();
0519c2
-	    }
0519c2
+	  printf ("IBT");
0519c2
 	  break;
0519c2
 	case GNU_PROPERTY_X86_FEATURE_1_SHSTK:
0519c2
-	  switch (type)
0519c2
-	    {
0519c2
-	    case GNU_PROPERTY_X86_FEATURE_1_AND:
0519c2
-	      printf ("SHSTK");
0519c2
-	      break;
0519c2
-	    default:
0519c2
-	      /* This should never happen.  */
0519c2
-	      abort ();
0519c2
-	    }
0519c2
+	  printf ("SHSTK");
0519c2
+	  break;
0519c2
+	default:
0519c2
+	  printf (_("<unknown: %x>"), bit);
0519c2
+	  break;
0519c2
+	}
0519c2
+      if (bitmask)
0519c2
+	printf (", ");
0519c2
+    }
0519c2
+}
0519c2
+
0519c2
+static void
0519c2
+decode_x86_feature_2 (unsigned int bitmask)
0519c2
+{
0519c2
+  if (!bitmask)
0519c2
+    {
0519c2
+      printf (_("<None>"));
0519c2
+      return;
0519c2
+    }
0519c2
+
0519c2
+  while (bitmask)
0519c2
+    {
0519c2
+      unsigned int bit = bitmask & (- bitmask);
0519c2
+
0519c2
+      bitmask &= ~ bit;
0519c2
+      switch (bit)
0519c2
+	{
0519c2
+	case GNU_PROPERTY_X86_FEATURE_2_X86:
0519c2
+	  printf ("x86");
0519c2
+	  break;
0519c2
+	case GNU_PROPERTY_X86_FEATURE_2_X87:
0519c2
+	  printf ("x87");
0519c2
+	  break;
0519c2
+	case GNU_PROPERTY_X86_FEATURE_2_MMX:
0519c2
+	  printf ("MMX");
0519c2
+	  break;
0519c2
+	case GNU_PROPERTY_X86_FEATURE_2_XMM:
0519c2
+	  printf ("XMM");
0519c2
+	  break;
0519c2
+	case GNU_PROPERTY_X86_FEATURE_2_YMM:
0519c2
+	  printf ("YMM");
0519c2
+	  break;
0519c2
+	case GNU_PROPERTY_X86_FEATURE_2_ZMM:
0519c2
+	  printf ("ZMM");
0519c2
+	  break;
0519c2
+	case GNU_PROPERTY_X86_FEATURE_2_FXSR:
0519c2
+	  printf ("FXSR");
0519c2
+	  break;
0519c2
+	case GNU_PROPERTY_X86_FEATURE_2_XSAVE:
0519c2
+	  printf ("XSAVE");
0519c2
+	  break;
0519c2
+	case GNU_PROPERTY_X86_FEATURE_2_XSAVEOPT:
0519c2
+	  printf ("XSAVEOPT");
0519c2
+	  break;
0519c2
+	case GNU_PROPERTY_X86_FEATURE_2_XSAVEC:
0519c2
+	  printf ("XSAVEC");
0519c2
 	  break;
0519c2
 	default:
0519c2
 	  printf (_("<unknown: %x>"), bit);
0519c2
@@ -16963,30 +17147,89 @@ print_gnu_property_note (Filedata * file
0519c2
 	      || filedata->file_header.e_machine == EM_IAMCU
0519c2
 	      || filedata->file_header.e_machine == EM_386)
0519c2
 	    {
0519c2
+	      unsigned int bitmask;
0519c2
+
0519c2
+	      if (datasz == 4)
0519c2
+		bitmask = byte_get (ptr, 4);
0519c2
+	      else
0519c2
+		bitmask = 0;
0519c2
+
0519c2
 	      switch (type)
0519c2
 		{
0519c2
 		case GNU_PROPERTY_X86_ISA_1_USED:
0519c2
-		  printf ("x86 ISA used: ");
0519c2
 		  if (datasz != 4)
0519c2
-		    printf (_("<corrupt length: %#x> "), datasz);
0519c2
+		    printf (_("x86 ISA used: <corrupt length: %#x> "),
0519c2
+			    datasz);
0519c2
 		  else
0519c2
-		    decode_x86_isa (byte_get (ptr, 4));
0519c2
+		    {
0519c2
+		      printf ("x86 ISA used: ");
0519c2
+		      decode_x86_isa (bitmask);
0519c2
+		    }
0519c2
 		  goto next;
0519c2
 
0519c2
 		case GNU_PROPERTY_X86_ISA_1_NEEDED:
0519c2
-		  printf ("x86 ISA needed: ");
0519c2
 		  if (datasz != 4)
0519c2
-		    printf (_("<corrupt length: %#x> "), datasz);
0519c2
+		    printf (_("x86 ISA needed: <corrupt length: %#x> "),
0519c2
+			    datasz);
0519c2
 		  else
0519c2
-		    decode_x86_isa (byte_get (ptr, 4));
0519c2
+		    {
0519c2
+		      printf ("x86 ISA needed: ");
0519c2
+		      decode_x86_isa (bitmask);
0519c2
+		    }
0519c2
 		  goto next;
0519c2
 
0519c2
 		case GNU_PROPERTY_X86_FEATURE_1_AND:
0519c2
-		  printf ("x86 feature: ");
0519c2
 		  if (datasz != 4)
0519c2
-		    printf (_("<corrupt length: %#x> "), datasz);
0519c2
+		    printf (_("x86 feature: <corrupt length: %#x> "),
0519c2
+			    datasz);
0519c2
 		  else
0519c2
-		    decode_x86_feature (type, byte_get (ptr, 4));
0519c2
+		    {
0519c2
+		      printf ("x86 feature: ");
0519c2
+		      decode_x86_feature_1 (bitmask);
0519c2
+		    }
0519c2
+		  goto next;
0519c2
+
0519c2
+		case GNU_PROPERTY_X86_FEATURE_2_USED:
0519c2
+		  if (datasz != 4)
0519c2
+		    printf (_("x86 feature used: <corrupt length: %#x> "),
0519c2
+			    datasz);
0519c2
+		  else
0519c2
+		    {
0519c2
+		      printf ("x86 feature used: ");
0519c2
+		      decode_x86_feature_2 (bitmask);
0519c2
+		    }
0519c2
+		  goto next;
0519c2
+
0519c2
+		case GNU_PROPERTY_X86_FEATURE_2_NEEDED:
0519c2
+		  if (datasz != 4)
0519c2
+		    printf (_("x86 feature needed: <corrupt length: %#x> "), datasz);
0519c2
+		  else
0519c2
+		    {
0519c2
+		      printf ("x86 feature needed: ");
0519c2
+		      decode_x86_feature_2 (bitmask);
0519c2
+		    }
0519c2
+		  goto next;
0519c2
+
0519c2
+		case GNU_PROPERTY_X86_COMPAT_ISA_1_USED:
0519c2
+		  if (datasz != 4)
0519c2
+		    printf (_("x86 ISA used: <corrupt length: %#x> "),
0519c2
+			    datasz);
0519c2
+		  else
0519c2
+		    {
0519c2
+		      printf ("x86 ISA used: ");
0519c2
+		      decode_x86_compat_isa (bitmask);
0519c2
+		    }
0519c2
+		  goto next;
0519c2
+
0519c2
+		case GNU_PROPERTY_X86_COMPAT_ISA_1_NEEDED:
0519c2
+		  if (datasz != 4)
0519c2
+		    printf (_("x86 ISA needed: <corrupt length: %#x> "),
0519c2
+			    datasz);
0519c2
+		  else
0519c2
+		    {
0519c2
+		      printf ("x86 ISA needed: ");
0519c2
+		      decode_x86_compat_isa (bitmask);
0519c2
+		    }
0519c2
 		  goto next;
0519c2
 
0519c2
 		default:
0519c2
@@ -17144,7 +17387,7 @@ print_gnu_note (Filedata * filedata, Elf
0519c2
     case NT_GNU_PROPERTY_TYPE_0:
0519c2
       print_gnu_property_note (filedata, pnote);
0519c2
       break;
0519c2
-      
0519c2
+
0519c2
     default:
0519c2
       /* Handle unrecognised types.  An error message should have already been
0519c2
 	 created by get_gnu_elf_note_type(), so all that we need to do is to
0519c2
diff -rup binutils.orig/binutils/testsuite/binutils-all/i386/empty.d binutils-2.30/binutils/testsuite/binutils-all/i386/empty.d
0519c2
--- binutils.orig/binutils/testsuite/binutils-all/i386/empty.d	2020-04-07 11:32:17.248776609 +0100
0519c2
+++ binutils-2.30/binutils/testsuite/binutils-all/i386/empty.d	2020-04-07 13:34:03.901784074 +0100
0519c2
@@ -6,4 +6,4 @@
0519c2
 Displaying notes found in: .note.gnu.property
0519c2
   Owner                 Data size	Description
0519c2
   GNU                  0x0000000c	NT_GNU_PROPERTY_TYPE_0
0519c2
-      Properties: x86 feature: 
0519c2
+      Properties: x86 feature: <None>
0519c2
diff -rup binutils.orig/binutils/testsuite/binutils-all/i386/pr21231b.d binutils-2.30/binutils/testsuite/binutils-all/i386/pr21231b.d
0519c2
--- binutils.orig/binutils/testsuite/binutils-all/i386/pr21231b.d	2020-04-07 11:32:17.248776609 +0100
0519c2
+++ binutils-2.30/binutils/testsuite/binutils-all/i386/pr21231b.d	2020-04-07 13:34:03.901784074 +0100
0519c2
@@ -1,5 +1,5 @@
0519c2
 #PROG: objcopy
0519c2
-#as: --32
0519c2
+#as: --32 -mx86-used-note=yes
0519c2
 #objcopy:
0519c2
 #readelf: -n
0519c2
 
0519c2
@@ -8,5 +8,8 @@ Displaying notes found in: .note.gnu.pro
0519c2
   GNU                  0x0000002c	NT_GNU_PROPERTY_TYPE_0
0519c2
       Properties: stack size: 0x800000
0519c2
 	no copy on protected 
0519c2
-	x86 ISA used: i486, 586, 686, SSE, SSE2, SSE3, SSSE3, SSE4_1, SSE4_2, AVX, AVX2, AVX512F, AVX512CD, AVX512ER, AVX512PF, AVX512VL, AVX512DQ, AVX512BW, <unknown: 40000>, <unknown: 80000>, <unknown: 100000>, <unknown: 200000>, <unknown: 400000>, <unknown: 800000>, <unknown: 1000000>, <unknown: 2000000>, <unknown: 4000000>, <unknown: 8000000>, <unknown: 10000000>, <unknown: 20000000>, <unknown: 40000000>, <unknown: 80000000>
0519c2
-	x86 ISA needed: i486, 586, 686, SSE, SSE2, SSE3, SSSE3, SSE4_1, SSE4_2, AVX, AVX2, AVX512F, AVX512CD, AVX512ER, AVX512PF, AVX512VL
0519c2
+	x86 ISA used: CMOV, SSE, SSE2, SSE3, SSSE3, SSE4_1, SSE4_2, AVX, AVX2, FMA, AVX512F, AVX512CD, AVX512ER, AVX512PF, AVX512VL, AVX512DQ, AVX512BW, AVX512_4FMAPS, AVX512_4VNNIW, AVX512_BITALG, AVX512_IFMA, AVX512_VBMI, AVX512_VBMI2, AVX512_VNNI, AVX512_BF16, <unknown: 2000000>, <unknown: 4000000>, <unknown: 8000000>, <unknown: 10000000>, <unknown: 20000000>, <unknown: 40000000>
0519c2
+	x86 ISA needed: CMOV, SSE, SSE2, SSE3, SSSE3, SSE4_1, SSE4_2, AVX, AVX2, FMA, AVX512F, AVX512CD, AVX512ER, AVX512PF, AVX512VL, AVX512DQ
0519c2
+  GNU                  0x00000018	NT_GNU_PROPERTY_TYPE_0
0519c2
+      Properties: x86 ISA used: <None>
0519c2
+	x86 feature used: x86
0519c2
diff -rup binutils.orig/binutils/testsuite/binutils-all/i386/pr21231b.s binutils-2.30/binutils/testsuite/binutils-all/i386/pr21231b.s
0519c2
--- binutils.orig/binutils/testsuite/binutils-all/i386/pr21231b.s	2020-04-07 11:32:17.248776609 +0100
0519c2
+++ binutils-2.30/binutils/testsuite/binutils-all/i386/pr21231b.s	2020-04-07 13:34:03.902784067 +0100
0519c2
@@ -19,14 +19,14 @@
0519c2
 	.long 0			/* pr_datasz.  */
0519c2
 	.p2align 2
0519c2
 	/* GNU_PROPERTY_X86_ISA_1_USED */
0519c2
-	.long 0xc0000000	/* pr_type.  */
0519c2
+	.long 0xc0010000	/* pr_type.  */
0519c2
 	.long 4f - 3f		/* pr_datasz.  */
0519c2
 3:
0519c2
-	.long -1
0519c2
+	.long 0x7fffffff
0519c2
 4:
0519c2
 	.p2align 2
0519c2
 	/* GNU_PROPERTY_X86_ISA_1_NEEDED */
0519c2
-	.long 0xc0000001	/* pr_type.  */
0519c2
+	.long 0xc0008000	/* pr_type.  */
0519c2
 	.long 4f - 3f		/* pr_datasz.  */
0519c2
 3:
0519c2
 	.long 0xffff
0519c2
diff -rup binutils.orig/binutils/testsuite/binutils-all/x86-64/empty-x32.d binutils-2.30/binutils/testsuite/binutils-all/x86-64/empty-x32.d
0519c2
--- binutils.orig/binutils/testsuite/binutils-all/x86-64/empty-x32.d	2020-04-07 11:32:17.250776595 +0100
0519c2
+++ binutils-2.30/binutils/testsuite/binutils-all/x86-64/empty-x32.d	2020-04-07 13:34:03.902784067 +0100
0519c2
@@ -7,4 +7,4 @@
0519c2
 Displaying notes found in: .note.gnu.property
0519c2
   Owner                 Data size	Description
0519c2
   GNU                  0x0000000c	NT_GNU_PROPERTY_TYPE_0
0519c2
-      Properties: x86 feature: 
0519c2
+      Properties: x86 feature: <None>
0519c2
diff -rup binutils.orig/binutils/testsuite/binutils-all/x86-64/empty.d binutils-2.30/binutils/testsuite/binutils-all/x86-64/empty.d
0519c2
--- binutils.orig/binutils/testsuite/binutils-all/x86-64/empty.d	2020-04-07 11:32:17.250776595 +0100
0519c2
+++ binutils-2.30/binutils/testsuite/binutils-all/x86-64/empty.d	2020-04-07 13:34:03.902784067 +0100
0519c2
@@ -6,4 +6,4 @@
0519c2
 Displaying notes found in: .note.gnu.property
0519c2
   Owner                 Data size	Description
0519c2
   GNU                  0x00000010	NT_GNU_PROPERTY_TYPE_0
0519c2
-      Properties: x86 feature: 
0519c2
+      Properties: x86 feature: <None>
0519c2
diff -rup binutils.orig/binutils/testsuite/binutils-all/x86-64/pr21231b.d binutils-2.30/binutils/testsuite/binutils-all/x86-64/pr21231b.d
0519c2
--- binutils.orig/binutils/testsuite/binutils-all/x86-64/pr21231b.d	2020-04-07 11:32:17.250776595 +0100
0519c2
+++ binutils-2.30/binutils/testsuite/binutils-all/x86-64/pr21231b.d	2020-04-07 13:34:03.902784067 +0100
0519c2
@@ -1,5 +1,5 @@
0519c2
 #PROG: objcopy
0519c2
-#as: --64
0519c2
+#as: --64 -mx86-used-note=yes
0519c2
 #objcopy:
0519c2
 #readelf: -n
0519c2
 
0519c2
@@ -8,5 +8,8 @@ Displaying notes found in: .note.gnu.pro
0519c2
   GNU                  0x00000038	NT_GNU_PROPERTY_TYPE_0
0519c2
       Properties: stack size: 0x800000
0519c2
 	no copy on protected 
0519c2
-	x86 ISA used: i486, 586, 686, SSE, SSE2, SSE3, SSSE3, SSE4_1, SSE4_2, AVX, AVX2, AVX512F, AVX512CD, AVX512ER, AVX512PF, AVX512VL, AVX512DQ, AVX512BW, <unknown: 40000>, <unknown: 80000>, <unknown: 100000>, <unknown: 200000>, <unknown: 400000>, <unknown: 800000>, <unknown: 1000000>, <unknown: 2000000>, <unknown: 4000000>, <unknown: 8000000>, <unknown: 10000000>, <unknown: 20000000>, <unknown: 40000000>, <unknown: 80000000>
0519c2
-	x86 ISA needed: i486, 586, 686, SSE, SSE2, SSE3, SSSE3, SSE4_1, SSE4_2, AVX, AVX2, AVX512F, AVX512CD, AVX512ER, AVX512PF, AVX512VL
0519c2
+	x86 ISA used: CMOV, SSE, SSE2, SSE3, SSSE3, SSE4_1, SSE4_2, AVX, AVX2, FMA, AVX512F, AVX512CD, AVX512ER, AVX512PF, AVX512VL, AVX512DQ, AVX512BW, AVX512_4FMAPS, AVX512_4VNNIW, AVX512_BITALG, AVX512_IFMA, AVX512_VBMI, AVX512_VBMI2, AVX512_VNNI, AVX512_BF16, <unknown: 2000000>, <unknown: 4000000>, <unknown: 8000000>, <unknown: 10000000>, <unknown: 20000000>, <unknown: 40000000>
0519c2
+	x86 ISA needed: CMOV, SSE, SSE2, SSE3, SSSE3, SSE4_1, SSE4_2, AVX, AVX2, FMA, AVX512F, AVX512CD, AVX512ER, AVX512PF, AVX512VL, AVX512DQ
0519c2
+  GNU                  0x00000020	NT_GNU_PROPERTY_TYPE_0
0519c2
+      Properties: x86 ISA used: <None>
0519c2
+	x86 feature used: x86
0519c2
diff -rup binutils.orig/binutils/testsuite/binutils-all/x86-64/pr21231b.s binutils-2.30/binutils/testsuite/binutils-all/x86-64/pr21231b.s
0519c2
--- binutils.orig/binutils/testsuite/binutils-all/x86-64/pr21231b.s	2020-04-07 11:32:17.250776595 +0100
0519c2
+++ binutils-2.30/binutils/testsuite/binutils-all/x86-64/pr21231b.s	2020-04-07 13:34:03.902784067 +0100
0519c2
@@ -19,14 +19,14 @@
0519c2
 	.long 0			/* pr_datasz.  */
0519c2
 	.p2align 3
0519c2
 	/* GNU_PROPERTY_X86_ISA_1_USED */
0519c2
-	.long 0xc0000000	/* pr_type.  */
0519c2
+	.long 0xc0010000	/* pr_type.  */
0519c2
 	.long 4f - 3f		/* pr_datasz.  */
0519c2
 3:
0519c2
-	.long -1
0519c2
+	.long 0x7fffffff
0519c2
 4:
0519c2
 	.p2align 3
0519c2
 	/* GNU_PROPERTY_X86_ISA_1_NEEDED */
0519c2
-	.long 0xc0000001	/* pr_type.  */
0519c2
+	.long 0xc0008000	/* pr_type.  */
0519c2
 	.long 4f - 3f		/* pr_datasz.  */
0519c2
 3:
0519c2
 	.long 0xffff
0519c2
diff -rup binutils.orig/gas/config/tc-i386.c binutils-2.30/gas/config/tc-i386.c
0519c2
--- binutils.orig/gas/config/tc-i386.c	2020-04-07 11:32:17.528774573 +0100
0519c2
+++ binutils-2.30/gas/config/tc-i386.c	2020-04-07 13:36:05.123911315 +0100
0519c2
@@ -191,6 +191,13 @@ static void s_bss (int);
0519c2
 #endif
0519c2
 #if defined (OBJ_ELF) || defined (OBJ_MAYBE_ELF)
0519c2
 static void handle_large_common (int small ATTRIBUTE_UNUSED);
0519c2
+
0519c2
+/* GNU_PROPERTY_X86_ISA_1_USED.  */
0519c2
+static unsigned int x86_isa_1_used;
0519c2
+/* GNU_PROPERTY_X86_FEATURE_2_USED.  */
0519c2
+static unsigned int x86_feature_2_used;
0519c2
+/* Generate x86 used ISA and feature properties.  */
0519c2
+static unsigned int x86_used_note = DEFAULT_X86_USED_NOTE;
0519c2
 #endif
0519c2
 
0519c2
 static const char *default_arch = DEFAULT_ARCH;
0519c2
@@ -7421,6 +7428,127 @@ encoding_length (const fragS *start_frag
0519c2
   return len - start_off + (frag_now_ptr - frag_now->fr_literal);
0519c2
 }
0519c2
 
0519c2
+#if defined (OBJ_ELF) || defined (OBJ_MAYBE_ELF)
0519c2
+void
0519c2
+x86_cleanup (void)
0519c2
+{
0519c2
+  char *p;
0519c2
+  asection *seg = now_seg;
0519c2
+  subsegT subseg = now_subseg;
0519c2
+  asection *sec;
0519c2
+  unsigned int alignment, align_size_1;
0519c2
+  unsigned int isa_1_descsz, feature_2_descsz, descsz;
0519c2
+  unsigned int isa_1_descsz_raw, feature_2_descsz_raw;
0519c2
+  unsigned int padding;
0519c2
+
0519c2
+  if (!IS_ELF || !x86_used_note)
0519c2
+    return;
0519c2
+
0519c2
+  x86_feature_2_used |= GNU_PROPERTY_X86_FEATURE_2_X86;
0519c2
+
0519c2
+  /* The .note.gnu.property section layout:
0519c2
+
0519c2
+     Field	Length		Contents
0519c2
+     ----	----		----
0519c2
+     n_namsz	4		4
0519c2
+     n_descsz	4		The note descriptor size
0519c2
+     n_type	4		NT_GNU_PROPERTY_TYPE_0
0519c2
+     n_name	4		"GNU"
0519c2
+     n_desc	n_descsz	The program property array
0519c2
+     ....	....		....
0519c2
+   */
0519c2
+
0519c2
+  /* Create the .note.gnu.property section.  */
0519c2
+  sec = subseg_new (NOTE_GNU_PROPERTY_SECTION_NAME, 0);
0519c2
+  bfd_set_section_flags (stdoutput, sec,
0519c2
+			 (SEC_ALLOC
0519c2
+			  | SEC_LOAD
0519c2
+			  | SEC_DATA
0519c2
+			  | SEC_HAS_CONTENTS
0519c2
+			  | SEC_READONLY));
0519c2
+
0519c2
+  if (get_elf_backend_data (stdoutput)->s->elfclass == ELFCLASS64)
0519c2
+    {
0519c2
+      align_size_1 = 7;
0519c2
+      alignment = 3;
0519c2
+    }
0519c2
+  else
0519c2
+    {
0519c2
+      align_size_1 = 3;
0519c2
+      alignment = 2;
0519c2
+    }
0519c2
+
0519c2
+  bfd_set_section_alignment (stdoutput, sec, alignment);
0519c2
+  elf_section_type (sec) = SHT_NOTE;
0519c2
+
0519c2
+  /* GNU_PROPERTY_X86_ISA_1_USED: 4-byte type + 4-byte data size
0519c2
+				  + 4-byte data  */
0519c2
+  isa_1_descsz_raw = 4 + 4 + 4;
0519c2
+  /* Align GNU_PROPERTY_X86_ISA_1_USED.  */
0519c2
+  isa_1_descsz = (isa_1_descsz_raw + align_size_1) & ~align_size_1;
0519c2
+
0519c2
+  feature_2_descsz_raw = isa_1_descsz;
0519c2
+  /* GNU_PROPERTY_X86_FEATURE_2_USED: 4-byte type + 4-byte data size
0519c2
+				      + 4-byte data  */
0519c2
+  feature_2_descsz_raw += 4 + 4 + 4;
0519c2
+  /* Align GNU_PROPERTY_X86_FEATURE_2_USED.  */
0519c2
+  feature_2_descsz = ((feature_2_descsz_raw + align_size_1)
0519c2
+		      & ~align_size_1);
0519c2
+
0519c2
+  descsz = feature_2_descsz;
0519c2
+  /* Section size: n_namsz + n_descsz + n_type + n_name + n_descsz.  */
0519c2
+  p = frag_more (4 + 4 + 4 + 4 + descsz);
0519c2
+
0519c2
+  /* Write n_namsz.  */
0519c2
+  md_number_to_chars (p, (valueT) 4, 4);
0519c2
+
0519c2
+  /* Write n_descsz.  */
0519c2
+  md_number_to_chars (p + 4, (valueT) descsz, 4);
0519c2
+
0519c2
+  /* Write n_type.  */
0519c2
+  md_number_to_chars (p + 4 * 2, (valueT) NT_GNU_PROPERTY_TYPE_0, 4);
0519c2
+
0519c2
+  /* Write n_name.  */
0519c2
+  memcpy (p + 4 * 3, "GNU", 4);
0519c2
+
0519c2
+  /* Write 4-byte type.  */
0519c2
+  md_number_to_chars (p + 4 * 4,
0519c2
+		      (valueT) GNU_PROPERTY_X86_ISA_1_USED, 4);
0519c2
+
0519c2
+  /* Write 4-byte data size.  */
0519c2
+  md_number_to_chars (p + 4 * 5, (valueT) 4, 4);
0519c2
+
0519c2
+  /* Write 4-byte data.  */
0519c2
+  md_number_to_chars (p + 4 * 6, (valueT) x86_isa_1_used, 4);
0519c2
+
0519c2
+  /* Zero out paddings.  */
0519c2
+  padding = isa_1_descsz - isa_1_descsz_raw;
0519c2
+  if (padding)
0519c2
+    memset (p + 4 * 7, 0, padding);
0519c2
+
0519c2
+  /* Write 4-byte type.  */
0519c2
+  md_number_to_chars (p + isa_1_descsz + 4 * 4,
0519c2
+		      (valueT) GNU_PROPERTY_X86_FEATURE_2_USED, 4);
0519c2
+
0519c2
+  /* Write 4-byte data size.  */
0519c2
+  md_number_to_chars (p + isa_1_descsz + 4 * 5, (valueT) 4, 4);
0519c2
+
0519c2
+  /* Write 4-byte data.  */
0519c2
+  md_number_to_chars (p + isa_1_descsz + 4 * 6,
0519c2
+		      (valueT) x86_feature_2_used, 4);
0519c2
+
0519c2
+  /* Zero out paddings.  */
0519c2
+  padding = feature_2_descsz - feature_2_descsz_raw;
0519c2
+  if (padding)
0519c2
+    memset (p + isa_1_descsz + 4 * 7, 0, padding);
0519c2
+
0519c2
+  /* We probably can't restore the current segment, for there likely
0519c2
+     isn't one yet...  */
0519c2
+  if (seg && subseg)
0519c2
+    subseg_set (seg, subseg);
0519c2
+}
0519c2
+#endif
0519c2
+
0519c2
 static void
0519c2
 output_insn (void)
0519c2
 {
0519c2
@@ -7429,6 +7557,99 @@ output_insn (void)
0519c2
   fragS *fragP = NULL;
0519c2
   enum align_branch_kind branch = align_branch_none;
0519c2
 
0519c2
+#if defined (OBJ_ELF) || defined (OBJ_MAYBE_ELF)
0519c2
+  if (IS_ELF && x86_used_note)
0519c2
+    {
0519c2
+#if 0
0519c2
+      if (i.tm.cpu_flags.bitfield.cpucmov)
0519c2
+	x86_isa_1_used |= GNU_PROPERTY_X86_ISA_1_CMOV;
0519c2
+#endif
0519c2
+      if (i.tm.cpu_flags.bitfield.cpusse)
0519c2
+	x86_isa_1_used |= GNU_PROPERTY_X86_ISA_1_SSE;
0519c2
+      if (i.tm.cpu_flags.bitfield.cpusse2)
0519c2
+	x86_isa_1_used |= GNU_PROPERTY_X86_ISA_1_SSE2;
0519c2
+      if (i.tm.cpu_flags.bitfield.cpusse3)
0519c2
+	x86_isa_1_used |= GNU_PROPERTY_X86_ISA_1_SSE3;
0519c2
+      if (i.tm.cpu_flags.bitfield.cpussse3)
0519c2
+	x86_isa_1_used |= GNU_PROPERTY_X86_ISA_1_SSSE3;
0519c2
+      if (i.tm.cpu_flags.bitfield.cpusse4_1)
0519c2
+	x86_isa_1_used |= GNU_PROPERTY_X86_ISA_1_SSE4_1;
0519c2
+      if (i.tm.cpu_flags.bitfield.cpusse4_2)
0519c2
+	x86_isa_1_used |= GNU_PROPERTY_X86_ISA_1_SSE4_2;
0519c2
+      if (i.tm.cpu_flags.bitfield.cpuavx)
0519c2
+	x86_isa_1_used |= GNU_PROPERTY_X86_ISA_1_AVX;
0519c2
+      if (i.tm.cpu_flags.bitfield.cpuavx2)
0519c2
+	x86_isa_1_used |= GNU_PROPERTY_X86_ISA_1_AVX2;
0519c2
+      if (i.tm.cpu_flags.bitfield.cpufma)
0519c2
+	x86_isa_1_used |= GNU_PROPERTY_X86_ISA_1_FMA;
0519c2
+      if (i.tm.cpu_flags.bitfield.cpuavx512f)
0519c2
+	x86_isa_1_used |= GNU_PROPERTY_X86_ISA_1_AVX512F;
0519c2
+      if (i.tm.cpu_flags.bitfield.cpuavx512cd)
0519c2
+	x86_isa_1_used |= GNU_PROPERTY_X86_ISA_1_AVX512CD;
0519c2
+      if (i.tm.cpu_flags.bitfield.cpuavx512er)
0519c2
+	x86_isa_1_used |= GNU_PROPERTY_X86_ISA_1_AVX512ER;
0519c2
+      if (i.tm.cpu_flags.bitfield.cpuavx512pf)
0519c2
+	x86_isa_1_used |= GNU_PROPERTY_X86_ISA_1_AVX512PF;
0519c2
+      if (i.tm.cpu_flags.bitfield.cpuavx512vl)
0519c2
+	x86_isa_1_used |= GNU_PROPERTY_X86_ISA_1_AVX512VL;
0519c2
+      if (i.tm.cpu_flags.bitfield.cpuavx512dq)
0519c2
+	x86_isa_1_used |= GNU_PROPERTY_X86_ISA_1_AVX512DQ;
0519c2
+      if (i.tm.cpu_flags.bitfield.cpuavx512bw)
0519c2
+	x86_isa_1_used |= GNU_PROPERTY_X86_ISA_1_AVX512BW;
0519c2
+      if (i.tm.cpu_flags.bitfield.cpuavx512_4fmaps)
0519c2
+	x86_isa_1_used |= GNU_PROPERTY_X86_ISA_1_AVX512_4FMAPS;
0519c2
+      if (i.tm.cpu_flags.bitfield.cpuavx512_4vnniw)
0519c2
+	x86_isa_1_used |= GNU_PROPERTY_X86_ISA_1_AVX512_4VNNIW;
0519c2
+      if (i.tm.cpu_flags.bitfield.cpuavx512_bitalg)
0519c2
+	x86_isa_1_used |= GNU_PROPERTY_X86_ISA_1_AVX512_BITALG;
0519c2
+      if (i.tm.cpu_flags.bitfield.cpuavx512ifma)
0519c2
+	x86_isa_1_used |= GNU_PROPERTY_X86_ISA_1_AVX512_IFMA;
0519c2
+      if (i.tm.cpu_flags.bitfield.cpuavx512vbmi)
0519c2
+	x86_isa_1_used |= GNU_PROPERTY_X86_ISA_1_AVX512_VBMI;
0519c2
+      if (i.tm.cpu_flags.bitfield.cpuavx512_vbmi2)
0519c2
+	x86_isa_1_used |= GNU_PROPERTY_X86_ISA_1_AVX512_VBMI2;
0519c2
+      if (i.tm.cpu_flags.bitfield.cpuavx512_vnni)
0519c2
+	x86_isa_1_used |= GNU_PROPERTY_X86_ISA_1_AVX512_VNNI;
0519c2
+#if 0
0519c2
+      if (i.tm.cpu_flags.bitfield.cpuavx512_bf16)
0519c2
+	x86_isa_1_used |= GNU_PROPERTY_X86_ISA_1_AVX512_BF16;
0519c2
+#endif
0519c2
+
0519c2
+      if (i.tm.cpu_flags.bitfield.cpu8087
0519c2
+	  || i.tm.cpu_flags.bitfield.cpu287
0519c2
+	  || i.tm.cpu_flags.bitfield.cpu387
0519c2
+	  || i.tm.cpu_flags.bitfield.cpu687
0519c2
+	  || i.tm.cpu_flags.bitfield.cpufisttp)
0519c2
+	x86_feature_2_used |= GNU_PROPERTY_X86_FEATURE_2_X87;
0519c2
+#if 0
0519c2
+      /* Don't set GNU_PROPERTY_X86_FEATURE_2_MMX for prefetchtXXX nor
0519c2
+	 Xfence instructions.  */
0519c2
+      if (i.tm.base_opcode != 0xf18
0519c2
+	  && i.tm.base_opcode != 0xf0d
0519c2
+	  && i.tm.base_opcode != 0xfae
0519c2
+	  && (i.has_regmmx
0519c2
+	      || i.tm.cpu_flags.bitfield.cpummx
0519c2
+	      || i.tm.cpu_flags.bitfield.cpua3dnow
0519c2
+	      || i.tm.cpu_flags.bitfield.cpua3dnowa))
0519c2
+	x86_feature_2_used |= GNU_PROPERTY_X86_FEATURE_2_MMX;
0519c2
+      if (i.has_regxmm)
0519c2
+	x86_feature_2_used |= GNU_PROPERTY_X86_FEATURE_2_XMM;
0519c2
+      if (i.has_regymm)
0519c2
+	x86_feature_2_used |= GNU_PROPERTY_X86_FEATURE_2_YMM;
0519c2
+      if (i.has_regzmm)
0519c2
+	x86_feature_2_used |= GNU_PROPERTY_X86_FEATURE_2_ZMM;
0519c2
+      if (i.tm.cpu_flags.bitfield.cpufxsr)
0519c2
+	x86_feature_2_used |= GNU_PROPERTY_X86_FEATURE_2_FXSR;
0519c2
+#endif
0519c2
+      if (i.tm.cpu_flags.bitfield.cpuxsave)
0519c2
+	x86_feature_2_used |= GNU_PROPERTY_X86_FEATURE_2_XSAVE;
0519c2
+      if (i.tm.cpu_flags.bitfield.cpuxsaveopt)
0519c2
+	x86_feature_2_used |= GNU_PROPERTY_X86_FEATURE_2_XSAVEOPT;
0519c2
+      if (i.tm.cpu_flags.bitfield.cpuxsavec)
0519c2
+	x86_feature_2_used |= GNU_PROPERTY_X86_FEATURE_2_XSAVEC;
0519c2
+    }
0519c2
+#endif
0519c2
+
0519c2
   /* Tie dwarf2 debug info to the address at the start of the insn.
0519c2
      We can't do this after the insn has been output as the current
0519c2
      frag may have been closed off.  eg. by frag_var.  */
0519c2
@@ -10829,6 +11050,7 @@ const char *md_shortopts = "qn";
0519c2
 #define OPTION_MALIGN_BRANCH_PREFIX_SIZE (OPTION_MD_BASE + 28)
0519c2
 #define OPTION_MALIGN_BRANCH (OPTION_MD_BASE + 29)
0519c2
 #define OPTION_MBRANCHES_WITH_32B_BOUNDARIES (OPTION_MD_BASE + 30)
0519c2
+#define OPTION_X86_USED_NOTE (OPTION_MD_BASE + 31)
0519c2
 
0519c2
 struct option md_longopts[] =
0519c2
 {
0519c2
@@ -10840,6 +11062,7 @@ struct option md_longopts[] =
0519c2
 #if defined (OBJ_ELF) || defined (OBJ_MAYBE_ELF)
0519c2
   {"x32", no_argument, NULL, OPTION_X32},
0519c2
   {"mshared", no_argument, NULL, OPTION_MSHARED},
0519c2
+  {"mx86-used-note", required_argument, NULL, OPTION_X86_USED_NOTE},
0519c2
 #endif
0519c2
   {"divide", no_argument, NULL, OPTION_DIVIDE},
0519c2
   {"march", required_argument, NULL, OPTION_MARCH},
0519c2
@@ -10957,6 +11180,15 @@ md_parse_option (int c, const char *arg)
0519c2
       else
0519c2
 	as_fatal (_("32bit x86_64 is only supported for ELF"));
0519c2
       break;
0519c2
+
0519c2
+    case OPTION_X86_USED_NOTE:
0519c2
+      if (strcasecmp (arg, "yes") == 0)
0519c2
+        x86_used_note = 1;
0519c2
+      else if (strcasecmp (arg, "no") == 0)
0519c2
+        x86_used_note = 0;
0519c2
+      else
0519c2
+        as_fatal (_("invalid -mx86-used-note= option: `%s'"), arg);
0519c2
+      break;
0519c2
 #endif
0519c2
 
0519c2
     case OPTION_32:
0519c2
@@ -11448,6 +11680,14 @@ md_show_usage (FILE *stream)
0519c2
 #if defined (OBJ_ELF) || defined (OBJ_MAYBE_ELF)
0519c2
   fprintf (stream, _("\
0519c2
   -s                      ignored\n"));
0519c2
+  fprintf (stream, _("\
0519c2
+  -mx86-used-note=[no|yes] "));
0519c2
+  if (DEFAULT_X86_USED_NOTE)
0519c2
+    fprintf (stream, _("(default: yes)\n"));
0519c2
+  else
0519c2
+    fprintf (stream, _("(default: no)\n"));
0519c2
+  fprintf (stream, _("\
0519c2
+                          generate x86 used ISA and feature properties\n"));
0519c2
 #endif
0519c2
 #if (defined (OBJ_ELF) || defined (OBJ_MAYBE_ELF) \
0519c2
      || defined (TE_PE) || defined (TE_PEP))
0519c2
diff -rup binutils.orig/gas/config/tc-i386.h binutils-2.30/gas/config/tc-i386.h
0519c2
--- binutils.orig/gas/config/tc-i386.h	2020-04-07 11:32:17.526774588 +0100
0519c2
+++ binutils-2.30/gas/config/tc-i386.h	2020-04-07 13:34:03.904784053 +0100
0519c2
@@ -346,6 +346,11 @@ extern bfd_vma x86_64_section_letter (in
0519c2
 #define md_elf_section_letter(LETTER, PTR_MSG)	x86_64_section_letter (LETTER, PTR_MSG)
0519c2
 #define md_elf_section_word(STR, LEN)		x86_64_section_word (STR, LEN)
0519c2
 
0519c2
+#if defined (OBJ_ELF) || defined (OBJ_MAYBE_ELF)
0519c2
+extern void x86_cleanup (void);
0519c2
+#define md_cleanup() x86_cleanup ()
0519c2
+#endif
0519c2
+
0519c2
 #ifdef TE_PE
0519c2
 
0519c2
 #define O_secrel O_md1
0519c2
diff -rup binutils.orig/gas/config.in binutils-2.30/gas/config.in
0519c2
--- binutils.orig/gas/config.in	2020-04-07 11:32:17.532774544 +0100
0519c2
+++ binutils-2.30/gas/config.in	2020-04-07 13:34:03.904784053 +0100
0519c2
@@ -50,6 +50,10 @@
0519c2
 /* Define to 1 if you want to generate x86 relax relocations by default. */
0519c2
 #undef DEFAULT_GENERATE_X86_RELAX_RELOCATIONS
0519c2
 
0519c2
+/* Define to 1 if you want to generate GNU x86 used ISA and feature properties
0519c2
+   by default. */
0519c2
+#undef DEFAULT_X86_USED_NOTE
0519c2
+
0519c2
 /* Supported emulations. */
0519c2
 #undef EMULATIONS
0519c2
 
0519c2
diff -rup binutils.orig/gas/configure binutils-2.30/gas/configure
0519c2
--- binutils.orig/gas/configure	2020-04-07 11:32:17.519774639 +0100
0519c2
+++ binutils-2.30/gas/configure	2020-04-07 13:34:03.905784046 +0100
0519c2
@@ -772,6 +772,7 @@ enable_compressed_debug_sections
0519c2
 enable_x86_relax_relocations
0519c2
 enable_elf_stt_common
0519c2
 enable_generate_build_notes
0519c2
+enable_x86_used_note
0519c2
 enable_werror
0519c2
 enable_build_warnings
0519c2
 with_cpu
0519c2
@@ -11788,6 +11789,18 @@ if test "${enable_generate_build_notes+s
0519c2
 esac
0519c2
 fi
0519c2
 
0519c2
+# Decide if the x86 ELF assembler should default to generating GNU x86
0519c2
+# used ISA and feature properties.
0519c2
+ac_default_generate_x86_used_note=unset
0519c2
+# Provide a configuration option to override the default.
0519c2
+# Check whether --enable-x86-used-note was given.
0519c2
+if test "${enable_x86_used_note+set}" = set; then :
0519c2
+  enableval=$enable_x86_used_note; case "${enableval}" in
0519c2
+  yes)  ac_default_generate_x86_used_note=1 ;;
0519c2
+  no)   ac_default_generate_x86_used_note=0 ;;
0519c2
+esac
0519c2
+fi
0519c2
+
0519c2
 
0519c2
 using_cgen=no
0519c2
 
0519c2
@@ -12736,6 +12749,14 @@ cat >>confdefs.h <<_ACEOF
0519c2
 #define DEFAULT_GENERATE_BUILD_NOTES $ac_default_generate_build_notes
0519c2
 _ACEOF
0519c2
 
0519c2
+if test ${ac_default_generate_x86_used_note} = unset; then
0519c2
+  ac_default_generate_x86_used_note=0
0519c2
+fi
0519c2
+
0519c2
+cat >>confdefs.h <<_ACEOF
0519c2
+#define DEFAULT_X86_USED_NOTE $ac_default_generate_x86_used_note
0519c2
+_ACEOF
0519c2
+
0519c2
 
0519c2
 if test x$ac_default_compressed_debug_sections = xyes ; then
0519c2
 
0519c2
diff -rup binutils.orig/gas/configure.ac binutils-2.30/gas/configure.ac
0519c2
--- binutils.orig/gas/configure.ac	2020-04-07 11:32:17.533774537 +0100
0519c2
+++ binutils-2.30/gas/configure.ac	2020-04-07 13:34:03.905784046 +0100
0519c2
@@ -113,6 +113,17 @@ AC_ARG_ENABLE(generate_build_notes,
0519c2
   no)   ac_default_generate_build_notes=0 ;;
0519c2
 esac])dnl
0519c2
 
0519c2
+# Decide if the x86 ELF assembler should default to generating GNU x86
0519c2
+# used ISA and feature properties.
0519c2
+ac_default_generate_x86_used_note=unset
0519c2
+# Provide a configuration option to override the default.
0519c2
+AC_ARG_ENABLE(x86-used-note,
0519c2
+	      AS_HELP_STRING([--enable-x86-used-note],
0519c2
+	      [generate GNU x86 used ISA and feature properties]),
0519c2
+[case "${enableval}" in
0519c2
+  yes)  ac_default_generate_x86_used_note=1 ;;
0519c2
+  no)   ac_default_generate_x86_used_note=0 ;;
0519c2
+esac])dnl
0519c2
 
0519c2
 using_cgen=no
0519c2
 
0519c2
@@ -629,6 +640,25 @@ AC_DEFINE_UNQUOTED(DEFAULT_GENERATE_BUIL
0519c2
   [Define to 1 if you want to generate GNU Build attribute notes
0519c2
    by default, if none are contained in the input.])
0519c2
 
0519c2
+if test ${ac_default_generate_x86_used_note} = unset; then
0519c2
+  ac_default_generate_x86_used_note=0
0519c2
+fi
0519c2
+AC_DEFINE_UNQUOTED(DEFAULT_X86_USED_NOTE,
0519c2
+  $ac_default_generate_x86_used_note,
0519c2
+  [Define to 1 if you want to generate GNU x86 used ISA and feature
0519c2
+   properties by default.])
0519c2
+
0519c2
+if test ${ac_default_generate_riscv_attr} = unset; then
0519c2
+    case ${target_os} in
0519c2
+      elf)
0519c2
+	ac_default_generate_riscv_attr=1
0519c2
+	;;
0519c2
+      *)
0519c2
+	ac_default_generate_riscv_attr=0
0519c2
+	;;
0519c2
+  esac
0519c2
+fi
0519c2
+
0519c2
 if test x$ac_default_compressed_debug_sections = xyes ; then
0519c2
   AC_DEFINE(DEFAULT_FLAG_COMPRESS_DEBUG, 1, [Define if you want compressed debug sections by default.])
0519c2
 fi
0519c2
diff -rup binutils.orig/gas/testsuite/gas/i386/i386.exp binutils-2.30/gas/testsuite/gas/i386/i386.exp
0519c2
--- binutils.orig/gas/testsuite/gas/i386/i386.exp	2020-04-07 11:32:17.596774079 +0100
0519c2
+++ binutils-2.30/gas/testsuite/gas/i386/i386.exp	2020-04-07 13:34:03.906784038 +0100
0519c2
@@ -507,6 +507,9 @@ if [expr ([istarget "i*86-*-*"] ||  [ist
0519c2
 	    run_dump_test "align-branch-3"
0519c2
 	}
0519c2
 
0519c2
+	run_dump_test "property-1"
0519c2
+	run_dump_test "property-2"
0519c2
+
0519c2
 	if { [gas_64_check] } then {
0519c2
 	    run_dump_test "att-regs"
0519c2
 	    run_dump_test "intel-regs"
0519c2
diff -rup binutils.orig/include/bfdlink.h binutils-2.30/include/bfdlink.h
0519c2
--- binutils.orig/include/bfdlink.h	2020-04-07 11:32:17.506774733 +0100
0519c2
+++ binutils-2.30/include/bfdlink.h	2020-04-07 13:34:03.906784038 +0100
0519c2
@@ -489,6 +489,9 @@ struct bfd_link_info
0519c2
   /* TRUE if GNU_PROPERTY_X86_FEATURE_1_SHSTK should be generated.  */
0519c2
   unsigned int shstk: 1;
0519c2
 
0519c2
+  /* 0 = > no report, 1 => warn, 2=> error.  */
0519c2
+  unsigned int cet_report: 2;
0519c2
+
0519c2
   /* TRUE if generation of .interp/PT_INTERP should be suppressed.  */
0519c2
   unsigned int nointerp: 1;
0519c2
 
0519c2
diff -rup binutils.orig/include/elf/common.h binutils-2.30/include/elf/common.h
0519c2
--- binutils.orig/include/elf/common.h	2020-04-07 11:32:17.511774697 +0100
0519c2
+++ binutils-2.30/include/elf/common.h	2020-04-07 13:34:03.906784038 +0100
0519c2
@@ -460,6 +460,7 @@
0519c2
 #define PT_SUNW_EH_FRAME PT_GNU_EH_FRAME      /* Solaris uses the same value */
0519c2
 #define PT_GNU_STACK	(PT_LOOS + 0x474e551) /* Stack flags */
0519c2
 #define PT_GNU_RELRO	(PT_LOOS + 0x474e552) /* Read-only after relocation */
0519c2
+#define PT_GNU_PROPERTY	(PT_LOOS + 0x474e553) /* GNU property */
0519c2
 
0519c2
 /* Mbind segments */
0519c2
 #define PT_GNU_MBIND_NUM 4096
0519c2
@@ -740,31 +741,96 @@
0519c2
 /* Application-specific semantics, hi */
0519c2
 #define GNU_PROPERTY_HIUSER  0xffffffff
0519c2
 
0519c2
-#define GNU_PROPERTY_X86_ISA_1_USED		0xc0000000
0519c2
-#define GNU_PROPERTY_X86_ISA_1_NEEDED		0xc0000001
0519c2
-#define GNU_PROPERTY_X86_FEATURE_1_AND		0xc0000002
0519c2
-
0519c2
-#define GNU_PROPERTY_X86_ISA_1_486           (1U << 0)
0519c2
-#define GNU_PROPERTY_X86_ISA_1_586           (1U << 1)
0519c2
-#define GNU_PROPERTY_X86_ISA_1_686           (1U << 2)
0519c2
-#define GNU_PROPERTY_X86_ISA_1_SSE           (1U << 3)
0519c2
-#define GNU_PROPERTY_X86_ISA_1_SSE2          (1U << 4)
0519c2
-#define GNU_PROPERTY_X86_ISA_1_SSE3          (1U << 5)
0519c2
-#define GNU_PROPERTY_X86_ISA_1_SSSE3         (1U << 6)
0519c2
-#define GNU_PROPERTY_X86_ISA_1_SSE4_1        (1U << 7)
0519c2
-#define GNU_PROPERTY_X86_ISA_1_SSE4_2        (1U << 8)
0519c2
-#define GNU_PROPERTY_X86_ISA_1_AVX           (1U << 9)
0519c2
-#define GNU_PROPERTY_X86_ISA_1_AVX2          (1U << 10)
0519c2
-#define GNU_PROPERTY_X86_ISA_1_AVX512F       (1U << 11)
0519c2
-#define GNU_PROPERTY_X86_ISA_1_AVX512CD      (1U << 12)
0519c2
-#define GNU_PROPERTY_X86_ISA_1_AVX512ER      (1U << 13)
0519c2
-#define GNU_PROPERTY_X86_ISA_1_AVX512PF      (1U << 14)
0519c2
-#define GNU_PROPERTY_X86_ISA_1_AVX512VL      (1U << 15)
0519c2
-#define GNU_PROPERTY_X86_ISA_1_AVX512DQ      (1U << 16)
0519c2
-#define GNU_PROPERTY_X86_ISA_1_AVX512BW      (1U << 17)
0519c2
+#define GNU_PROPERTY_X86_COMPAT_ISA_1_USED	0xc0000000
0519c2
+#define GNU_PROPERTY_X86_COMPAT_ISA_1_NEEDED	0xc0000001
0519c2
 
0519c2
-#define GNU_PROPERTY_X86_FEATURE_1_IBT       (1U << 0)
0519c2
-#define GNU_PROPERTY_X86_FEATURE_1_SHSTK     (1U << 1)
0519c2
+#define GNU_PROPERTY_X86_COMPAT_ISA_1_486	(1U << 0)
0519c2
+#define GNU_PROPERTY_X86_COMPAT_ISA_1_586	(1U << 1)
0519c2
+#define GNU_PROPERTY_X86_COMPAT_ISA_1_686	(1U << 2)
0519c2
+#define GNU_PROPERTY_X86_COMPAT_ISA_1_SSE	(1U << 3)
0519c2
+#define GNU_PROPERTY_X86_COMPAT_ISA_1_SSE2	(1U << 4)
0519c2
+#define GNU_PROPERTY_X86_COMPAT_ISA_1_SSE3	(1U << 5)
0519c2
+#define GNU_PROPERTY_X86_COMPAT_ISA_1_SSSE3	(1U << 6)
0519c2
+#define GNU_PROPERTY_X86_COMPAT_ISA_1_SSE4_1	(1U << 7)
0519c2
+#define GNU_PROPERTY_X86_COMPAT_ISA_1_SSE4_2	(1U << 8)
0519c2
+#define GNU_PROPERTY_X86_COMPAT_ISA_1_AVX	(1U << 9)
0519c2
+#define GNU_PROPERTY_X86_COMPAT_ISA_1_AVX2	(1U << 10)
0519c2
+#define GNU_PROPERTY_X86_COMPAT_ISA_1_AVX512F	(1U << 11)
0519c2
+#define GNU_PROPERTY_X86_COMPAT_ISA_1_AVX512CD	(1U << 12)
0519c2
+#define GNU_PROPERTY_X86_COMPAT_ISA_1_AVX512ER	(1U << 13)
0519c2
+#define GNU_PROPERTY_X86_COMPAT_ISA_1_AVX512PF	(1U << 14)
0519c2
+#define GNU_PROPERTY_X86_COMPAT_ISA_1_AVX512VL	(1U << 15)
0519c2
+#define GNU_PROPERTY_X86_COMPAT_ISA_1_AVX512DQ	(1U << 16)
0519c2
+#define GNU_PROPERTY_X86_COMPAT_ISA_1_AVX512BW	(1U << 17)
0519c2
+
0519c2
+/* A 4-byte unsigned integer property: A bit is set if it is set in all
0519c2
+   relocatable inputs.  */
0519c2
+#define GNU_PROPERTY_X86_UINT32_AND_LO		0xc0000002
0519c2
+#define GNU_PROPERTY_X86_UINT32_AND_HI		0xc0007fff
0519c2
+
0519c2
+/* A 4-byte unsigned integer property: A bit is set if it is set in any
0519c2
+   relocatable inputs.  */
0519c2
+#define GNU_PROPERTY_X86_UINT32_OR_LO		0xc0008000
0519c2
+#define GNU_PROPERTY_X86_UINT32_OR_HI		0xc000ffff
0519c2
+
0519c2
+/* A 4-byte unsigned integer property: A bit is set if it is set in any
0519c2
+   relocatable inputs and the property is present in all relocatable
0519c2
+   inputs.  */
0519c2
+#define GNU_PROPERTY_X86_UINT32_OR_AND_LO	0xc0010000
0519c2
+#define GNU_PROPERTY_X86_UINT32_OR_AND_HI	0xc0017fff
0519c2
+
0519c2
+#define GNU_PROPERTY_X86_FEATURE_1_AND \
0519c2
+  (GNU_PROPERTY_X86_UINT32_AND_LO + 0)
0519c2
+
0519c2
+#define GNU_PROPERTY_X86_ISA_1_NEEDED \
0519c2
+  (GNU_PROPERTY_X86_UINT32_OR_LO + 0)
0519c2
+#define GNU_PROPERTY_X86_FEATURE_2_NEEDED \
0519c2
+  (GNU_PROPERTY_X86_UINT32_OR_LO + 1)
0519c2
+
0519c2
+#define GNU_PROPERTY_X86_ISA_1_USED \
0519c2
+  (GNU_PROPERTY_X86_UINT32_OR_AND_LO + 0)
0519c2
+#define GNU_PROPERTY_X86_FEATURE_2_USED \
0519c2
+  (GNU_PROPERTY_X86_UINT32_OR_AND_LO + 1)
0519c2
+
0519c2
+#define GNU_PROPERTY_X86_FEATURE_1_IBT		(1U << 0)
0519c2
+#define GNU_PROPERTY_X86_FEATURE_1_SHSTK	(1U << 1)
0519c2
+
0519c2
+#define GNU_PROPERTY_X86_ISA_1_CMOV		(1U << 0)
0519c2
+#define GNU_PROPERTY_X86_ISA_1_SSE		(1U << 1)
0519c2
+#define GNU_PROPERTY_X86_ISA_1_SSE2		(1U << 2)
0519c2
+#define GNU_PROPERTY_X86_ISA_1_SSE3		(1U << 3)
0519c2
+#define GNU_PROPERTY_X86_ISA_1_SSSE3		(1U << 4)
0519c2
+#define GNU_PROPERTY_X86_ISA_1_SSE4_1		(1U << 5)
0519c2
+#define GNU_PROPERTY_X86_ISA_1_SSE4_2		(1U << 6)
0519c2
+#define GNU_PROPERTY_X86_ISA_1_AVX		(1U << 7)
0519c2
+#define GNU_PROPERTY_X86_ISA_1_AVX2		(1U << 8)
0519c2
+#define GNU_PROPERTY_X86_ISA_1_FMA		(1U << 9)
0519c2
+#define GNU_PROPERTY_X86_ISA_1_AVX512F		(1U << 10)
0519c2
+#define GNU_PROPERTY_X86_ISA_1_AVX512CD		(1U << 11)
0519c2
+#define GNU_PROPERTY_X86_ISA_1_AVX512ER		(1U << 12)
0519c2
+#define GNU_PROPERTY_X86_ISA_1_AVX512PF		(1U << 13)
0519c2
+#define GNU_PROPERTY_X86_ISA_1_AVX512VL		(1U << 14)
0519c2
+#define GNU_PROPERTY_X86_ISA_1_AVX512DQ		(1U << 15)
0519c2
+#define GNU_PROPERTY_X86_ISA_1_AVX512BW		(1U << 16)
0519c2
+#define GNU_PROPERTY_X86_ISA_1_AVX512_4FMAPS	(1U << 17)
0519c2
+#define GNU_PROPERTY_X86_ISA_1_AVX512_4VNNIW	(1U << 18)
0519c2
+#define GNU_PROPERTY_X86_ISA_1_AVX512_BITALG	(1U << 19)
0519c2
+#define GNU_PROPERTY_X86_ISA_1_AVX512_IFMA	(1U << 20)
0519c2
+#define GNU_PROPERTY_X86_ISA_1_AVX512_VBMI	(1U << 21)
0519c2
+#define GNU_PROPERTY_X86_ISA_1_AVX512_VBMI2	(1U << 22)
0519c2
+#define GNU_PROPERTY_X86_ISA_1_AVX512_VNNI	(1U << 23)
0519c2
+#define GNU_PROPERTY_X86_ISA_1_AVX512_BF16	(1U << 24)
0519c2
+
0519c2
+#define GNU_PROPERTY_X86_FEATURE_2_X86		(1U << 0)
0519c2
+#define GNU_PROPERTY_X86_FEATURE_2_X87		(1U << 1)
0519c2
+#define GNU_PROPERTY_X86_FEATURE_2_MMX		(1U << 2)
0519c2
+#define GNU_PROPERTY_X86_FEATURE_2_XMM		(1U << 3)
0519c2
+#define GNU_PROPERTY_X86_FEATURE_2_YMM		(1U << 4)
0519c2
+#define GNU_PROPERTY_X86_FEATURE_2_ZMM		(1U << 5)
0519c2
+#define GNU_PROPERTY_X86_FEATURE_2_FXSR		(1U << 6)
0519c2
+#define GNU_PROPERTY_X86_FEATURE_2_XSAVE	(1U << 7)
0519c2
+#define GNU_PROPERTY_X86_FEATURE_2_XSAVEOPT	(1U << 8)
0519c2
+#define GNU_PROPERTY_X86_FEATURE_2_XSAVEC	(1U << 9)
0519c2
 
0519c2
 /* Values used in GNU .note.ABI-tag notes (NT_GNU_ABI_TAG).  */
0519c2
 #define GNU_ABI_TAG_LINUX	0
0519c2
diff -rup binutils.orig/ld/emulparams/cet.sh binutils-2.30/ld/emulparams/cet.sh
0519c2
--- binutils.orig/ld/emulparams/cet.sh	2020-04-07 11:32:17.320776086 +0100
0519c2
+++ binutils-2.30/ld/emulparams/cet.sh	2020-04-07 13:34:03.907784031 +0100
0519c2
@@ -2,7 +2,8 @@ PARSE_AND_LIST_OPTIONS_CET='
0519c2
   fprintf (file, _("\
0519c2
   -z ibtplt                   Generate IBT-enabled PLT entries\n\
0519c2
   -z ibt                      Generate GNU_PROPERTY_X86_FEATURE_1_IBT\n\
0519c2
-  -z shstk                    Generate GNU_PROPERTY_X86_FEATURE_1_SHSTK\n"));
0519c2
+  -z shstk                    Generate GNU_PROPERTY_X86_FEATURE_1_SHSTK\n\
0519c2
+  -z cet-report=[none|warning|error] (default: none)\n"));
0519c2
 '
0519c2
 PARSE_AND_LIST_ARGS_CASE_Z_CET='
0519c2
       else if (strcmp (optarg, "ibtplt") == 0)
0519c2
@@ -11,6 +12,18 @@ PARSE_AND_LIST_ARGS_CASE_Z_CET='
0519c2
 	link_info.ibt = TRUE;
0519c2
       else if (strcmp (optarg, "shstk") == 0)
0519c2
 	link_info.shstk = TRUE;
0519c2
+      else if (strncmp (optarg, "cet-report=", 11) == 0)
0519c2
+	{
0519c2
+	  if (strcmp (optarg + 11, "none") == 0)
0519c2
+	    link_info.cet_report = 0;
0519c2
+	  else if (strcmp (optarg + 11, "warning") == 0)
0519c2
+	    link_info.cet_report = 1;
0519c2
+	  else if (strcmp (optarg + 11, "error") == 0)
0519c2
+	    link_info.cet_report = 2;
0519c2
+	  else
0519c2
+	    einfo (_("%F%P: invalid option for -z cet-report=: %s\n"),
0519c2
+		   optarg + 11);
0519c2
+	}
0519c2
 '
0519c2
 
0519c2
 PARSE_AND_LIST_OPTIONS="$PARSE_AND_LIST_OPTIONS $PARSE_AND_LIST_OPTIONS_CET"
0519c2
diff -rup binutils.orig/ld/testsuite/ld-elf/elf.exp binutils-2.30/ld/testsuite/ld-elf/elf.exp
0519c2
--- binutils.orig/ld/testsuite/ld-elf/elf.exp	2020-04-07 11:32:17.454775112 +0100
0519c2
+++ binutils-2.30/ld/testsuite/ld-elf/elf.exp	2020-04-07 13:34:03.907784031 +0100
0519c2
@@ -101,8 +101,10 @@ proc is_elf64 { binary_file } {
0519c2
 
0519c2
 if [is_elf64 tmpdir/symbol3w.a] {
0519c2
     set ASFLAGS "$ASFLAGS --defsym ALIGN=3"
0519c2
+    set pr23900_1_exp "pr23900-1-64.rd"
0519c2
 } else {
0519c2
     set ASFLAGS "$ASFLAGS --defsym ALIGN=2"
0519c2
+    set pr23900_1_exp "pr23900-1-32.rd"
0519c2
 }
0519c2
 
0519c2
 
0519c2
@@ -317,12 +319,36 @@ if { [check_gc_sections_available] && ![
0519c2
 if { [istarget *-*-*linux*]
0519c2
      || [istarget *-*-nacl*]
0519c2
      || [istarget *-*-gnu*] } {
0519c2
-    run_ld_link_tests {
0519c2
-	{"stack exec" "-z execstack" "" "" {stack.s}
0519c2
-	    {{readelf {-Wl} stack-exec.rd}} "stack-exec.exe"}
0519c2
-	{"stack size" "-z stack-size=0x123400" "" "" {stack.s}
0519c2
-	    {{readelf {-Wl} stack-size.rd}} "stack-size.exe"}
0519c2
-    }
0519c2
+    run_ld_link_tests [list \
0519c2
+	[list "stack exec" \
0519c2
+	    "-z execstack" \
0519c2
+	    "" \
0519c2
+	    "" \
0519c2
+	    {stack.s} \
0519c2
+	    {{readelf {-Wl} stack-exec.rd}} \
0519c2
+	    "stack-exec.exe"] \
0519c2
+	[list "stack noexec" \
0519c2
+	    "-z noexecstack" \
0519c2
+	    "" \
0519c2
+	    "" \
0519c2
+	    {stack.s} \
0519c2
+	    {{readelf {-Wl} stack-noexec.rd}} \
0519c2
+	    "stack-noexec.exe"] \
0519c2
+	[list "stack size" \
0519c2
+	    "-z stack-size=0x123400" \
0519c2
+	    "" \
0519c2
+	    "" \
0519c2
+	    {stack.s} \
0519c2
+	    {{readelf {-Wl} stack-size.rd}} \
0519c2
+	    "stack-size.exe"] \
0519c2
+	[list "PT_GNU_PROPERTY alignment" \
0519c2
+	    "" \
0519c2
+	    "" \
0519c2
+	    "" \
0519c2
+	    {pr23900-1.s} \
0519c2
+	    [list [list "readelf" {-Wl} $pr23900_1_exp]] \
0519c2
+	    "pr23900-1.exe"] \
0519c2
+	]
0519c2
 }
0519c2
 
0519c2
 set LDFLAGS $old_ldflags
0519c2
diff -rup binutils.orig/ld/testsuite/ld-i386/ibt-plt-1.d binutils-2.30/ld/testsuite/ld-i386/ibt-plt-1.d
0519c2
--- binutils.orig/ld/testsuite/ld-i386/ibt-plt-1.d	2020-04-07 11:32:17.358775810 +0100
0519c2
+++ binutils-2.30/ld/testsuite/ld-i386/ibt-plt-1.d	2020-04-07 13:34:03.907784031 +0100
0519c2
@@ -1,5 +1,5 @@
0519c2
 #as: --32
0519c2
-#ld: -shared -m elf_i386 --hash-style=sysv
0519c2
+#ld: -shared -m elf_i386 --hash-style=sysv -z noseparate-code
0519c2
 #objdump: -dw
0519c2
 
0519c2
 .*: +file format .*
0519c2
@@ -7,45 +7,45 @@
0519c2
 
0519c2
 Disassembly of section .plt:
0519c2
 
0519c2
-0+1b0 <.plt>:
0519c2
+[a-f0-9]+ <.plt>:
0519c2
  +[a-f0-9]+:	ff b3 04 00 00 00    	pushl  0x4\(%ebx\)
0519c2
  +[a-f0-9]+:	ff a3 08 00 00 00    	jmp    \*0x8\(%ebx\)
0519c2
  +[a-f0-9]+:	0f 1f 40 00          	nopl   0x0\(%eax\)
0519c2
  +[a-f0-9]+:	f3 0f 1e fb          	endbr32 
0519c2
  +[a-f0-9]+:	68 00 00 00 00       	push   \$0x0
0519c2
- +[a-f0-9]+:	e9 e2 ff ff ff       	jmp    1b0 <.plt>
0519c2
+ +[a-f0-9]+:	e9 e2 ff ff ff       	jmp    [a-f0-9]+ <.plt>
0519c2
  +[a-f0-9]+:	66 90                	xchg   %ax,%ax
0519c2
  +[a-f0-9]+:	f3 0f 1e fb          	endbr32 
0519c2
  +[a-f0-9]+:	68 08 00 00 00       	push   \$0x8
0519c2
- +[a-f0-9]+:	e9 d2 ff ff ff       	jmp    1b0 <.plt>
0519c2
+ +[a-f0-9]+:	e9 d2 ff ff ff       	jmp    [a-f0-9]+ <.plt>
0519c2
  +[a-f0-9]+:	66 90                	xchg   %ax,%ax
0519c2
 
0519c2
 Disassembly of section .plt.sec:
0519c2
 
0519c2
-0+1e0 <bar1@plt>:
0519c2
+[a-f0-9]+ <bar1@plt>:
0519c2
  +[a-f0-9]+:	f3 0f 1e fb          	endbr32 
0519c2
  +[a-f0-9]+:	ff a3 0c 00 00 00    	jmp    \*0xc\(%ebx\)
0519c2
  +[a-f0-9]+:	66 0f 1f 44 00 00    	nopw   0x0\(%eax,%eax,1\)
0519c2
 
0519c2
-0+1f0 <bar2@plt>:
0519c2
+[a-f0-9]+ <bar2@plt>:
0519c2
  +[a-f0-9]+:	f3 0f 1e fb          	endbr32 
0519c2
  +[a-f0-9]+:	ff a3 10 00 00 00    	jmp    \*0x10\(%ebx\)
0519c2
  +[a-f0-9]+:	66 0f 1f 44 00 00    	nopw   0x0\(%eax,%eax,1\)
0519c2
 
0519c2
 Disassembly of section .text:
0519c2
 
0519c2
-0+200 <foo>:
0519c2
+[a-f0-9]+ <foo>:
0519c2
  +[a-f0-9]+:	53                   	push   %ebx
0519c2
- +[a-f0-9]+:	e8 18 00 00 00       	call   21e <__x86.get_pc_thunk.bx>
0519c2
- +[a-f0-9]+:	81 c3 36 11 00 00    	add    \$0x1136,%ebx
0519c2
+ +[a-f0-9]+:	e8 18 00 00 00       	call   [a-f0-9]+ <__x86.get_pc_thunk.bx>
0519c2
+ +[a-f0-9]+:	81 c3 ([0-9a-f]{2} ){4}[ 	]+add    \$0x[a-f0-9]+,%ebx
0519c2
  +[a-f0-9]+:	83 ec 08             	sub    \$0x8,%esp
0519c2
- +[a-f0-9]+:	e8 dc ff ff ff       	call   1f0 <bar2@plt>
0519c2
- +[a-f0-9]+:	e8 c7 ff ff ff       	call   1e0 <bar1@plt>
0519c2
+ +[a-f0-9]+:	e8 dc ff ff ff       	call   [a-f0-9]+ <bar2@plt>
0519c2
+ +[a-f0-9]+:	e8 c7 ff ff ff       	call   [a-f0-9]+ <bar1@plt>
0519c2
  +[a-f0-9]+:	83 c4 08             	add    \$0x8,%esp
0519c2
  +[a-f0-9]+:	5b                   	pop    %ebx
0519c2
  +[a-f0-9]+:	c3                   	ret    
0519c2
 
0519c2
-0+21e <__x86.get_pc_thunk.bx>:
0519c2
+[a-f0-9]+ <__x86.get_pc_thunk.bx>:
0519c2
  +[a-f0-9]+:	8b 1c 24             	mov    \(%esp\),%ebx
0519c2
  +[a-f0-9]+:	c3                   	ret    
0519c2
 #pass
0519c2
diff -rup binutils.orig/ld/testsuite/ld-i386/ibt-plt-2a.d binutils-2.30/ld/testsuite/ld-i386/ibt-plt-2a.d
0519c2
--- binutils.orig/ld/testsuite/ld-i386/ibt-plt-2a.d	2020-04-07 11:32:17.361775788 +0100
0519c2
+++ binutils-2.30/ld/testsuite/ld-i386/ibt-plt-2a.d	2020-04-07 13:34:03.907784031 +0100
0519c2
@@ -1,6 +1,6 @@
0519c2
 #source: ibt-plt-2.s
0519c2
 #as: --32
0519c2
-#ld: -shared -m elf_i386 -z ibtplt --hash-style=sysv
0519c2
+#ld: -shared -m elf_i386 -z ibtplt --hash-style=sysv -z noseparate-code
0519c2
 #objdump: -dw
0519c2
 
0519c2
 .*: +file format .*
0519c2
@@ -8,45 +8,45 @@
0519c2
 
0519c2
 Disassembly of section .plt:
0519c2
 
0519c2
-0+1b0 <.plt>:
0519c2
+0+1.0 <.plt>:
0519c2
  +[a-f0-9]+:	ff b3 04 00 00 00    	pushl  0x4\(%ebx\)
0519c2
  +[a-f0-9]+:	ff a3 08 00 00 00    	jmp    \*0x8\(%ebx\)
0519c2
  +[a-f0-9]+:	0f 1f 40 00          	nopl   0x0\(%eax\)
0519c2
  +[a-f0-9]+:	f3 0f 1e fb          	endbr32 
0519c2
  +[a-f0-9]+:	68 00 00 00 00       	push   \$0x0
0519c2
- +[a-f0-9]+:	e9 e2 ff ff ff       	jmp    1b0 <.plt>
0519c2
+ +[a-f0-9]+:	e9 e2 ff ff ff       	jmp    1.0 <.plt>
0519c2
  +[a-f0-9]+:	66 90                	xchg   %ax,%ax
0519c2
  +[a-f0-9]+:	f3 0f 1e fb          	endbr32 
0519c2
  +[a-f0-9]+:	68 08 00 00 00       	push   \$0x8
0519c2
- +[a-f0-9]+:	e9 d2 ff ff ff       	jmp    1b0 <.plt>
0519c2
+ +[a-f0-9]+:	e9 d2 ff ff ff       	jmp    1.0 <.plt>
0519c2
  +[a-f0-9]+:	66 90                	xchg   %ax,%ax
0519c2
 
0519c2
 Disassembly of section .plt.sec:
0519c2
 
0519c2
-0+1e0 <bar1@plt>:
0519c2
+0+1.0 <bar1@plt>:
0519c2
  +[a-f0-9]+:	f3 0f 1e fb          	endbr32 
0519c2
  +[a-f0-9]+:	ff a3 0c 00 00 00    	jmp    \*0xc\(%ebx\)
0519c2
  +[a-f0-9]+:	66 0f 1f 44 00 00    	nopw   0x0\(%eax,%eax,1\)
0519c2
 
0519c2
-0+1f0 <bar2@plt>:
0519c2
+0+1.0 <bar2@plt>:
0519c2
  +[a-f0-9]+:	f3 0f 1e fb          	endbr32 
0519c2
  +[a-f0-9]+:	ff a3 10 00 00 00    	jmp    \*0x10\(%ebx\)
0519c2
  +[a-f0-9]+:	66 0f 1f 44 00 00    	nopw   0x0\(%eax,%eax,1\)
0519c2
 
0519c2
 Disassembly of section .text:
0519c2
 
0519c2
-0+200 <foo>:
0519c2
+0+1.0 <foo>:
0519c2
  +[a-f0-9]+:	53                   	push   %ebx
0519c2
- +[a-f0-9]+:	e8 18 00 00 00       	call   21e <__x86.get_pc_thunk.bx>
0519c2
- +[a-f0-9]+:	81 c3 36 11 00 00    	add    \$0x1136,%ebx
0519c2
+ +[a-f0-9]+:	e8 18 00 00 00       	call   1.e <__x86.get_pc_thunk.bx>
0519c2
+ +[a-f0-9]+:	81 c3 1a 11 00 00    	add    \$0x111a,%ebx
0519c2
  +[a-f0-9]+:	83 ec 08             	sub    \$0x8,%esp
0519c2
- +[a-f0-9]+:	e8 dc ff ff ff       	call   1f0 <bar2@plt>
0519c2
- +[a-f0-9]+:	e8 c7 ff ff ff       	call   1e0 <bar1@plt>
0519c2
+ +[a-f0-9]+:	e8 dc ff ff ff       	call   1.0 <bar2@plt>
0519c2
+ +[a-f0-9]+:	e8 c7 ff ff ff       	call   1.0 <bar1@plt>
0519c2
  +[a-f0-9]+:	83 c4 08             	add    \$0x8,%esp
0519c2
  +[a-f0-9]+:	5b                   	pop    %ebx
0519c2
  +[a-f0-9]+:	c3                   	ret    
0519c2
 
0519c2
-0+21e <__x86.get_pc_thunk.bx>:
0519c2
+0+1.e <__x86.get_pc_thunk.bx>:
0519c2
  +[a-f0-9]+:	8b 1c 24             	mov    \(%esp\),%ebx
0519c2
  +[a-f0-9]+:	c3                   	ret    
0519c2
 #pass
0519c2
diff -rup binutils.orig/ld/testsuite/ld-i386/ibt-plt-2b.d binutils-2.30/ld/testsuite/ld-i386/ibt-plt-2b.d
0519c2
--- binutils.orig/ld/testsuite/ld-i386/ibt-plt-2b.d	2020-04-07 11:32:17.355775832 +0100
0519c2
+++ binutils-2.30/ld/testsuite/ld-i386/ibt-plt-2b.d	2020-04-07 13:34:03.907784031 +0100
0519c2
@@ -1,6 +1,6 @@
0519c2
 #source: ibt-plt-2.s
0519c2
 #as: --32
0519c2
-#ld: -shared -m elf_i386 -z ibtplt --hash-style=sysv
0519c2
+#ld: -shared -m elf_i386 -z ibtplt --hash-style=sysv -z noseparate-code
0519c2
 #readelf: -n -wf
0519c2
 
0519c2
 Contents of the .eh_frame section:
0519c2
@@ -18,37 +18,31 @@ Contents of the .eh_frame section:
0519c2
   DW_CFA_nop
0519c2
   DW_CFA_nop
0519c2
 
0519c2
-0+18 0000001c 0000001c FDE cie=00000000 pc=00000200..0000021e
0519c2
-  DW_CFA_advance_loc: 1 to 00000201
0519c2
+0+18 0000001c 0000001c FDE cie=00000000 pc=000001.0..000001.e
0519c2
+  DW_CFA_advance_loc: 1 to 000001.1
0519c2
   DW_CFA_def_cfa_offset: 8
0519c2
   DW_CFA_offset: r3 \(ebx\) at cfa-8
0519c2
-  DW_CFA_advance_loc: 14 to 0000020f
0519c2
+  DW_CFA_advance_loc: 14 to 000001.f
0519c2
   DW_CFA_def_cfa_offset: 16
0519c2
-  DW_CFA_advance_loc: 13 to 0000021c
0519c2
+  DW_CFA_advance_loc: 13 to 000001.c
0519c2
   DW_CFA_def_cfa_offset: 8
0519c2
-  DW_CFA_advance_loc: 1 to 0000021d
0519c2
+  DW_CFA_advance_loc: 1 to 000001.d
0519c2
   DW_CFA_restore: r3 \(ebx\)
0519c2
   DW_CFA_def_cfa_offset: 4
0519c2
 
0519c2
-0+38 00000010 0000003c FDE cie=00000000 pc=0000021e..00000222
0519c2
+0+38 00000010 0000003c FDE cie=00000000 pc=000001.e..00000..2
0519c2
   DW_CFA_nop
0519c2
   DW_CFA_nop
0519c2
   DW_CFA_nop
0519c2
 
0519c2
-0+4c 00000020 00000050 FDE cie=00000000 pc=000001b0..000001e0
0519c2
+0+4c 00000020 00000050 FDE cie=00000000 pc=000001.0..000001.0
0519c2
   DW_CFA_def_cfa_offset: 8
0519c2
-  DW_CFA_advance_loc: 6 to 000001b6
0519c2
+  DW_CFA_advance_loc: 6 to 000001.6
0519c2
   DW_CFA_def_cfa_offset: 12
0519c2
-  DW_CFA_advance_loc: 10 to 000001c0
0519c2
+  DW_CFA_advance_loc: 10 to 000001.0
0519c2
   DW_CFA_def_cfa_expression \(DW_OP_breg4 \(esp\): 4; DW_OP_breg8 \(eip\): 0; DW_OP_lit15; DW_OP_and; DW_OP_lit9; DW_OP_ge; DW_OP_lit2; DW_OP_shl; DW_OP_plus\)
0519c2
 
0519c2
-0+70 00000010 00000074 FDE cie=00000000 pc=000001e0..00000200
0519c2
+0+70 00000010 00000074 FDE cie=00000000 pc=000001.0..000001.0
0519c2
   DW_CFA_nop
0519c2
   DW_CFA_nop
0519c2
   DW_CFA_nop
0519c2
-
0519c2
-
0519c2
-Displaying notes found in: .note.gnu.property
0519c2
-  Owner                 Data size	Description
0519c2
-  GNU                  0x0000000c	NT_GNU_PROPERTY_TYPE_0
0519c2
-      Properties: x86 feature: 
0519c2
diff -rup binutils.orig/ld/testsuite/ld-i386/ibt-plt-2c.d binutils-2.30/ld/testsuite/ld-i386/ibt-plt-2c.d
0519c2
--- binutils.orig/ld/testsuite/ld-i386/ibt-plt-2c.d	2020-04-07 11:32:17.357775817 +0100
0519c2
+++ binutils-2.30/ld/testsuite/ld-i386/ibt-plt-2c.d	2020-04-07 13:34:03.907784031 +0100
0519c2
@@ -1,6 +1,6 @@
0519c2
 #source: ibt-plt-2.s
0519c2
 #as: --32
0519c2
-#ld: -shared -m elf_i386 -z ibt --hash-style=sysv
0519c2
+#ld: -shared -m elf_i386 -z ibt --hash-style=sysv -z noseparate-code
0519c2
 #objdump: -dw
0519c2
 
0519c2
 .*: +file format .*
0519c2
@@ -8,45 +8,45 @@
0519c2
 
0519c2
 Disassembly of section .plt:
0519c2
 
0519c2
-0+1b0 <.plt>:
0519c2
+[a-f0-9]+ <.plt>:
0519c2
  +[a-f0-9]+:	ff b3 04 00 00 00    	pushl  0x4\(%ebx\)
0519c2
  +[a-f0-9]+:	ff a3 08 00 00 00    	jmp    \*0x8\(%ebx\)
0519c2
  +[a-f0-9]+:	0f 1f 40 00          	nopl   0x0\(%eax\)
0519c2
  +[a-f0-9]+:	f3 0f 1e fb          	endbr32 
0519c2
  +[a-f0-9]+:	68 00 00 00 00       	push   \$0x0
0519c2
- +[a-f0-9]+:	e9 e2 ff ff ff       	jmp    1b0 <.plt>
0519c2
+ +[a-f0-9]+:	e9 e2 ff ff ff       	jmp    [a-f0-9]+ <.plt>
0519c2
  +[a-f0-9]+:	66 90                	xchg   %ax,%ax
0519c2
  +[a-f0-9]+:	f3 0f 1e fb          	endbr32 
0519c2
  +[a-f0-9]+:	68 08 00 00 00       	push   \$0x8
0519c2
- +[a-f0-9]+:	e9 d2 ff ff ff       	jmp    1b0 <.plt>
0519c2
+ +[a-f0-9]+:	e9 d2 ff ff ff       	jmp    [a-f0-9]+ <.plt>
0519c2
  +[a-f0-9]+:	66 90                	xchg   %ax,%ax
0519c2
 
0519c2
 Disassembly of section .plt.sec:
0519c2
 
0519c2
-0+1e0 <bar1@plt>:
0519c2
+[a-f0-9]+ <bar1@plt>:
0519c2
  +[a-f0-9]+:	f3 0f 1e fb          	endbr32 
0519c2
  +[a-f0-9]+:	ff a3 0c 00 00 00    	jmp    \*0xc\(%ebx\)
0519c2
  +[a-f0-9]+:	66 0f 1f 44 00 00    	nopw   0x0\(%eax,%eax,1\)
0519c2
 
0519c2
-0+1f0 <bar2@plt>:
0519c2
+[a-f0-9]+ <bar2@plt>:
0519c2
  +[a-f0-9]+:	f3 0f 1e fb          	endbr32 
0519c2
  +[a-f0-9]+:	ff a3 10 00 00 00    	jmp    \*0x10\(%ebx\)
0519c2
  +[a-f0-9]+:	66 0f 1f 44 00 00    	nopw   0x0\(%eax,%eax,1\)
0519c2
 
0519c2
 Disassembly of section .text:
0519c2
 
0519c2
-0+200 <foo>:
0519c2
+[a-f0-9]+ <foo>:
0519c2
  +[a-f0-9]+:	53                   	push   %ebx
0519c2
- +[a-f0-9]+:	e8 18 00 00 00       	call   21e <__x86.get_pc_thunk.bx>
0519c2
- +[a-f0-9]+:	81 c3 36 11 00 00    	add    \$0x1136,%ebx
0519c2
+ +[a-f0-9]+:	e8 18 00 00 00       	call   [0-9a-f]+ <__x86.get_pc_thunk.bx>
0519c2
+ +[a-f0-9]+:	81 c3 ([0-9a-f]{2} ){4}[ 	]+add    \$0x[a-f0-9]+,%ebx
0519c2
  +[a-f0-9]+:	83 ec 08             	sub    \$0x8,%esp
0519c2
- +[a-f0-9]+:	e8 dc ff ff ff       	call   1f0 <bar2@plt>
0519c2
- +[a-f0-9]+:	e8 c7 ff ff ff       	call   1e0 <bar1@plt>
0519c2
+ +[a-f0-9]+:	e8 dc ff ff ff       	call   [a-f0-9]+ <bar2@plt>
0519c2
+ +[a-f0-9]+:	e8 c7 ff ff ff       	call   [a-f0-9]+ <bar1@plt>
0519c2
  +[a-f0-9]+:	83 c4 08             	add    \$0x8,%esp
0519c2
  +[a-f0-9]+:	5b                   	pop    %ebx
0519c2
  +[a-f0-9]+:	c3                   	ret    
0519c2
 
0519c2
-0+21e <__x86.get_pc_thunk.bx>:
0519c2
+[a-f0-9]+ <__x86.get_pc_thunk.bx>:
0519c2
  +[a-f0-9]+:	8b 1c 24             	mov    \(%esp\),%ebx
0519c2
  +[a-f0-9]+:	c3                   	ret    
0519c2
 #pass
0519c2
diff -rup binutils.orig/ld/testsuite/ld-i386/ibt-plt-2d.d binutils-2.30/ld/testsuite/ld-i386/ibt-plt-2d.d
0519c2
--- binutils.orig/ld/testsuite/ld-i386/ibt-plt-2d.d	2020-04-07 11:32:17.354775839 +0100
0519c2
+++ binutils-2.30/ld/testsuite/ld-i386/ibt-plt-2d.d	2020-04-07 13:34:03.907784031 +0100
0519c2
@@ -1,6 +1,6 @@
0519c2
 #source: ibt-plt-2.s
0519c2
 #as: --32
0519c2
-#ld: -shared -m elf_i386 -z ibt --hash-style=sysv
0519c2
+#ld: -shared -m elf_i386 -z ibt --hash-style=sysv -z noseparate-code
0519c2
 #readelf: -n -wf
0519c2
 
0519c2
 Contents of the .eh_frame section:
0519c2
@@ -18,31 +18,31 @@ Contents of the .eh_frame section:
0519c2
   DW_CFA_nop
0519c2
   DW_CFA_nop
0519c2
 
0519c2
-0+18 0000001c 0000001c FDE cie=00000000 pc=00000200..0000021e
0519c2
-  DW_CFA_advance_loc: 1 to 00000201
0519c2
+0+18 0000001c 0000001c FDE cie=00000000 pc=[a-f0-9]+\.\.[a-f0-9]+
0519c2
+  DW_CFA_advance_loc: 1 to [a-f0-9]+
0519c2
   DW_CFA_def_cfa_offset: 8
0519c2
   DW_CFA_offset: r3 \(ebx\) at cfa-8
0519c2
-  DW_CFA_advance_loc: 14 to 0000020f
0519c2
+  DW_CFA_advance_loc: 14 to [a-f0-9]+
0519c2
   DW_CFA_def_cfa_offset: 16
0519c2
-  DW_CFA_advance_loc: 13 to 0000021c
0519c2
+  DW_CFA_advance_loc: 13 to [a-f0-9]+
0519c2
   DW_CFA_def_cfa_offset: 8
0519c2
-  DW_CFA_advance_loc: 1 to 0000021d
0519c2
+  DW_CFA_advance_loc: 1 to [a-f0-9]+
0519c2
   DW_CFA_restore: r3 \(ebx\)
0519c2
   DW_CFA_def_cfa_offset: 4
0519c2
 
0519c2
-0+38 00000010 0000003c FDE cie=00000000 pc=0000021e..00000222
0519c2
+0+38 00000010 0000003c FDE cie=00000000 pc=[a-f0-9]+\.\.[a-f0-9]+
0519c2
   DW_CFA_nop
0519c2
   DW_CFA_nop
0519c2
   DW_CFA_nop
0519c2
 
0519c2
-0+4c 00000020 00000050 FDE cie=00000000 pc=000001b0..000001e0
0519c2
+0+4c 00000020 00000050 FDE cie=00000000 pc=[a-f0-9]+\.\.[a-f0-9]+
0519c2
   DW_CFA_def_cfa_offset: 8
0519c2
-  DW_CFA_advance_loc: 6 to 000001b6
0519c2
+  DW_CFA_advance_loc: 6 to [a-f0-9]+
0519c2
   DW_CFA_def_cfa_offset: 12
0519c2
-  DW_CFA_advance_loc: 10 to 000001c0
0519c2
+  DW_CFA_advance_loc: 10 to [a-f0-9]+
0519c2
   DW_CFA_def_cfa_expression \(DW_OP_breg4 \(esp\): 4; DW_OP_breg8 \(eip\): 0; DW_OP_lit15; DW_OP_and; DW_OP_lit9; DW_OP_ge; DW_OP_lit2; DW_OP_shl; DW_OP_plus\)
0519c2
 
0519c2
-0+70 00000010 00000074 FDE cie=00000000 pc=000001e0..00000200
0519c2
+0+70 00000010 00000074 FDE cie=00000000 pc=[a-f0-9]+\.\.[a-f0-9]+
0519c2
   DW_CFA_nop
0519c2
   DW_CFA_nop
0519c2
   DW_CFA_nop
0519c2
diff -rup binutils.orig/ld/testsuite/ld-i386/ibt-plt-3d.d binutils-2.30/ld/testsuite/ld-i386/ibt-plt-3d.d
0519c2
--- binutils.orig/ld/testsuite/ld-i386/ibt-plt-3d.d	2020-04-07 11:32:17.364775766 +0100
0519c2
+++ binutils-2.30/ld/testsuite/ld-i386/ibt-plt-3d.d	2020-04-07 13:34:03.907784031 +0100
0519c2
@@ -1,6 +1,6 @@
0519c2
 #source: ibt-plt-3.s
0519c2
 #as: --32
0519c2
-#ld: -shared -m elf_i386 -z ibt --hash-style=sysv
0519c2
+#ld: -shared -m elf_i386 -z ibt --hash-style=sysv -z noseparate-code
0519c2
 #readelf: -wf -n
0519c2
 
0519c2
 Contents of the .eh_frame section:
0519c2
@@ -18,31 +18,31 @@ Contents of the .eh_frame section:
0519c2
   DW_CFA_nop
0519c2
   DW_CFA_nop
0519c2
 
0519c2
-0+18 0000001c 0000001c FDE cie=00000000 pc=00000200..0000021e
0519c2
-  DW_CFA_advance_loc: 1 to 00000201
0519c2
+0+18 0000001c 0000001c FDE cie=00000000 pc=[a-f0-9]+\.\.[a-f0-9]+
0519c2
+  DW_CFA_advance_loc: 1 to [a-f0-9]+
0519c2
   DW_CFA_def_cfa_offset: 8
0519c2
   DW_CFA_offset: r3 \(ebx\) at cfa-8
0519c2
-  DW_CFA_advance_loc: 14 to 0000020f
0519c2
+  DW_CFA_advance_loc: 14 to [a-f0-9]+
0519c2
   DW_CFA_def_cfa_offset: 16
0519c2
-  DW_CFA_advance_loc: 13 to 0000021c
0519c2
+  DW_CFA_advance_loc: 13 to [a-f0-9]+
0519c2
   DW_CFA_def_cfa_offset: 8
0519c2
-  DW_CFA_advance_loc: 1 to 0000021d
0519c2
+  DW_CFA_advance_loc: 1 to [a-f0-9]+
0519c2
   DW_CFA_restore: r3 \(ebx\)
0519c2
   DW_CFA_def_cfa_offset: 4
0519c2
 
0519c2
-0+38 00000010 0000003c FDE cie=00000000 pc=0000021e..00000222
0519c2
+0+38 00000010 0000003c FDE cie=00000000 pc=[a-f0-9]+\.\.[a-f0-9]+
0519c2
   DW_CFA_nop
0519c2
   DW_CFA_nop
0519c2
   DW_CFA_nop
0519c2
 
0519c2
-0+4c 00000020 00000050 FDE cie=00000000 pc=000001b0..000001e0
0519c2
+0+4c 00000020 00000050 FDE cie=00000000 pc=[a-f0-9]+\.\.[a-f0-9]+
0519c2
   DW_CFA_def_cfa_offset: 8
0519c2
-  DW_CFA_advance_loc: 6 to 000001b6
0519c2
+  DW_CFA_advance_loc: 6 to [a-f0-9]+
0519c2
   DW_CFA_def_cfa_offset: 12
0519c2
-  DW_CFA_advance_loc: 10 to 000001c0
0519c2
+  DW_CFA_advance_loc: 10 to [a-f0-9]+
0519c2
   DW_CFA_def_cfa_expression \(DW_OP_breg4 \(esp\): 4; DW_OP_breg8 \(eip\): 0; DW_OP_lit15; DW_OP_and; DW_OP_lit9; DW_OP_ge; DW_OP_lit2; DW_OP_shl; DW_OP_plus\)
0519c2
 
0519c2
-0+70 00000010 00000074 FDE cie=00000000 pc=000001e0..00000200
0519c2
+0+70 00000010 00000074 FDE cie=00000000 pc=[a-f0-9]+\.\.[a-f0-9]+
0519c2
   DW_CFA_nop
0519c2
   DW_CFA_nop
0519c2
   DW_CFA_nop
0519c2
diff -rup binutils.orig/ld/testsuite/ld-i386/pr23372a.d binutils-2.30/ld/testsuite/ld-i386/pr23372a.d
0519c2
--- binutils.orig/ld/testsuite/ld-i386/pr23372a.d	2020-04-07 11:32:17.357775817 +0100
0519c2
+++ binutils-2.30/ld/testsuite/ld-i386/pr23372a.d	2020-04-07 13:34:03.907784031 +0100
0519c2
@@ -3,3 +3,8 @@
0519c2
 #as: --32
0519c2
 #ld: -r -m elf_i386
0519c2
 #readelf: -n
0519c2
+
0519c2
+Displaying notes found in: .note.gnu.property
0519c2
+  Owner                 Data size	Description
0519c2
+  GNU                  0x[0-9a-f]+	NT_GNU_PROPERTY_TYPE_0
0519c2
+      Properties: x86 ISA used: 
0519c2
diff -rup binutils.orig/ld/testsuite/ld-i386/property-x86-ibt3a.d binutils-2.30/ld/testsuite/ld-i386/property-x86-ibt3a.d
0519c2
--- binutils.orig/ld/testsuite/ld-i386/property-x86-ibt3a.d	2020-04-07 11:32:17.358775810 +0100
0519c2
+++ binutils-2.30/ld/testsuite/ld-i386/property-x86-ibt3a.d	2020-04-07 13:34:03.907784031 +0100
0519c2
@@ -6,6 +6,5 @@
0519c2
 
0519c2
 Displaying notes found in: .note.gnu.property
0519c2
   Owner                 Data size	Description
0519c2
-  GNU                  0x00000018	NT_GNU_PROPERTY_TYPE_0
0519c2
-      Properties: x86 ISA used: i486, 586, SSE2, SSE3
0519c2
-	x86 ISA needed: 586, SSE, SSE3, SSE4_1
0519c2
+  GNU                  0x0000000c	NT_GNU_PROPERTY_TYPE_0
0519c2
+      Properties: x86 ISA needed: 586, SSE, SSE3, SSE4_1
0519c2
diff -rup binutils.orig/ld/testsuite/ld-i386/property-x86-ibt3b.d binutils-2.30/ld/testsuite/ld-i386/property-x86-ibt3b.d
0519c2
--- binutils.orig/ld/testsuite/ld-i386/property-x86-ibt3b.d	2020-04-07 11:32:17.353775846 +0100
0519c2
+++ binutils-2.30/ld/testsuite/ld-i386/property-x86-ibt3b.d	2020-04-07 13:34:03.908784024 +0100
0519c2
@@ -6,6 +6,5 @@
0519c2
 
0519c2
 Displaying notes found in: .note.gnu.property
0519c2
   Owner                 Data size	Description
0519c2
-  GNU                  0x00000018	NT_GNU_PROPERTY_TYPE_0
0519c2
-      Properties: x86 ISA used: i486, 586, SSE2, SSE3
0519c2
-	x86 ISA needed: 586, SSE, SSE3, SSE4_1
0519c2
+  GNU                  0x0000000c	NT_GNU_PROPERTY_TYPE_0
0519c2
+      Properties: x86 ISA needed: 586, SSE, SSE3, SSE4_1
0519c2
diff -rup binutils.orig/ld/testsuite/ld-i386/property-x86-shstk3a.d binutils-2.30/ld/testsuite/ld-i386/property-x86-shstk3a.d
0519c2
--- binutils.orig/ld/testsuite/ld-i386/property-x86-shstk3a.d	2020-04-07 11:32:17.355775832 +0100
0519c2
+++ binutils-2.30/ld/testsuite/ld-i386/property-x86-shstk3a.d	2020-04-07 13:34:03.908784024 +0100
0519c2
@@ -6,6 +6,5 @@
0519c2
 
0519c2
 Displaying notes found in: .note.gnu.property
0519c2
   Owner                 Data size	Description
0519c2
-  GNU                  0x00000018	NT_GNU_PROPERTY_TYPE_0
0519c2
-      Properties: x86 ISA used: i486, 586, SSE2, SSE3
0519c2
-	x86 ISA needed: 586, SSE, SSE3, SSE4_1
0519c2
+  GNU                  0x0000000c	NT_GNU_PROPERTY_TYPE_0
0519c2
+      Properties: x86 ISA needed: 586, SSE, SSE3, SSE4_1
0519c2
diff -rup binutils.orig/ld/testsuite/ld-i386/property-x86-shstk3b.d binutils-2.30/ld/testsuite/ld-i386/property-x86-shstk3b.d
0519c2
--- binutils.orig/ld/testsuite/ld-i386/property-x86-shstk3b.d	2020-04-07 11:32:17.362775781 +0100
0519c2
+++ binutils-2.30/ld/testsuite/ld-i386/property-x86-shstk3b.d	2020-04-07 13:34:03.908784024 +0100
0519c2
@@ -6,6 +6,5 @@
0519c2
 
0519c2
 Displaying notes found in: .note.gnu.property
0519c2
   Owner                 Data size	Description
0519c2
-  GNU                  0x00000018	NT_GNU_PROPERTY_TYPE_0
0519c2
-      Properties: x86 ISA used: i486, 586, SSE2, SSE3
0519c2
-	x86 ISA needed: 586, SSE, SSE3, SSE4_1
0519c2
+  GNU                  0x0000000c	NT_GNU_PROPERTY_TYPE_0
0519c2
+      Properties: x86 ISA needed: 586, SSE, SSE3, SSE4_1
0519c2
diff -rup binutils.orig/ld/testsuite/ld-x86-64/ibt-plt-1-x32.d binutils-2.30/ld/testsuite/ld-x86-64/ibt-plt-1-x32.d
0519c2
--- binutils.orig/ld/testsuite/ld-x86-64/ibt-plt-1-x32.d	2020-04-07 11:32:17.432775271 +0100
0519c2
+++ binutils-2.30/ld/testsuite/ld-x86-64/ibt-plt-1-x32.d	2020-04-07 13:34:03.908784024 +0100
0519c2
@@ -1,6 +1,6 @@
0519c2
 #source: ibt-plt-1.s
0519c2
 #as: --x32
0519c2
-#ld: -shared -m elf32_x86_64 --hash-style=sysv
0519c2
+#ld: -shared -m elf32_x86_64 --hash-style=sysv -z max-page-size=0x200000 -z noseparate-code
0519c2
 #objdump: -dw
0519c2
 
0519c2
 .*: +file format .*
0519c2
@@ -8,36 +8,36 @@
0519c2
 
0519c2
 Disassembly of section .plt:
0519c2
 
0519c2
-0+1c0 <.plt>:
0519c2
- +[a-f0-9]+:	ff 35 62 01 20 00    	pushq  0x200162\(%rip\)        # 200328 <_GLOBAL_OFFSET_TABLE_\+0x8>
0519c2
- +[a-f0-9]+:	ff 25 64 01 20 00    	jmpq   \*0x200164\(%rip\)        # 200330 <_GLOBAL_OFFSET_TABLE_\+0x10>
0519c2
+[a-f0-9]+ <.plt>:
0519c2
+ +[a-f0-9]+:	ff 35 ([0-9a-f]{2} ){4}[ 	]+pushq  0x[a-f0-9]+\(%rip\)        # [a-f0-9]+ <_GLOBAL_OFFSET_TABLE_\+0x8>
0519c2
+ +[a-f0-9]+:	ff 25 ([0-9a-f]{2} ){4}[ 	]+jmpq   \*0x[a-f0-9]+\(%rip\)        # [a-f0-9]+ <_GLOBAL_OFFSET_TABLE_\+0x10>
0519c2
  +[a-f0-9]+:	0f 1f 40 00          	nopl   0x0\(%rax\)
0519c2
  +[a-f0-9]+:	f3 0f 1e fa          	endbr64 
0519c2
  +[a-f0-9]+:	68 00 00 00 00       	pushq  \$0x0
0519c2
- +[a-f0-9]+:	e9 e2 ff ff ff       	jmpq   1c0 <.plt>
0519c2
+ +[a-f0-9]+:	e9 e2 ff ff ff       	jmpq   [a-f0-9]+ <.plt>
0519c2
  +[a-f0-9]+:	66 90                	xchg   %ax,%ax
0519c2
  +[a-f0-9]+:	f3 0f 1e fa          	endbr64 
0519c2
  +[a-f0-9]+:	68 01 00 00 00       	pushq  \$0x1
0519c2
- +[a-f0-9]+:	e9 d2 ff ff ff       	jmpq   1c0 <.plt>
0519c2
+ +[a-f0-9]+:	e9 d2 ff ff ff       	jmpq   [a-f0-9]+ <.plt>
0519c2
  +[a-f0-9]+:	66 90                	xchg   %ax,%ax
0519c2
 
0519c2
 Disassembly of section .plt.sec:
0519c2
 
0519c2
-0+1f0 <bar1@plt>:
0519c2
+[a-f0-9]+ <bar1@plt>:
0519c2
  +[a-f0-9]+:	f3 0f 1e fa          	endbr64 
0519c2
- +[a-f0-9]+:	ff 25 3e 01 20 00    	jmpq   \*0x20013e\(%rip\)        # 200338 <bar1>
0519c2
+ +[a-f0-9]+:	ff 25 ([0-9a-f]{2} ){4}[ 	]+jmpq   \*0x[a-f0-9]+\(%rip\)        # [a-f0-9]+ <bar1>
0519c2
  +[a-f0-9]+:	66 0f 1f 44 00 00    	nopw   0x0\(%rax,%rax,1\)
0519c2
 
0519c2
-0+200 <bar2@plt>:
0519c2
+[a-f0-9]+ <bar2@plt>:
0519c2
  +[a-f0-9]+:	f3 0f 1e fa          	endbr64 
0519c2
- +[a-f0-9]+:	ff 25 36 01 20 00    	jmpq   \*0x200136\(%rip\)        # 200340 <bar2>
0519c2
+ +[a-f0-9]+:	ff 25 ([0-9a-f]{2} ){4}[ 	]+jmpq   \*0x[a-f0-9]+\(%rip\)        # [a-f0-9]+ <bar2>
0519c2
  +[a-f0-9]+:	66 0f 1f 44 00 00    	nopw   0x0\(%rax,%rax,1\)
0519c2
 
0519c2
 Disassembly of section .text:
0519c2
 
0519c2
-0+210 <foo>:
0519c2
+[a-f0-9]+ <foo>:
0519c2
  +[a-f0-9]+:	48 83 ec 08          	sub    \$0x8,%rsp
0519c2
- +[a-f0-9]+:	e8 e7 ff ff ff       	callq  200 <bar2@plt>
0519c2
+ +[a-f0-9]+:	e8 e7 ff ff ff       	callq  [a-f0-9]+ <bar2@plt>
0519c2
  +[a-f0-9]+:	48 83 c4 08          	add    \$0x8,%rsp
0519c2
- +[a-f0-9]+:	e9 ce ff ff ff       	jmpq   1f0 <bar1@plt>
0519c2
+ +[a-f0-9]+:	e9 ce ff ff ff       	jmpq   [a-f0-9]+ <bar1@plt>
0519c2
 #pass
0519c2
diff -rup binutils.orig/ld/testsuite/ld-x86-64/ibt-plt-1.d binutils-2.30/ld/testsuite/ld-x86-64/ibt-plt-1.d
0519c2
--- binutils.orig/ld/testsuite/ld-x86-64/ibt-plt-1.d	2020-04-07 11:32:17.431775279 +0100
0519c2
+++ binutils-2.30/ld/testsuite/ld-x86-64/ibt-plt-1.d	2020-04-07 13:34:03.908784024 +0100
0519c2
@@ -1,6 +1,6 @@
0519c2
 #source: ibt-plt-1.s
0519c2
 #as: --64 -defsym __64_bit__=1
0519c2
-#ld: -shared -m elf_x86_64 --hash-style=sysv
0519c2
+#ld: -shared -m elf_x86_64 --hash-style=sysv -z max-page-size=0x200000 -z noseparate-code
0519c2
 #objdump: -dw
0519c2
 
0519c2
 .*: +file format .*
0519c2
@@ -8,36 +8,36 @@
0519c2
 
0519c2
 Disassembly of section .plt:
0519c2
 
0519c2
-0+290 <.plt>:
0519c2
- +[a-f0-9]+:	ff 35 ea 01 20 00    	pushq  0x2001ea\(%rip\)        # 200480 <_GLOBAL_OFFSET_TABLE_\+0x8>
0519c2
- +[a-f0-9]+:	f2 ff 25 eb 01 20 00 	bnd jmpq \*0x2001eb\(%rip\)        # 200488 <_GLOBAL_OFFSET_TABLE_\+0x10>
0519c2
+[a-f0-9]+ <.plt>:
0519c2
+ +[a-f0-9]+:	ff 35 ([0-9a-f]{2} ){4}[ 	]+pushq  0x[a-f0-9]+\(%rip\)        # [a-f0-9]+ <_GLOBAL_OFFSET_TABLE_\+0x8>
0519c2
+ +[a-f0-9]+:	f2 ff 25 ([0-9a-f]{2} ){4}[ 	]+bnd jmpq \*0x[a-f0-9]+\(%rip\)        # [a-f0-9]+ <_GLOBAL_OFFSET_TABLE_\+0x10>
0519c2
  +[a-f0-9]+:	0f 1f 00             	nopl   \(%rax\)
0519c2
  +[a-f0-9]+:	f3 0f 1e fa          	endbr64 
0519c2
  +[a-f0-9]+:	68 00 00 00 00       	pushq  \$0x0
0519c2
- +[a-f0-9]+:	f2 e9 e1 ff ff ff    	bnd jmpq 290 <.plt>
0519c2
+ +[a-f0-9]+:	f2 e9 e1 ff ff ff    	bnd jmpq [a-f0-9]+ <.plt>
0519c2
  +[a-f0-9]+:	90                   	nop
0519c2
  +[a-f0-9]+:	f3 0f 1e fa          	endbr64 
0519c2
  +[a-f0-9]+:	68 01 00 00 00       	pushq  \$0x1
0519c2
- +[a-f0-9]+:	f2 e9 d1 ff ff ff    	bnd jmpq 290 <.plt>
0519c2
+ +[a-f0-9]+:	f2 e9 d1 ff ff ff    	bnd jmpq [a-f0-9]+ <.plt>
0519c2
  +[a-f0-9]+:	90                   	nop
0519c2
 
0519c2
 Disassembly of section .plt.sec:
0519c2
 
0519c2
-0+2c0 <bar1@plt>:
0519c2
+[a-f0-9]+ <bar1@plt>:
0519c2
  +[a-f0-9]+:	f3 0f 1e fa          	endbr64 
0519c2
- +[a-f0-9]+:	f2 ff 25 c5 01 20 00 	bnd jmpq \*0x2001c5\(%rip\)        # 200490 <bar1>
0519c2
+ +[a-f0-9]+:	f2 ff 25 ([0-9a-f]{2} ){4}[ 	]+bnd jmpq \*0x[a-f0-9]+\(%rip\)        # [a-f0-9]+ <bar1>
0519c2
  +[a-f0-9]+:	0f 1f 44 00 00       	nopl   0x0\(%rax,%rax,1\)
0519c2
 
0519c2
-0+2d0 <bar2@plt>:
0519c2
+[a-f0-9]+ <bar2@plt>:
0519c2
  +[a-f0-9]+:	f3 0f 1e fa          	endbr64 
0519c2
- +[a-f0-9]+:	f2 ff 25 bd 01 20 00 	bnd jmpq \*0x2001bd\(%rip\)        # 200498 <bar2>
0519c2
+ +[a-f0-9]+:	f2 ff 25 ([0-9a-f]{2} ){4}[ 	]+bnd jmpq \*0x[a-f0-9]+\(%rip\)        # [a-f0-9]+ <bar2>
0519c2
  +[a-f0-9]+:	0f 1f 44 00 00       	nopl   0x0\(%rax,%rax,1\)
0519c2
 
0519c2
 Disassembly of section .text:
0519c2
 
0519c2
-0+2e0 <foo>:
0519c2
+[a-f0-9]+ <foo>:
0519c2
  +[a-f0-9]+:	48 83 ec 08          	sub    \$0x8,%rsp
0519c2
- +[a-f0-9]+:	e8 e7 ff ff ff       	callq  2d0 <bar2@plt>
0519c2
+ +[a-f0-9]+:	e8 e7 ff ff ff       	callq  [a-f0-9]+ <bar2@plt>
0519c2
  +[a-f0-9]+:	48 83 c4 08          	add    \$0x8,%rsp
0519c2
- +[a-f0-9]+:	e9 ce ff ff ff       	jmpq   2c0 <bar1@plt>
0519c2
+ +[a-f0-9]+:	e9 ce ff ff ff       	jmpq   [a-f0-9]+ <bar1@plt>
0519c2
 #pass
0519c2
diff -rup binutils.orig/ld/testsuite/ld-x86-64/ibt-plt-2a-x32.d binutils-2.30/ld/testsuite/ld-x86-64/ibt-plt-2a-x32.d
0519c2
--- binutils.orig/ld/testsuite/ld-x86-64/ibt-plt-2a-x32.d	2020-04-07 11:32:17.427775308 +0100
0519c2
+++ binutils-2.30/ld/testsuite/ld-x86-64/ibt-plt-2a-x32.d	2020-04-07 13:34:03.908784024 +0100
0519c2
@@ -1,6 +1,6 @@
0519c2
 #source: ibt-plt-2.s
0519c2
 #as: --x32
0519c2
-#ld: -shared -m elf32_x86_64 -z ibtplt --hash-style=sysv
0519c2
+#ld: -shared -m elf32_x86_64 -z ibtplt --hash-style=sysv -z max-page-size=0x200000 -z noseparate-code
0519c2
 #objdump: -dw
0519c2
 
0519c2
 .*: +file format .*
0519c2
@@ -8,36 +8,36 @@
0519c2
 
0519c2
 Disassembly of section .plt:
0519c2
 
0519c2
-0+1c0 <.plt>:
0519c2
- +[a-f0-9]+:	ff 35 62 01 20 00    	pushq  0x200162\(%rip\)        # 200328 <_GLOBAL_OFFSET_TABLE_\+0x8>
0519c2
- +[a-f0-9]+:	ff 25 64 01 20 00    	jmpq   \*0x200164\(%rip\)        # 200330 <_GLOBAL_OFFSET_TABLE_\+0x10>
0519c2
+0+1.0 <.plt>:
0519c2
+ +[a-f0-9]+:	ff 35 4a 01 20 00    	pushq  0x20014a\(%rip\)        # 200... <_GLOBAL_OFFSET_TABLE_\+0x8>
0519c2
+ +[a-f0-9]+:	ff 25 4c 01 20 00    	jmpq   \*0x20014c\(%rip\)        # 200... <_GLOBAL_OFFSET_TABLE_\+0x10>
0519c2
  +[a-f0-9]+:	0f 1f 40 00          	nopl   0x0\(%rax\)
0519c2
  +[a-f0-9]+:	f3 0f 1e fa          	endbr64 
0519c2
  +[a-f0-9]+:	68 00 00 00 00       	pushq  \$0x0
0519c2
- +[a-f0-9]+:	e9 e2 ff ff ff       	jmpq   1c0 <.plt>
0519c2
+ +[a-f0-9]+:	e9 e2 ff ff ff       	jmpq   1.0 <.plt>
0519c2
  +[a-f0-9]+:	66 90                	xchg   %ax,%ax
0519c2
  +[a-f0-9]+:	f3 0f 1e fa          	endbr64 
0519c2
  +[a-f0-9]+:	68 01 00 00 00       	pushq  \$0x1
0519c2
- +[a-f0-9]+:	e9 d2 ff ff ff       	jmpq   1c0 <.plt>
0519c2
+ +[a-f0-9]+:	e9 d2 ff ff ff       	jmpq   1.0 <.plt>
0519c2
  +[a-f0-9]+:	66 90                	xchg   %ax,%ax
0519c2
 
0519c2
 Disassembly of section .plt.sec:
0519c2
 
0519c2
-0+1f0 <bar1@plt>:
0519c2
+0+1.0 <bar1@plt>:
0519c2
  +[a-f0-9]+:	f3 0f 1e fa          	endbr64 
0519c2
- +[a-f0-9]+:	ff 25 3e 01 20 00    	jmpq   \*0x20013e\(%rip\)        # 200338 <bar1>
0519c2
+ +[a-f0-9]+:	ff 25 26 01 20 00    	jmpq   \*0x200126\(%rip\)        # 200... <bar1>
0519c2
  +[a-f0-9]+:	66 0f 1f 44 00 00    	nopw   0x0\(%rax,%rax,1\)
0519c2
 
0519c2
-0+200 <bar2@plt>:
0519c2
+0+1.0 <bar2@plt>:
0519c2
  +[a-f0-9]+:	f3 0f 1e fa          	endbr64 
0519c2
- +[a-f0-9]+:	ff 25 36 01 20 00    	jmpq   \*0x200136\(%rip\)        # 200340 <bar2>
0519c2
+ +[a-f0-9]+:	ff 25 1e 01 20 00    	jmpq   \*0x20011e\(%rip\)        # 200... <bar2>
0519c2
  +[a-f0-9]+:	66 0f 1f 44 00 00    	nopw   0x0\(%rax,%rax,1\)
0519c2
 
0519c2
 Disassembly of section .text:
0519c2
 
0519c2
-0+210 <foo>:
0519c2
+0+1.0 <foo>:
0519c2
  +[a-f0-9]+:	48 83 ec 08          	sub    \$0x8,%rsp
0519c2
- +[a-f0-9]+:	e8 e7 ff ff ff       	callq  200 <bar2@plt>
0519c2
+ +[a-f0-9]+:	e8 e7 ff ff ff       	callq  1.0 <bar2@plt>
0519c2
  +[a-f0-9]+:	48 83 c4 08          	add    \$0x8,%rsp
0519c2
- +[a-f0-9]+:	e9 ce ff ff ff       	jmpq   1f0 <bar1@plt>
0519c2
+ +[a-f0-9]+:	e9 ce ff ff ff       	jmpq   1.0 <bar1@plt>
0519c2
 #pass
0519c2
diff -rup binutils.orig/ld/testsuite/ld-x86-64/ibt-plt-2a.d binutils-2.30/ld/testsuite/ld-x86-64/ibt-plt-2a.d
0519c2
--- binutils.orig/ld/testsuite/ld-x86-64/ibt-plt-2a.d	2020-04-07 11:32:17.434775257 +0100
0519c2
+++ binutils-2.30/ld/testsuite/ld-x86-64/ibt-plt-2a.d	2020-04-07 13:34:03.908784024 +0100
0519c2
@@ -1,6 +1,6 @@
0519c2
 #source: ibt-plt-2.s
0519c2
 #as: --64 -defsym __64_bit__=1
0519c2
-#ld: -shared -m elf_x86_64 -z ibtplt --hash-style=sysv
0519c2
+#ld: -shared -m elf_x86_64 -z ibtplt --hash-style=sysv -z max-page-size=0x200000 -z noseparate-code
0519c2
 #objdump: -dw
0519c2
 
0519c2
 .*: +file format .*
0519c2
@@ -8,36 +8,36 @@
0519c2
 
0519c2
 Disassembly of section .plt:
0519c2
 
0519c2
-0+290 <.plt>:
0519c2
- +[a-f0-9]+:	ff 35 ea 01 20 00    	pushq  0x2001ea\(%rip\)        # 200480 <_GLOBAL_OFFSET_TABLE_\+0x8>
0519c2
- +[a-f0-9]+:	f2 ff 25 eb 01 20 00 	bnd jmpq \*0x2001eb\(%rip\)        # 200488 <_GLOBAL_OFFSET_TABLE_\+0x10>
0519c2
+0+..0 <.plt>:
0519c2
+ +[a-f0-9]+:	ff 35 ca 01 20 00    	pushq  0x2001ca\(%rip\)        # 200... <_GLOBAL_OFFSET_TABLE_\+0x8>
0519c2
+ +[a-f0-9]+:	f2 ff 25 cb 01 20 00 	bnd jmpq \*0x2001cb\(%rip\)        # 200... <_GLOBAL_OFFSET_TABLE_\+0x10>
0519c2
  +[a-f0-9]+:	0f 1f 00             	nopl   \(%rax\)
0519c2
  +[a-f0-9]+:	f3 0f 1e fa          	endbr64 
0519c2
  +[a-f0-9]+:	68 00 00 00 00       	pushq  \$0x0
0519c2
- +[a-f0-9]+:	f2 e9 e1 ff ff ff    	bnd jmpq 290 <.plt>
0519c2
+ +[a-f0-9]+:	f2 e9 e1 ff ff ff    	bnd jmpq ..0 <.plt>
0519c2
  +[a-f0-9]+:	90                   	nop
0519c2
  +[a-f0-9]+:	f3 0f 1e fa          	endbr64 
0519c2
  +[a-f0-9]+:	68 01 00 00 00       	pushq  \$0x1
0519c2
- +[a-f0-9]+:	f2 e9 d1 ff ff ff    	bnd jmpq 290 <.plt>
0519c2
+ +[a-f0-9]+:	f2 e9 d1 ff ff ff    	bnd jmpq ..0 <.plt>
0519c2
  +[a-f0-9]+:	90                   	nop
0519c2
 
0519c2
 Disassembly of section .plt.sec:
0519c2
 
0519c2
-0+2c0 <bar1@plt>:
0519c2
+0+..0 <bar1@plt>:
0519c2
  +[a-f0-9]+:	f3 0f 1e fa          	endbr64 
0519c2
- +[a-f0-9]+:	f2 ff 25 c5 01 20 00 	bnd jmpq \*0x2001c5\(%rip\)        # 200490 <bar1>
0519c2
+ +[a-f0-9]+:	f2 ff 25 a5 01 20 00 	bnd jmpq \*0x2001a5\(%rip\)        # 200... <bar1>
0519c2
  +[a-f0-9]+:	0f 1f 44 00 00       	nopl   0x0\(%rax,%rax,1\)
0519c2
 
0519c2
-0+2d0 <bar2@plt>:
0519c2
+0+..0 <bar2@plt>:
0519c2
  +[a-f0-9]+:	f3 0f 1e fa          	endbr64 
0519c2
- +[a-f0-9]+:	f2 ff 25 bd 01 20 00 	bnd jmpq \*0x2001bd\(%rip\)        # 200498 <bar2>
0519c2
+ +[a-f0-9]+:	f2 ff 25 9d 01 20 00 	bnd jmpq \*0x20019d\(%rip\)        # 200... <bar2>
0519c2
  +[a-f0-9]+:	0f 1f 44 00 00       	nopl   0x0\(%rax,%rax,1\)
0519c2
 
0519c2
 Disassembly of section .text:
0519c2
 
0519c2
-0+2e0 <foo>:
0519c2
+0+..0 <foo>:
0519c2
  +[a-f0-9]+:	48 83 ec 08          	sub    \$0x8,%rsp
0519c2
- +[a-f0-9]+:	e8 e7 ff ff ff       	callq  2d0 <bar2@plt>
0519c2
+ +[a-f0-9]+:	e8 e7 ff ff ff       	callq  ..0 <bar2@plt>
0519c2
  +[a-f0-9]+:	48 83 c4 08          	add    \$0x8,%rsp
0519c2
- +[a-f0-9]+:	e9 ce ff ff ff       	jmpq   2c0 <bar1@plt>
0519c2
+ +[a-f0-9]+:	e9 ce ff ff ff       	jmpq   ..0 <bar1@plt>
0519c2
 #pass
0519c2
diff -rup binutils.orig/ld/testsuite/ld-x86-64/ibt-plt-2b-x32.d binutils-2.30/ld/testsuite/ld-x86-64/ibt-plt-2b-x32.d
0519c2
--- binutils.orig/ld/testsuite/ld-x86-64/ibt-plt-2b-x32.d	2020-04-07 11:32:17.432775271 +0100
0519c2
+++ binutils-2.30/ld/testsuite/ld-x86-64/ibt-plt-2b-x32.d	2020-04-07 13:34:03.908784024 +0100
0519c2
@@ -1,6 +1,6 @@
0519c2
 #source: ibt-plt-2.s
0519c2
 #as: --x32
0519c2
-#ld: -shared -m elf32_x86_64 -z ibtplt --hash-style=sysv
0519c2
+#ld: -shared -m elf32_x86_64 -z ibtplt --hash-style=sysv -z max-page-size=0x200000 -z noseparate-code
0519c2
 #readelf: -n -wf
0519c2
 
0519c2
 Contents of the .eh_frame section:
0519c2
@@ -18,27 +18,21 @@ Contents of the .eh_frame section:
0519c2
   DW_CFA_nop
0519c2
   DW_CFA_nop
0519c2
 
0519c2
-0+18 00000014 0000001c FDE cie=00000000 pc=00000210..00000222
0519c2
-  DW_CFA_advance_loc: 4 to 00000214
0519c2
+0+18 00000014 0000001c FDE cie=00000000 pc=00000..0..00000..2
0519c2
+  DW_CFA_advance_loc: 4 to 00000..4
0519c2
   DW_CFA_def_cfa_offset: 16
0519c2
-  DW_CFA_advance_loc: 9 to 0000021d
0519c2
+  DW_CFA_advance_loc: 9 to 00000..d
0519c2
   DW_CFA_def_cfa_offset: 8
0519c2
   DW_CFA_nop
0519c2
 
0519c2
-0+30 00000020 00000034 FDE cie=00000000 pc=000001c0..000001f0
0519c2
+0+30 00000020 00000034 FDE cie=00000000 pc=00000..0..00000..0
0519c2
   DW_CFA_def_cfa_offset: 16
0519c2
-  DW_CFA_advance_loc: 6 to 000001c6
0519c2
+  DW_CFA_advance_loc: 6 to 00000..6
0519c2
   DW_CFA_def_cfa_offset: 24
0519c2
-  DW_CFA_advance_loc: 10 to 000001d0
0519c2
+  DW_CFA_advance_loc: 10 to 00000..0
0519c2
   DW_CFA_def_cfa_expression \(DW_OP_breg7 \(rsp\): 8; DW_OP_breg16 \(rip\): 0; DW_OP_lit15; DW_OP_and; DW_OP_lit9; DW_OP_ge; DW_OP_lit3; DW_OP_shl; DW_OP_plus\)
0519c2
 
0519c2
-0+54 00000010 00000058 FDE cie=00000000 pc=000001f0..00000210
0519c2
+0+54 00000010 00000058 FDE cie=00000000 pc=00000..0..00000..0
0519c2
   DW_CFA_nop
0519c2
   DW_CFA_nop
0519c2
   DW_CFA_nop
0519c2
-
0519c2
-
0519c2
-Displaying notes found in: .note.gnu.property
0519c2
-  Owner                 Data size	Description
0519c2
-  GNU                  0x0000000c	NT_GNU_PROPERTY_TYPE_0
0519c2
-      Properties: x86 feature: 
0519c2
diff -rup binutils.orig/ld/testsuite/ld-x86-64/ibt-plt-2b.d binutils-2.30/ld/testsuite/ld-x86-64/ibt-plt-2b.d
0519c2
--- binutils.orig/ld/testsuite/ld-x86-64/ibt-plt-2b.d	2020-04-07 11:32:17.427775308 +0100
0519c2
+++ binutils-2.30/ld/testsuite/ld-x86-64/ibt-plt-2b.d	2020-04-07 13:34:03.908784024 +0100
0519c2
@@ -1,6 +1,6 @@
0519c2
 #source: ibt-plt-2.s
0519c2
 #as: --64 -defsym __64_bit__=1
0519c2
-#ld: -shared -m elf_x86_64 -z ibtplt --hash-style=sysv
0519c2
+#ld: -shared -m elf_x86_64 -z ibtplt --hash-style=sysv -z max-page-size=0x200000 -z noseparate-code
0519c2
 #readelf: -wf -n
0519c2
 
0519c2
 Contents of the .eh_frame section:
0519c2
@@ -18,31 +18,25 @@ Contents of the .eh_frame section:
0519c2
   DW_CFA_nop
0519c2
   DW_CFA_nop
0519c2
 
0519c2
-0+18 0000000000000014 0000001c FDE cie=00000000 pc=00000000000002e0..00000000000002f2
0519c2
-  DW_CFA_advance_loc: 4 to 00000000000002e4
0519c2
+0+18 0000000000000014 0000001c FDE cie=00000000 pc=0000000000000..0..0000000000000..2
0519c2
+  DW_CFA_advance_loc: 4 to 0000000000000..4
0519c2
   DW_CFA_def_cfa_offset: 16
0519c2
-  DW_CFA_advance_loc: 9 to 00000000000002ed
0519c2
+  DW_CFA_advance_loc: 9 to 0000000000000..d
0519c2
   DW_CFA_def_cfa_offset: 8
0519c2
   DW_CFA_nop
0519c2
 
0519c2
-0+30 0000000000000024 00000034 FDE cie=00000000 pc=0000000000000290..00000000000002c0
0519c2
+0+30 0000000000000024 00000034 FDE cie=00000000 pc=0000000000000..0..0000000000000..0
0519c2
   DW_CFA_def_cfa_offset: 16
0519c2
-  DW_CFA_advance_loc: 6 to 0000000000000296
0519c2
+  DW_CFA_advance_loc: 6 to 0000000000000..6
0519c2
   DW_CFA_def_cfa_offset: 24
0519c2
-  DW_CFA_advance_loc: 10 to 00000000000002a0
0519c2
+  DW_CFA_advance_loc: 10 to 0000000000000..0
0519c2
   DW_CFA_def_cfa_expression \(DW_OP_breg7 \(rsp\): 8; DW_OP_breg16 \(rip\): 0; DW_OP_lit15; DW_OP_and; DW_OP_lit10; DW_OP_ge; DW_OP_lit3; DW_OP_shl; DW_OP_plus\)
0519c2
   DW_CFA_nop
0519c2
   DW_CFA_nop
0519c2
   DW_CFA_nop
0519c2
   DW_CFA_nop
0519c2
 
0519c2
-0+58 0000000000000010 0000005c FDE cie=00000000 pc=00000000000002c0..00000000000002e0
0519c2
+0+58 0000000000000010 0000005c FDE cie=00000000 pc=0000000000000..0..0000000000000..0
0519c2
   DW_CFA_nop
0519c2
   DW_CFA_nop
0519c2
   DW_CFA_nop
0519c2
-
0519c2
-
0519c2
-Displaying notes found in: .note.gnu.property
0519c2
-  Owner                 Data size	Description
0519c2
-  GNU                  0x00000010	NT_GNU_PROPERTY_TYPE_0
0519c2
-      Properties: x86 feature: 
0519c2
diff -rup binutils.orig/ld/testsuite/ld-x86-64/ibt-plt-2c-x32.d binutils-2.30/ld/testsuite/ld-x86-64/ibt-plt-2c-x32.d
0519c2
--- binutils.orig/ld/testsuite/ld-x86-64/ibt-plt-2c-x32.d	2020-04-07 11:32:17.429775293 +0100
0519c2
+++ binutils-2.30/ld/testsuite/ld-x86-64/ibt-plt-2c-x32.d	2020-04-07 13:34:03.908784024 +0100
0519c2
@@ -1,6 +1,6 @@
0519c2
 #source: ibt-plt-2.s
0519c2
 #as: --x32
0519c2
-#ld: -shared -m elf32_x86_64 -z ibt --hash-style=sysv
0519c2
+#ld: -shared -m elf32_x86_64 -z ibt --hash-style=sysv -z max-page-size=0x200000 -z noseparate-code
0519c2
 #objdump: -dw
0519c2
 
0519c2
 .*: +file format .*
0519c2
@@ -8,36 +8,36 @@
0519c2
 
0519c2
 Disassembly of section .plt:
0519c2
 
0519c2
-0+1c0 <.plt>:
0519c2
- +[a-f0-9]+:	ff 35 62 01 20 00    	pushq  0x200162\(%rip\)        # 200328 <_GLOBAL_OFFSET_TABLE_\+0x8>
0519c2
- +[a-f0-9]+:	ff 25 64 01 20 00    	jmpq   \*0x200164\(%rip\)        # 200330 <_GLOBAL_OFFSET_TABLE_\+0x10>
0519c2
+[a-f0-9]+ <.plt>:
0519c2
+ +[a-f0-9]+:	ff 35 ([0-9a-f]{2} ){4}[ 	]+pushq  0x[a-f0-9]+\(%rip\)        # [a-f0-9]+ <_GLOBAL_OFFSET_TABLE_\+0x8>
0519c2
+ +[a-f0-9]+:	ff 25 ([0-9a-f]{2} ){4}[ 	]+jmpq   \*0x[a-f0-9]+\(%rip\)        # [a-f0-9]+ <_GLOBAL_OFFSET_TABLE_\+0x10>
0519c2
  +[a-f0-9]+:	0f 1f 40 00          	nopl   0x0\(%rax\)
0519c2
  +[a-f0-9]+:	f3 0f 1e fa          	endbr64 
0519c2
  +[a-f0-9]+:	68 00 00 00 00       	pushq  \$0x0
0519c2
- +[a-f0-9]+:	e9 e2 ff ff ff       	jmpq   1c0 <.plt>
0519c2
+ +[a-f0-9]+:	e9 e2 ff ff ff       	jmpq   [a-f0-9]+ <.plt>
0519c2
  +[a-f0-9]+:	66 90                	xchg   %ax,%ax
0519c2
  +[a-f0-9]+:	f3 0f 1e fa          	endbr64 
0519c2
  +[a-f0-9]+:	68 01 00 00 00       	pushq  \$0x1
0519c2
- +[a-f0-9]+:	e9 d2 ff ff ff       	jmpq   1c0 <.plt>
0519c2
+ +[a-f0-9]+:	e9 d2 ff ff ff       	jmpq   [a-f0-9]+ <.plt>
0519c2
  +[a-f0-9]+:	66 90                	xchg   %ax,%ax
0519c2
 
0519c2
 Disassembly of section .plt.sec:
0519c2
 
0519c2
-0+1f0 <bar1@plt>:
0519c2
+[a-f0-9]+ <bar1@plt>:
0519c2
  +[a-f0-9]+:	f3 0f 1e fa          	endbr64 
0519c2
- +[a-f0-9]+:	ff 25 3e 01 20 00    	jmpq   \*0x20013e\(%rip\)        # 200338 <bar1>
0519c2
+ +[a-f0-9]+:	ff 25 ([0-9a-f]{2} ){4}[ 	]+jmpq   \*0x[a-f0-9]+\(%rip\)        # [a-f0-9]+ <bar1>
0519c2
  +[a-f0-9]+:	66 0f 1f 44 00 00    	nopw   0x0\(%rax,%rax,1\)
0519c2
 
0519c2
-0+200 <bar2@plt>:
0519c2
+[a-f0-9]+ <bar2@plt>:
0519c2
  +[a-f0-9]+:	f3 0f 1e fa          	endbr64 
0519c2
- +[a-f0-9]+:	ff 25 36 01 20 00    	jmpq   \*0x200136\(%rip\)        # 200340 <bar2>
0519c2
+ +[a-f0-9]+:	ff 25 ([0-9a-f]{2} ){4}[ 	]+jmpq   \*0x[a-f0-9]+\(%rip\)        # [a-f0-9]+ <bar2>
0519c2
  +[a-f0-9]+:	66 0f 1f 44 00 00    	nopw   0x0\(%rax,%rax,1\)
0519c2
 
0519c2
 Disassembly of section .text:
0519c2
 
0519c2
-0+210 <foo>:
0519c2
+[a-f0-9]+ <foo>:
0519c2
  +[a-f0-9]+:	48 83 ec 08          	sub    \$0x8,%rsp
0519c2
- +[a-f0-9]+:	e8 e7 ff ff ff       	callq  200 <bar2@plt>
0519c2
+ +[a-f0-9]+:	e8 e7 ff ff ff       	callq  [a-f0-9]+ <bar2@plt>
0519c2
  +[a-f0-9]+:	48 83 c4 08          	add    \$0x8,%rsp
0519c2
- +[a-f0-9]+:	e9 ce ff ff ff       	jmpq   1f0 <bar1@plt>
0519c2
+ +[a-f0-9]+:	e9 ce ff ff ff       	jmpq   [a-f0-9]+ <bar1@plt>
0519c2
 #pass
0519c2
diff -rup binutils.orig/ld/testsuite/ld-x86-64/ibt-plt-2c.d binutils-2.30/ld/testsuite/ld-x86-64/ibt-plt-2c.d
0519c2
--- binutils.orig/ld/testsuite/ld-x86-64/ibt-plt-2c.d	2020-04-07 11:32:17.429775293 +0100
0519c2
+++ binutils-2.30/ld/testsuite/ld-x86-64/ibt-plt-2c.d	2020-04-07 13:34:03.908784024 +0100
0519c2
@@ -1,6 +1,6 @@
0519c2
 #source: ibt-plt-2.s
0519c2
 #as: --64 -defsym __64_bit__=1
0519c2
-#ld: -shared -m elf_x86_64 -z ibt --hash-style=sysv
0519c2
+#ld: -shared -m elf_x86_64 -z ibt --hash-style=sysv -z max-page-size=0x200000 -z noseparate-code
0519c2
 #objdump: -dw
0519c2
 
0519c2
 .*: +file format .*
0519c2
@@ -8,36 +8,36 @@
0519c2
 
0519c2
 Disassembly of section .plt:
0519c2
 
0519c2
-0+290 <.plt>:
0519c2
- +[a-f0-9]+:	ff 35 ea 01 20 00    	pushq  0x2001ea\(%rip\)        # 200480 <_GLOBAL_OFFSET_TABLE_\+0x8>
0519c2
- +[a-f0-9]+:	f2 ff 25 eb 01 20 00 	bnd jmpq \*0x2001eb\(%rip\)        # 200488 <_GLOBAL_OFFSET_TABLE_\+0x10>
0519c2
+[a-f0-9]+ <.plt>:
0519c2
+ +[a-f0-9]+:	ff 35 ([0-9a-f]{2} ){4}[ 	]+pushq  0x[a-f0-9]+\(%rip\)        # [a-f0-9]+ <_GLOBAL_OFFSET_TABLE_\+0x8>
0519c2
+ +[a-f0-9]+:	f2 ff 25 ([0-9a-f]{2} ){4}[ 	]+bnd jmpq \*0x[a-f0-9]+\(%rip\)        # [a-f0-9]+ <_GLOBAL_OFFSET_TABLE_\+0x10>
0519c2
  +[a-f0-9]+:	0f 1f 00             	nopl   \(%rax\)
0519c2
  +[a-f0-9]+:	f3 0f 1e fa          	endbr64 
0519c2
  +[a-f0-9]+:	68 00 00 00 00       	pushq  \$0x0
0519c2
- +[a-f0-9]+:	f2 e9 e1 ff ff ff    	bnd jmpq 290 <.plt>
0519c2
+ +[a-f0-9]+:	f2 e9 e1 ff ff ff    	bnd jmpq [a-f0-9]+ <.plt>
0519c2
  +[a-f0-9]+:	90                   	nop
0519c2
  +[a-f0-9]+:	f3 0f 1e fa          	endbr64 
0519c2
  +[a-f0-9]+:	68 01 00 00 00       	pushq  \$0x1
0519c2
- +[a-f0-9]+:	f2 e9 d1 ff ff ff    	bnd jmpq 290 <.plt>
0519c2
+ +[a-f0-9]+:	f2 e9 d1 ff ff ff    	bnd jmpq [a-f0-9]+ <.plt>
0519c2
  +[a-f0-9]+:	90                   	nop
0519c2
 
0519c2
 Disassembly of section .plt.sec:
0519c2
 
0519c2
-0+2c0 <bar1@plt>:
0519c2
+[a-f0-9]+ <bar1@plt>:
0519c2
  +[a-f0-9]+:	f3 0f 1e fa          	endbr64 
0519c2
- +[a-f0-9]+:	f2 ff 25 c5 01 20 00 	bnd jmpq \*0x2001c5\(%rip\)        # 200490 <bar1>
0519c2
+ +[a-f0-9]+:	f2 ff 25 ([0-9a-f]{2} ){4}[ 	]+bnd jmpq \*0x[a-f0-9]+\(%rip\)        # [a-f0-9]+ <bar1>
0519c2
  +[a-f0-9]+:	0f 1f 44 00 00       	nopl   0x0\(%rax,%rax,1\)
0519c2
 
0519c2
-0+2d0 <bar2@plt>:
0519c2
+[a-f0-9]+ <bar2@plt>:
0519c2
  +[a-f0-9]+:	f3 0f 1e fa          	endbr64 
0519c2
- +[a-f0-9]+:	f2 ff 25 bd 01 20 00 	bnd jmpq \*0x2001bd\(%rip\)        # 200498 <bar2>
0519c2
+ +[a-f0-9]+:	f2 ff 25 ([0-9a-f]{2} ){4}[ 	]+bnd jmpq \*0x[a-f0-9]+\(%rip\)        # [a-f0-9]+ <bar2>
0519c2
  +[a-f0-9]+:	0f 1f 44 00 00       	nopl   0x0\(%rax,%rax,1\)
0519c2
 
0519c2
 Disassembly of section .text:
0519c2
 
0519c2
-0+2e0 <foo>:
0519c2
+[a-f0-9]+ <foo>:
0519c2
  +[a-f0-9]+:	48 83 ec 08          	sub    \$0x8,%rsp
0519c2
- +[a-f0-9]+:	e8 e7 ff ff ff       	callq  2d0 <bar2@plt>
0519c2
+ +[a-f0-9]+:	e8 e7 ff ff ff       	callq  [a-f0-9]+ <bar2@plt>
0519c2
  +[a-f0-9]+:	48 83 c4 08          	add    \$0x8,%rsp
0519c2
- +[a-f0-9]+:	e9 ce ff ff ff       	jmpq   2c0 <bar1@plt>
0519c2
+ +[a-f0-9]+:	e9 ce ff ff ff       	jmpq   [a-f0-9]+ <bar1@plt>
0519c2
 #pass
0519c2
diff -rup binutils.orig/ld/testsuite/ld-x86-64/ibt-plt-2d-x32.d binutils-2.30/ld/testsuite/ld-x86-64/ibt-plt-2d-x32.d
0519c2
--- binutils.orig/ld/testsuite/ld-x86-64/ibt-plt-2d-x32.d	2020-04-07 11:32:17.423775337 +0100
0519c2
+++ binutils-2.30/ld/testsuite/ld-x86-64/ibt-plt-2d-x32.d	2020-04-07 13:34:03.909784017 +0100
0519c2
@@ -1,6 +1,6 @@
0519c2
 #source: ibt-plt-2.s
0519c2
 #as: --x32
0519c2
-#ld: -shared -m elf32_x86_64 -z ibt --hash-style=sysv
0519c2
+#ld: -shared -m elf32_x86_64 -z ibt --hash-style=sysv -z max-page-size=0x200000 -z noseparate-code
0519c2
 #readelf: -n -wf
0519c2
 
0519c2
 Contents of the .eh_frame section:
0519c2
@@ -18,21 +18,21 @@ Contents of the .eh_frame section:
0519c2
   DW_CFA_nop
0519c2
   DW_CFA_nop
0519c2
 
0519c2
-0+18 00000014 0000001c FDE cie=00000000 pc=00000210..00000222
0519c2
-  DW_CFA_advance_loc: 4 to 00000214
0519c2
+0+18 00000014 0000001c FDE cie=00000000 pc=[a-f0-9]+\.\.[a-f0-9]+
0519c2
+  DW_CFA_advance_loc: 4 to [a-f0-9]+
0519c2
   DW_CFA_def_cfa_offset: 16
0519c2
-  DW_CFA_advance_loc: 9 to 0000021d
0519c2
+  DW_CFA_advance_loc: 9 to [a-f0-9]+
0519c2
   DW_CFA_def_cfa_offset: 8
0519c2
   DW_CFA_nop
0519c2
 
0519c2
-0+30 00000020 00000034 FDE cie=00000000 pc=000001c0..000001f0
0519c2
+0+30 00000020 00000034 FDE cie=00000000 pc=[a-f0-9]+\.\.[a-f0-9]+
0519c2
   DW_CFA_def_cfa_offset: 16
0519c2
-  DW_CFA_advance_loc: 6 to 000001c6
0519c2
+  DW_CFA_advance_loc: 6 to [a-f0-9]+
0519c2
   DW_CFA_def_cfa_offset: 24
0519c2
-  DW_CFA_advance_loc: 10 to 000001d0
0519c2
+  DW_CFA_advance_loc: 10 to [a-f0-9]+
0519c2
   DW_CFA_def_cfa_expression \(DW_OP_breg7 \(rsp\): 8; DW_OP_breg16 \(rip\): 0; DW_OP_lit15; DW_OP_and; DW_OP_lit9; DW_OP_ge; DW_OP_lit3; DW_OP_shl; DW_OP_plus\)
0519c2
 
0519c2
-0+54 00000010 00000058 FDE cie=00000000 pc=000001f0..00000210
0519c2
+0+54 00000010 00000058 FDE cie=00000000 pc=[a-f0-9]+\.\.[a-f0-9]+
0519c2
   DW_CFA_nop
0519c2
   DW_CFA_nop
0519c2
   DW_CFA_nop
0519c2
diff -rup binutils.orig/ld/testsuite/ld-x86-64/ibt-plt-2d.d binutils-2.30/ld/testsuite/ld-x86-64/ibt-plt-2d.d
0519c2
--- binutils.orig/ld/testsuite/ld-x86-64/ibt-plt-2d.d	2020-04-07 11:32:17.425775323 +0100
0519c2
+++ binutils-2.30/ld/testsuite/ld-x86-64/ibt-plt-2d.d	2020-04-07 13:34:03.909784017 +0100
0519c2
@@ -1,6 +1,6 @@
0519c2
 #source: ibt-plt-2.s
0519c2
 #as: --64 -defsym __64_bit__=1
0519c2
-#ld: -shared -m elf_x86_64 -z ibt --hash-style=sysv
0519c2
+#ld: -shared -m elf_x86_64 -z ibt --hash-style=sysv -z max-page-size=0x200000 -z noseparate-code
0519c2
 #readelf: -wf -n
0519c2
 
0519c2
 Contents of the .eh_frame section:
0519c2
@@ -18,25 +18,25 @@ Contents of the .eh_frame section:
0519c2
   DW_CFA_nop
0519c2
   DW_CFA_nop
0519c2
 
0519c2
-0+18 0000000000000014 0000001c FDE cie=00000000 pc=00000000000002e0..00000000000002f2
0519c2
-  DW_CFA_advance_loc: 4 to 00000000000002e4
0519c2
+0+18 0000000000000014 0000001c FDE cie=00000000 pc=[a-f0-9]+\.\.[a-f0-9]+
0519c2
+  DW_CFA_advance_loc: 4 to [a-f0-9]+
0519c2
   DW_CFA_def_cfa_offset: 16
0519c2
-  DW_CFA_advance_loc: 9 to 00000000000002ed
0519c2
+  DW_CFA_advance_loc: 9 to [a-f0-9]+
0519c2
   DW_CFA_def_cfa_offset: 8
0519c2
   DW_CFA_nop
0519c2
 
0519c2
-0+30 0000000000000024 00000034 FDE cie=00000000 pc=0000000000000290..00000000000002c0
0519c2
+0+30 0000000000000024 00000034 FDE cie=00000000 pc=[a-f0-9]+\.\.[a-f0-9]+
0519c2
   DW_CFA_def_cfa_offset: 16
0519c2
-  DW_CFA_advance_loc: 6 to 0000000000000296
0519c2
+  DW_CFA_advance_loc: 6 to [a-f0-9]+
0519c2
   DW_CFA_def_cfa_offset: 24
0519c2
-  DW_CFA_advance_loc: 10 to 00000000000002a0
0519c2
+  DW_CFA_advance_loc: 10 to [a-f0-9]+
0519c2
   DW_CFA_def_cfa_expression \(DW_OP_breg7 \(rsp\): 8; DW_OP_breg16 \(rip\): 0; DW_OP_lit15; DW_OP_and; DW_OP_lit10; DW_OP_ge; DW_OP_lit3; DW_OP_shl; DW_OP_plus\)
0519c2
   DW_CFA_nop
0519c2
   DW_CFA_nop
0519c2
   DW_CFA_nop
0519c2
   DW_CFA_nop
0519c2
 
0519c2
-0+58 0000000000000010 0000005c FDE cie=00000000 pc=00000000000002c0..00000000000002e0
0519c2
+0+58 0000000000000010 0000005c FDE cie=00000000 pc=[a-f0-9]+\.\.[a-f0-9]+
0519c2
   DW_CFA_nop
0519c2
   DW_CFA_nop
0519c2
   DW_CFA_nop
0519c2
@@ -46,3 +46,4 @@ Displaying notes found in: .note.gnu.pro
0519c2
   Owner                 Data size	Description
0519c2
   GNU                  0x00000010	NT_GNU_PROPERTY_TYPE_0
0519c2
       Properties: x86 feature: IBT
0519c2
+#pass
0519c2
diff -rup binutils.orig/ld/testsuite/ld-x86-64/ibt-plt-3c-x32.d binutils-2.30/ld/testsuite/ld-x86-64/ibt-plt-3c-x32.d
0519c2
--- binutils.orig/ld/testsuite/ld-x86-64/ibt-plt-3c-x32.d	2020-04-07 11:32:17.428775301 +0100
0519c2
+++ binutils-2.30/ld/testsuite/ld-x86-64/ibt-plt-3c-x32.d	2020-04-07 13:34:03.909784017 +0100
0519c2
@@ -1,6 +1,6 @@
0519c2
 #source: ibt-plt-3.s
0519c2
 #as: --x32
0519c2
-#ld: -shared -m elf32_x86_64 -z ibt --hash-style=sysv
0519c2
+#ld: -shared -m elf32_x86_64 -z ibt --hash-style=sysv -z max-page-size=0x200000 -z noseparate-code
0519c2
 #objdump: -dw
0519c2
 
0519c2
 .*: +file format .*
0519c2
@@ -8,36 +8,36 @@
0519c2
 
0519c2
 Disassembly of section .plt:
0519c2
 
0519c2
-0+1c0 <.plt>:
0519c2
- +[a-f0-9]+:	ff 35 62 01 20 00    	pushq  0x200162\(%rip\)        # 200328 <_GLOBAL_OFFSET_TABLE_\+0x8>
0519c2
- +[a-f0-9]+:	ff 25 64 01 20 00    	jmpq   \*0x200164\(%rip\)        # 200330 <_GLOBAL_OFFSET_TABLE_\+0x10>
0519c2
+[a-f0-9]+ <.plt>:
0519c2
+ +[a-f0-9]+:	ff 35 ([0-9a-f]{2} ){4}[ 	]+pushq  0x[a-f0-9]+\(%rip\)        # [a-f0-9]+ <_GLOBAL_OFFSET_TABLE_\+0x8>
0519c2
+ +[a-f0-9]+:	ff 25 ([0-9a-f]{2} ){4}[ 	]+jmpq   \*0x[a-f0-9]+\(%rip\)        # [a-f0-9]+ <_GLOBAL_OFFSET_TABLE_\+0x10>
0519c2
  +[a-f0-9]+:	0f 1f 40 00          	nopl   0x0\(%rax\)
0519c2
  +[a-f0-9]+:	f3 0f 1e fa          	endbr64 
0519c2
  +[a-f0-9]+:	68 00 00 00 00       	pushq  \$0x0
0519c2
- +[a-f0-9]+:	e9 e2 ff ff ff       	jmpq   1c0 <.plt>
0519c2
+ +[a-f0-9]+:	e9 e2 ff ff ff       	jmpq   [a-f0-9]+ <.plt>
0519c2
  +[a-f0-9]+:	66 90                	xchg   %ax,%ax
0519c2
  +[a-f0-9]+:	f3 0f 1e fa          	endbr64 
0519c2
  +[a-f0-9]+:	68 01 00 00 00       	pushq  \$0x1
0519c2
- +[a-f0-9]+:	e9 d2 ff ff ff       	jmpq   1c0 <.plt>
0519c2
+ +[a-f0-9]+:	e9 d2 ff ff ff       	jmpq   [a-f0-9]+ <.plt>
0519c2
  +[a-f0-9]+:	66 90                	xchg   %ax,%ax
0519c2
 
0519c2
 Disassembly of section .plt.sec:
0519c2
 
0519c2
-0+1f0 <bar1@plt>:
0519c2
+[a-f0-9]+ <bar1@plt>:
0519c2
  +[a-f0-9]+:	f3 0f 1e fa          	endbr64 
0519c2
- +[a-f0-9]+:	ff 25 3e 01 20 00    	jmpq   \*0x20013e\(%rip\)        # 200338 <bar1>
0519c2
+ +[a-f0-9]+:	ff 25 ([0-9a-f]{2} ){4}[ 	]+jmpq   \*0x[a-f0-9]+\(%rip\)        # [a-f0-9]+ <bar1>
0519c2
  +[a-f0-9]+:	66 0f 1f 44 00 00    	nopw   0x0\(%rax,%rax,1\)
0519c2
 
0519c2
-0+200 <bar2@plt>:
0519c2
+[a-f0-9]+ <bar2@plt>:
0519c2
  +[a-f0-9]+:	f3 0f 1e fa          	endbr64 
0519c2
- +[a-f0-9]+:	ff 25 36 01 20 00    	jmpq   \*0x200136\(%rip\)        # 200340 <bar2>
0519c2
+ +[a-f0-9]+:	ff 25 ([0-9a-f]{2} ){4}[ 	]+jmpq   \*0x[a-f0-9]+\(%rip\)        # [a-f0-9]+ <bar2>
0519c2
  +[a-f0-9]+:	66 0f 1f 44 00 00    	nopw   0x0\(%rax,%rax,1\)
0519c2
 
0519c2
 Disassembly of section .text:
0519c2
 
0519c2
-0+210 <foo>:
0519c2
+[a-f0-9]+ <foo>:
0519c2
  +[a-f0-9]+:	48 83 ec 08          	sub    \$0x8,%rsp
0519c2
- +[a-f0-9]+:	e8 e7 ff ff ff       	callq  200 <bar2@plt>
0519c2
+ +[a-f0-9]+:	e8 e7 ff ff ff       	callq  [a-f0-9]+ <bar2@plt>
0519c2
  +[a-f0-9]+:	48 83 c4 08          	add    \$0x8,%rsp
0519c2
- +[a-f0-9]+:	e9 ce ff ff ff       	jmpq   1f0 <bar1@plt>
0519c2
+ +[a-f0-9]+:	e9 ce ff ff ff       	jmpq   [a-f0-9]+ <bar1@plt>
0519c2
 #pass
0519c2
diff -rup binutils.orig/ld/testsuite/ld-x86-64/ibt-plt-3c.d binutils-2.30/ld/testsuite/ld-x86-64/ibt-plt-3c.d
0519c2
--- binutils.orig/ld/testsuite/ld-x86-64/ibt-plt-3c.d	2020-04-07 11:32:17.435775250 +0100
0519c2
+++ binutils-2.30/ld/testsuite/ld-x86-64/ibt-plt-3c.d	2020-04-07 13:34:03.909784017 +0100
0519c2
@@ -1,6 +1,6 @@
0519c2
 #source: ibt-plt-3.s
0519c2
 #as: --64 -defsym __64_bit__=1
0519c2
-#ld: -shared -m elf_x86_64 -z ibt --hash-style=sysv
0519c2
+#ld: -shared -m elf_x86_64 -z ibt --hash-style=sysv -z max-page-size=0x200000 -z noseparate-code
0519c2
 #objdump: -dw
0519c2
 
0519c2
 .*: +file format .*
0519c2
@@ -8,36 +8,36 @@
0519c2
 
0519c2
 Disassembly of section .plt:
0519c2
 
0519c2
-0+290 <.plt>:
0519c2
- +[a-f0-9]+:	ff 35 ea 01 20 00    	pushq  0x2001ea\(%rip\)        # 200480 <_GLOBAL_OFFSET_TABLE_\+0x8>
0519c2
- +[a-f0-9]+:	f2 ff 25 eb 01 20 00 	bnd jmpq \*0x2001eb\(%rip\)        # 200488 <_GLOBAL_OFFSET_TABLE_\+0x10>
0519c2
+[a-f0-9]+ <.plt>:
0519c2
+ +[a-f0-9]+:	ff 35 ([0-9a-f]{2} ){4}[ 	]+pushq  0x[a-f0-9]+\(%rip\)        # [a-f0-9]+ <_GLOBAL_OFFSET_TABLE_\+0x8>
0519c2
+ +[a-f0-9]+:	f2 ff 25 ([0-9a-f]{2} ){4}[ 	]+bnd jmpq \*0x[a-f0-9]+\(%rip\)        # [a-f0-9]+ <_GLOBAL_OFFSET_TABLE_\+0x10>
0519c2
  +[a-f0-9]+:	0f 1f 00             	nopl   \(%rax\)
0519c2
  +[a-f0-9]+:	f3 0f 1e fa          	endbr64 
0519c2
  +[a-f0-9]+:	68 00 00 00 00       	pushq  \$0x0
0519c2
- +[a-f0-9]+:	f2 e9 e1 ff ff ff    	bnd jmpq 290 <.plt>
0519c2
+ +[a-f0-9]+:	f2 e9 e1 ff ff ff    	bnd jmpq [a-f0-9]+ <.plt>
0519c2
  +[a-f0-9]+:	90                   	nop
0519c2
  +[a-f0-9]+:	f3 0f 1e fa          	endbr64 
0519c2
  +[a-f0-9]+:	68 01 00 00 00       	pushq  \$0x1
0519c2
- +[a-f0-9]+:	f2 e9 d1 ff ff ff    	bnd jmpq 290 <.plt>
0519c2
+ +[a-f0-9]+:	f2 e9 d1 ff ff ff    	bnd jmpq [a-f0-9]+ <.plt>
0519c2
  +[a-f0-9]+:	90                   	nop
0519c2
 
0519c2
 Disassembly of section .plt.sec:
0519c2
 
0519c2
-0+2c0 <bar1@plt>:
0519c2
+[a-f0-9]+ <bar1@plt>:
0519c2
  +[a-f0-9]+:	f3 0f 1e fa          	endbr64 
0519c2
- +[a-f0-9]+:	f2 ff 25 c5 01 20 00 	bnd jmpq \*0x2001c5\(%rip\)        # 200490 <bar1>
0519c2
+ +[a-f0-9]+:	f2 ff 25 ([0-9a-f]{2} ){4}[ 	]+bnd jmpq \*0x[a-f0-9]+\(%rip\)        # [a-f0-9]+ <bar1>
0519c2
  +[a-f0-9]+:	0f 1f 44 00 00       	nopl   0x0\(%rax,%rax,1\)
0519c2
 
0519c2
-0+2d0 <bar2@plt>:
0519c2
+[a-f0-9]+ <bar2@plt>:
0519c2
  +[a-f0-9]+:	f3 0f 1e fa          	endbr64 
0519c2
- +[a-f0-9]+:	f2 ff 25 bd 01 20 00 	bnd jmpq \*0x2001bd\(%rip\)        # 200498 <bar2>
0519c2
+ +[a-f0-9]+:	f2 ff 25 ([0-9a-f]{2} ){4}[ 	]+bnd jmpq \*0x[a-f0-9]+\(%rip\)        # [a-f0-9]+ <bar2>
0519c2
  +[a-f0-9]+:	0f 1f 44 00 00       	nopl   0x0\(%rax,%rax,1\)
0519c2
 
0519c2
 Disassembly of section .text:
0519c2
 
0519c2
-0+2e0 <foo>:
0519c2
+[a-f0-9]+ <foo>:
0519c2
  +[a-f0-9]+:	48 83 ec 08          	sub    \$0x8,%rsp
0519c2
- +[a-f0-9]+:	e8 e7 ff ff ff       	callq  2d0 <bar2@plt>
0519c2
+ +[a-f0-9]+:	e8 e7 ff ff ff       	callq  [a-f0-9]+ <bar2@plt>
0519c2
  +[a-f0-9]+:	48 83 c4 08          	add    \$0x8,%rsp
0519c2
- +[a-f0-9]+:	e9 ce ff ff ff       	jmpq   2c0 <bar1@plt>
0519c2
+ +[a-f0-9]+:	e9 ce ff ff ff       	jmpq   [a-f0-9]+ <bar1@plt>
0519c2
 #pass
0519c2
diff -rup binutils.orig/ld/testsuite/ld-x86-64/ibt-plt-3d-x32.d binutils-2.30/ld/testsuite/ld-x86-64/ibt-plt-3d-x32.d
0519c2
--- binutils.orig/ld/testsuite/ld-x86-64/ibt-plt-3d-x32.d	2020-04-07 11:32:17.433775264 +0100
0519c2
+++ binutils-2.30/ld/testsuite/ld-x86-64/ibt-plt-3d-x32.d	2020-04-07 13:34:03.909784017 +0100
0519c2
@@ -1,6 +1,6 @@
0519c2
 #source: ibt-plt-3.s
0519c2
 #as: --x32
0519c2
-#ld: -shared -m elf32_x86_64 -z ibt --hash-style=sysv
0519c2
+#ld: -shared -m elf32_x86_64 -z ibt --hash-style=sysv -z max-page-size=0x200000 -z noseparate-code
0519c2
 #readelf: -wf -n
0519c2
 
0519c2
 Contents of the .eh_frame section:
0519c2
@@ -18,21 +18,21 @@ Contents of the .eh_frame section:
0519c2
   DW_CFA_nop
0519c2
   DW_CFA_nop
0519c2
 
0519c2
-0+18 00000014 0000001c FDE cie=00000000 pc=00000210..00000222
0519c2
-  DW_CFA_advance_loc: 4 to 00000214
0519c2
+0+18 00000014 0000001c FDE cie=00000000 pc=[a-f0-9]+\.\.[a-f0-9]+
0519c2
+  DW_CFA_advance_loc: 4 to [a-f0-9]+
0519c2
   DW_CFA_def_cfa_offset: 16
0519c2
-  DW_CFA_advance_loc: 9 to 0000021d
0519c2
+  DW_CFA_advance_loc: 9 to [a-f0-9]+
0519c2
   DW_CFA_def_cfa_offset: 8
0519c2
   DW_CFA_nop
0519c2
 
0519c2
-0+30 00000020 00000034 FDE cie=00000000 pc=000001c0..000001f0
0519c2
+0+30 00000020 00000034 FDE cie=00000000 pc=[a-f0-9]+\.\.[a-f0-9]+
0519c2
   DW_CFA_def_cfa_offset: 16
0519c2
-  DW_CFA_advance_loc: 6 to 000001c6
0519c2
+  DW_CFA_advance_loc: 6 to [a-f0-9]+
0519c2
   DW_CFA_def_cfa_offset: 24
0519c2
-  DW_CFA_advance_loc: 10 to 000001d0
0519c2
+  DW_CFA_advance_loc: 10 to [a-f0-9]+
0519c2
   DW_CFA_def_cfa_expression \(DW_OP_breg7 \(rsp\): 8; DW_OP_breg16 \(rip\): 0; DW_OP_lit15; DW_OP_and; DW_OP_lit9; DW_OP_ge; DW_OP_lit3; DW_OP_shl; DW_OP_plus\)
0519c2
 
0519c2
-0+54 00000010 00000058 FDE cie=00000000 pc=000001f0..00000210
0519c2
+0+54 00000010 00000058 FDE cie=00000000 pc=[a-f0-9]+\.\.[a-f0-9]+
0519c2
   DW_CFA_nop
0519c2
   DW_CFA_nop
0519c2
   DW_CFA_nop
0519c2
diff -rup binutils.orig/ld/testsuite/ld-x86-64/ibt-plt-3d.d binutils-2.30/ld/testsuite/ld-x86-64/ibt-plt-3d.d
0519c2
--- binutils.orig/ld/testsuite/ld-x86-64/ibt-plt-3d.d	2020-04-07 11:32:17.438775228 +0100
0519c2
+++ binutils-2.30/ld/testsuite/ld-x86-64/ibt-plt-3d.d	2020-04-07 13:34:03.909784017 +0100
0519c2
@@ -1,6 +1,6 @@
0519c2
 #source: ibt-plt-3.s
0519c2
 #as: --64 -defsym __64_bit__=1
0519c2
-#ld: -shared -m elf_x86_64 -z ibt --hash-style=sysv
0519c2
+#ld: -shared -m elf_x86_64 -z ibt --hash-style=sysv -z max-page-size=0x200000 -z noseparate-code
0519c2
 #readelf: -wf -n
0519c2
 
0519c2
 Contents of the .eh_frame section:
0519c2
@@ -18,25 +18,25 @@ Contents of the .eh_frame section:
0519c2
   DW_CFA_nop
0519c2
   DW_CFA_nop
0519c2
 
0519c2
-0+18 0000000000000014 0000001c FDE cie=00000000 pc=00000000000002e0..00000000000002f2
0519c2
-  DW_CFA_advance_loc: 4 to 00000000000002e4
0519c2
+0+18 0000000000000014 0000001c FDE cie=00000000 pc=[a-f0-9]+\.\.[a-f0-9]+
0519c2
+  DW_CFA_advance_loc: 4 to [a-f0-9]+
0519c2
   DW_CFA_def_cfa_offset: 16
0519c2
-  DW_CFA_advance_loc: 9 to 00000000000002ed
0519c2
+  DW_CFA_advance_loc: 9 to [a-f0-9]+
0519c2
   DW_CFA_def_cfa_offset: 8
0519c2
   DW_CFA_nop
0519c2
 
0519c2
-0+30 0000000000000024 00000034 FDE cie=00000000 pc=0000000000000290..00000000000002c0
0519c2
+0+30 0000000000000024 00000034 FDE cie=00000000 pc=[a-f0-9]+\.\.[a-f0-9]+
0519c2
   DW_CFA_def_cfa_offset: 16
0519c2
-  DW_CFA_advance_loc: 6 to 0000000000000296
0519c2
+  DW_CFA_advance_loc: 6 to [a-f0-9]+
0519c2
   DW_CFA_def_cfa_offset: 24
0519c2
-  DW_CFA_advance_loc: 10 to 00000000000002a0
0519c2
+  DW_CFA_advance_loc: 10 to [a-f0-9]+
0519c2
   DW_CFA_def_cfa_expression \(DW_OP_breg7 \(rsp\): 8; DW_OP_breg16 \(rip\): 0; DW_OP_lit15; DW_OP_and; DW_OP_lit10; DW_OP_ge; DW_OP_lit3; DW_OP_shl; DW_OP_plus\)
0519c2
   DW_CFA_nop
0519c2
   DW_CFA_nop
0519c2
   DW_CFA_nop
0519c2
   DW_CFA_nop
0519c2
 
0519c2
-0+58 0000000000000010 0000005c FDE cie=00000000 pc=00000000000002c0..00000000000002e0
0519c2
+0+58 0000000000000010 0000005c FDE cie=00000000 pc=[a-f0-9]+\.\.[a-f0-9]+
0519c2
   DW_CFA_nop
0519c2
   DW_CFA_nop
0519c2
   DW_CFA_nop
0519c2
diff -rup binutils.orig/ld/testsuite/ld-x86-64/pr23372a-x32.d binutils-2.30/ld/testsuite/ld-x86-64/pr23372a-x32.d
0519c2
--- binutils.orig/ld/testsuite/ld-x86-64/pr23372a-x32.d	2020-04-07 11:32:17.435775250 +0100
0519c2
+++ binutils-2.30/ld/testsuite/ld-x86-64/pr23372a-x32.d	2020-04-07 13:34:03.909784017 +0100
0519c2
@@ -3,3 +3,8 @@
0519c2
 #as: --x32
0519c2
 #ld: -r -m elf32_x86_64
0519c2
 #readelf: -n
0519c2
+
0519c2
+Displaying notes found in: .note.gnu.property
0519c2
+  Owner                 Data size	Description
0519c2
+  GNU                  0x[0-9a-f]+	NT_GNU_PROPERTY_TYPE_0
0519c2
+      Properties: x86 ISA used: 
0519c2
diff -rup binutils.orig/ld/testsuite/ld-x86-64/pr23372a.d binutils-2.30/ld/testsuite/ld-x86-64/pr23372a.d
0519c2
--- binutils.orig/ld/testsuite/ld-x86-64/pr23372a.d	2020-04-07 11:32:17.439775221 +0100
0519c2
+++ binutils-2.30/ld/testsuite/ld-x86-64/pr23372a.d	2020-04-07 13:34:03.909784017 +0100
0519c2
@@ -3,3 +3,8 @@
0519c2
 #as: --64 -defsym __64_bit__=1
0519c2
 #ld: -r -m elf_x86_64
0519c2
 #readelf: -n
0519c2
+
0519c2
+Displaying notes found in: .note.gnu.property
0519c2
+  Owner                 Data size	Description
0519c2
+  GNU                  0x[0-9a-f]+	NT_GNU_PROPERTY_TYPE_0
0519c2
+      Properties: x86 ISA used: 
0519c2
diff -rup binutils.orig/ld/testsuite/ld-x86-64/property-3.r binutils-2.30/ld/testsuite/ld-x86-64/property-3.r
0519c2
--- binutils.orig/ld/testsuite/ld-x86-64/property-3.r	2020-04-07 11:32:17.423775337 +0100
0519c2
+++ binutils-2.30/ld/testsuite/ld-x86-64/property-3.r	2020-04-07 13:34:03.909784017 +0100
0519c2
@@ -3,6 +3,5 @@ Displaying notes found in: .note.gnu.pro
0519c2
   Owner                 Data size	Description
0519c2
   GNU                  0x[0-9a-f]+	NT_GNU_PROPERTY_TYPE_0
0519c2
       Properties: stack size: 0x800000
0519c2
-	x86 ISA used: 586, SSE
0519c2
 	x86 ISA needed: i486, 586
0519c2
 #pass
0519c2
diff -rup binutils.orig/ld/testsuite/ld-x86-64/property-4.r binutils-2.30/ld/testsuite/ld-x86-64/property-4.r
0519c2
--- binutils.orig/ld/testsuite/ld-x86-64/property-4.r	2020-04-07 11:32:17.427775308 +0100
0519c2
+++ binutils-2.30/ld/testsuite/ld-x86-64/property-4.r	2020-04-07 13:34:03.909784017 +0100
0519c2
@@ -3,6 +3,5 @@ Displaying notes found in: .note.gnu.pro
0519c2
   Owner                 Data size	Description
0519c2
   GNU                  0x[0-9a-f]+	NT_GNU_PROPERTY_TYPE_0
0519c2
       Properties: stack size: 0x800000
0519c2
-	x86 ISA used: i486, 586, SSE
0519c2
 	x86 ISA needed: i486, 586, SSE
0519c2
 #pass
0519c2
diff -rup binutils.orig/ld/testsuite/ld-x86-64/property-5.r binutils-2.30/ld/testsuite/ld-x86-64/property-5.r
0519c2
--- binutils.orig/ld/testsuite/ld-x86-64/property-5.r	2020-04-07 11:32:17.437775235 +0100
0519c2
+++ binutils-2.30/ld/testsuite/ld-x86-64/property-5.r	2020-04-07 13:34:03.909784017 +0100
0519c2
@@ -3,6 +3,5 @@ Displaying notes found in: .note.gnu.pro
0519c2
   Owner                 Data size	Description
0519c2
   GNU                  0x[0-9a-f]+	NT_GNU_PROPERTY_TYPE_0
0519c2
       Properties: stack size: 0x900000
0519c2
-	x86 ISA used: i486, 586, SSE
0519c2
 	x86 ISA needed: i486, 586, SSE
0519c2
 #pass
0519c2
diff -rup binutils.orig/ld/testsuite/ld-x86-64/property-x86-ibt3a-x32.d binutils-2.30/ld/testsuite/ld-x86-64/property-x86-ibt3a-x32.d
0519c2
--- binutils.orig/ld/testsuite/ld-x86-64/property-x86-ibt3a-x32.d	2020-04-07 11:32:17.429775293 +0100
0519c2
+++ binutils-2.30/ld/testsuite/ld-x86-64/property-x86-ibt3a-x32.d	2020-04-07 13:34:03.910784010 +0100
0519c2
@@ -1,11 +1,12 @@
0519c2
 #source: property-x86-3.s
0519c2
 #source: property-x86-ibt.s
0519c2
-#as: --x32
0519c2
+#as: --x32 -mx86-used-note=yes
0519c2
 #ld: -r -m elf32_x86_64
0519c2
 #readelf: -n
0519c2
 
0519c2
 Displaying notes found in: .note.gnu.property
0519c2
   Owner                 Data size	Description
0519c2
-  GNU                  0x00000018	NT_GNU_PROPERTY_TYPE_0
0519c2
-      Properties: x86 ISA used: 586, SSE, SSE3, SSE4_1
0519c2
-	x86 ISA needed: i486, 586, SSE2, SSE3
0519c2
+  GNU                  0x00000024	NT_GNU_PROPERTY_TYPE_0
0519c2
+      Properties: x86 ISA needed: i486, 586, SSE2, SSE3
0519c2
+	x86 ISA used: <None>
0519c2
+	x86 feature used: x86
0519c2
diff -rup binutils.orig/ld/testsuite/ld-x86-64/property-x86-ibt3a.d binutils-2.30/ld/testsuite/ld-x86-64/property-x86-ibt3a.d
0519c2
--- binutils.orig/ld/testsuite/ld-x86-64/property-x86-ibt3a.d	2020-04-07 11:32:17.431775279 +0100
0519c2
+++ binutils-2.30/ld/testsuite/ld-x86-64/property-x86-ibt3a.d	2020-04-07 13:34:03.910784010 +0100
0519c2
@@ -1,11 +1,12 @@
0519c2
 #source: property-x86-3.s
0519c2
 #source: property-x86-ibt.s
0519c2
-#as: --64 -defsym __64_bit__=1
0519c2
+#as: --64 -defsym __64_bit__=1 -mx86-used-note=yes
0519c2
 #ld: -r -melf_x86_64
0519c2
 #readelf: -n
0519c2
 
0519c2
 Displaying notes found in: .note.gnu.property
0519c2
   Owner                 Data size	Description
0519c2
-  GNU                  0x00000020	NT_GNU_PROPERTY_TYPE_0
0519c2
-      Properties: x86 ISA used: 586, SSE, SSE3, SSE4_1
0519c2
-	x86 ISA needed: i486, 586, SSE2, SSE3
0519c2
+  GNU                  0x00000030	NT_GNU_PROPERTY_TYPE_0
0519c2
+      Properties: x86 ISA needed: i486, 586, SSE2, SSE3
0519c2
+	x86 ISA used: <None>
0519c2
+	x86 feature used: x86
0519c2
diff -rup binutils.orig/ld/testsuite/ld-x86-64/property-x86-ibt3b-x32.d binutils-2.30/ld/testsuite/ld-x86-64/property-x86-ibt3b-x32.d
0519c2
--- binutils.orig/ld/testsuite/ld-x86-64/property-x86-ibt3b-x32.d	2020-04-07 11:32:17.427775308 +0100
0519c2
+++ binutils-2.30/ld/testsuite/ld-x86-64/property-x86-ibt3b-x32.d	2020-04-07 13:34:03.910784010 +0100
0519c2
@@ -1,11 +1,12 @@
0519c2
 #source: property-x86-ibt.s
0519c2
 #source: property-x86-3.s
0519c2
-#as: --x32
0519c2
+#as: --x32 -mx86-used-note=yes
0519c2
 #ld: -r -m elf32_x86_64
0519c2
 #readelf: -n
0519c2
 
0519c2
 Displaying notes found in: .note.gnu.property
0519c2
   Owner                 Data size	Description
0519c2
-  GNU                  0x00000018	NT_GNU_PROPERTY_TYPE_0
0519c2
-      Properties: x86 ISA used: 586, SSE, SSE3, SSE4_1
0519c2
-	x86 ISA needed: i486, 586, SSE2, SSE3
0519c2
+  GNU                  0x00000024	NT_GNU_PROPERTY_TYPE_0
0519c2
+      Properties: x86 ISA needed: i486, 586, SSE2, SSE3
0519c2
+	x86 ISA used: <None>
0519c2
+	x86 feature used: x86
0519c2
diff -rup binutils.orig/ld/testsuite/ld-x86-64/property-x86-ibt3b.d binutils-2.30/ld/testsuite/ld-x86-64/property-x86-ibt3b.d
0519c2
--- binutils.orig/ld/testsuite/ld-x86-64/property-x86-ibt3b.d	2020-04-07 11:32:17.423775337 +0100
0519c2
+++ binutils-2.30/ld/testsuite/ld-x86-64/property-x86-ibt3b.d	2020-04-07 13:34:03.910784010 +0100
0519c2
@@ -1,11 +1,12 @@
0519c2
 #source: property-x86-ibt.s
0519c2
 #source: property-x86-3.s
0519c2
-#as: --64 -defsym __64_bit__=1
0519c2
+#as: --64 -defsym __64_bit__=1 -mx86-used-note=yes
0519c2
 #ld: -r -melf_x86_64
0519c2
 #readelf: -n
0519c2
 
0519c2
 Displaying notes found in: .note.gnu.property
0519c2
   Owner                 Data size	Description
0519c2
-  GNU                  0x00000020	NT_GNU_PROPERTY_TYPE_0
0519c2
-      Properties: x86 ISA used: 586, SSE, SSE3, SSE4_1
0519c2
-	x86 ISA needed: i486, 586, SSE2, SSE3
0519c2
+  GNU                  0x00000030	NT_GNU_PROPERTY_TYPE_0
0519c2
+      Properties: x86 ISA needed: i486, 586, SSE2, SSE3
0519c2
+	x86 ISA used: <None>
0519c2
+	x86 feature used: x86
0519c2
diff -rup binutils.orig/ld/testsuite/ld-x86-64/property-x86-shstk3a-x32.d binutils-2.30/ld/testsuite/ld-x86-64/property-x86-shstk3a-x32.d
0519c2
--- binutils.orig/ld/testsuite/ld-x86-64/property-x86-shstk3a-x32.d	2020-04-07 11:32:17.425775323 +0100
0519c2
+++ binutils-2.30/ld/testsuite/ld-x86-64/property-x86-shstk3a-x32.d	2020-04-07 13:34:03.910784010 +0100
0519c2
@@ -1,11 +1,12 @@
0519c2
 #source: property-x86-3.s
0519c2
 #source: property-x86-shstk.s
0519c2
-#as: --x32
0519c2
+#as: --x32 -mx86-used-note=yes
0519c2
 #ld: -r -m elf32_x86_64
0519c2
 #readelf: -n
0519c2
 
0519c2
 Displaying notes found in: .note.gnu.property
0519c2
   Owner                 Data size	Description
0519c2
-  GNU                  0x00000018	NT_GNU_PROPERTY_TYPE_0
0519c2
-      Properties: x86 ISA used: 586, SSE, SSE3, SSE4_1
0519c2
-	x86 ISA needed: i486, 586, SSE2, SSE3
0519c2
+  GNU                  0x00000024	NT_GNU_PROPERTY_TYPE_0
0519c2
+      Properties: x86 ISA needed: i486, 586, SSE2, SSE3
0519c2
+	x86 ISA used: <None>
0519c2
+	x86 feature used: x86
0519c2
diff -rup binutils.orig/ld/testsuite/ld-x86-64/property-x86-shstk3a.d binutils-2.30/ld/testsuite/ld-x86-64/property-x86-shstk3a.d
0519c2
--- binutils.orig/ld/testsuite/ld-x86-64/property-x86-shstk3a.d	2020-04-07 11:32:17.427775308 +0100
0519c2
+++ binutils-2.30/ld/testsuite/ld-x86-64/property-x86-shstk3a.d	2020-04-07 13:34:03.910784010 +0100
0519c2
@@ -1,11 +1,12 @@
0519c2
 #source: property-x86-3.s
0519c2
 #source: property-x86-shstk.s
0519c2
-#as: --64 -defsym __64_bit__=1
0519c2
+#as: --64 -defsym __64_bit__=1 -mx86-used-note=yes
0519c2
 #ld: -r -melf_x86_64
0519c2
 #readelf: -n
0519c2
 
0519c2
 Displaying notes found in: .note.gnu.property
0519c2
   Owner                 Data size	Description
0519c2
-  GNU                  0x00000020	NT_GNU_PROPERTY_TYPE_0
0519c2
-      Properties: x86 ISA used: 586, SSE, SSE3, SSE4_1
0519c2
-	x86 ISA needed: i486, 586, SSE2, SSE3
0519c2
+  GNU                  0x00000030	NT_GNU_PROPERTY_TYPE_0
0519c2
+      Properties: x86 ISA needed: i486, 586, SSE2, SSE3
0519c2
+	x86 ISA used: <None>
0519c2
+	x86 feature used: x86
0519c2
diff -rup binutils.orig/ld/testsuite/ld-x86-64/property-x86-shstk3b-x32.d binutils-2.30/ld/testsuite/ld-x86-64/property-x86-shstk3b-x32.d
0519c2
--- binutils.orig/ld/testsuite/ld-x86-64/property-x86-shstk3b-x32.d	2020-04-07 11:32:17.423775337 +0100
0519c2
+++ binutils-2.30/ld/testsuite/ld-x86-64/property-x86-shstk3b-x32.d	2020-04-07 13:34:03.910784010 +0100
0519c2
@@ -1,11 +1,12 @@
0519c2
 #source: property-x86-shstk.s
0519c2
 #source: property-x86-3.s
0519c2
-#as: --x32
0519c2
+#as: --x32 -mx86-used-note=yes
0519c2
 #ld: -r -m elf32_x86_64
0519c2
 #readelf: -n
0519c2
 
0519c2
 Displaying notes found in: .note.gnu.property
0519c2
   Owner                 Data size	Description
0519c2
-  GNU                  0x00000018	NT_GNU_PROPERTY_TYPE_0
0519c2
-      Properties: x86 ISA used: 586, SSE, SSE3, SSE4_1
0519c2
-	x86 ISA needed: i486, 586, SSE2, SSE3
0519c2
+  GNU                  0x00000024	NT_GNU_PROPERTY_TYPE_0
0519c2
+      Properties: x86 ISA needed: i486, 586, SSE2, SSE3
0519c2
+	x86 ISA used: <None>
0519c2
+	x86 feature used: x86
0519c2
diff -rup binutils.orig/ld/testsuite/ld-x86-64/property-x86-shstk3b.d binutils-2.30/ld/testsuite/ld-x86-64/property-x86-shstk3b.d
0519c2
--- binutils.orig/ld/testsuite/ld-x86-64/property-x86-shstk3b.d	2020-04-07 11:32:17.436775242 +0100
0519c2
+++ binutils-2.30/ld/testsuite/ld-x86-64/property-x86-shstk3b.d	2020-04-07 13:34:03.910784010 +0100
0519c2
@@ -1,11 +1,12 @@
0519c2
 #source: property-x86-shstk.s
0519c2
 #source: property-x86-3.s
0519c2
-#as: --64 -defsym __64_bit__=1
0519c2
+#as: --64 -defsym __64_bit__=1 -mx86-used-note=yes
0519c2
 #ld: -r -melf_x86_64
0519c2
 #readelf: -n
0519c2
 
0519c2
 Displaying notes found in: .note.gnu.property
0519c2
   Owner                 Data size	Description
0519c2
-  GNU                  0x00000020	NT_GNU_PROPERTY_TYPE_0
0519c2
-      Properties: x86 ISA used: 586, SSE, SSE3, SSE4_1
0519c2
-	x86 ISA needed: i486, 586, SSE2, SSE3
0519c2
+  GNU                  0x00000030	NT_GNU_PROPERTY_TYPE_0
0519c2
+      Properties: x86 ISA needed: i486, 586, SSE2, SSE3
0519c2
+	x86 ISA used: <None>
0519c2
+	x86 feature used: x86
03ec8d
--- /dev/null	2020-08-20 07:54:24.260993139 +0100
03ec8d
+++ binutils-2.30/gas/testsuite/gas/i386/property-1.s	2020-08-20 15:44:27.696983474 +0100
03ec8d
@@ -0,0 +1,30 @@
03ec8d
+	.section ".note.gnu.property", "a"
03ec8d
+.ifdef __64_bit__
03ec8d
+	.p2align 3
03ec8d
+.else
03ec8d
+	.p2align 2
03ec8d
+.endif
03ec8d
+	.long 1f - 0f		/* name length.  */
03ec8d
+	.long 3f - 1f		/* data length.  */
03ec8d
+	/* NT_GNU_PROPERTY_TYPE_0 */
03ec8d
+	.long 5			/* note type.  */
03ec8d
+0:
03ec8d
+	.asciz "GNU"		/* vendor name.  */
03ec8d
+1:
03ec8d
+.ifdef __64_bit__
03ec8d
+	.p2align 3
03ec8d
+.else
03ec8d
+	.p2align 2
03ec8d
+.endif
03ec8d
+	/* GNU_PROPERTY_X86_ISA_1_USED */
03ec8d
+	.long 0xc0010000	/* pr_type.  */
03ec8d
+	.long 5f - 4f		/* pr_datasz.  */
03ec8d
+4:
03ec8d
+	.long 0
03ec8d
+5:
03ec8d
+.ifdef __64_bit__
03ec8d
+	.p2align 3
03ec8d
+.else
03ec8d
+	.p2align 2
03ec8d
+.endif
03ec8d
+3:
03ec8d
--- /dev/null	2020-08-20 07:54:24.260993139 +0100
03ec8d
+++ binutils-2.30/gas/testsuite/gas/i386/property-1.d	2020-08-20 15:44:27.696983474 +0100
03ec8d
@@ -0,0 +1,8 @@
03ec8d
+#name: i386 property 1
03ec8d
+#as: -mx86-used-note=no --generate-missing-build-notes=no
03ec8d
+#readelf: -n
03ec8d
+
03ec8d
+Displaying notes found in: .note.gnu.property
03ec8d
+[ 	]+Owner[ 	]+Data size[ 	]+Description
03ec8d
+  GNU                  0x[0-9a-f]+	NT_GNU_PROPERTY_TYPE_0
03ec8d
+      Properties: x86 ISA used: <None>
03ec8d
--- /dev/null	2020-08-20 07:54:24.260993139 +0100
03ec8d
+++ binutils-2.30/gas/testsuite/gas/i386/property-2.d	2020-08-20 15:44:34.770964195 +0100
03ec8d
@@ -0,0 +1,9 @@
03ec8d
+#name: i386 property 2
03ec8d
+#as: -mx86-used-note=yes --generate-missing-build-notes=no
03ec8d
+#readelf: -n
03ec8d
+
03ec8d
+Displaying notes found in: .note.gnu.property
03ec8d
+[ 	]+Owner[ 	]+Data size[ 	]+Description
03ec8d
+  GNU                  0x[0-9a-f]+	NT_GNU_PROPERTY_TYPE_0
03ec8d
+      Properties: x86 ISA used: CMOV, SSE, SSE2, SSE3, SSSE3, SSE4_1, SSE4_2, AVX, AVX2, FMA, AVX512F, AVX512CD, AVX512ER, AVX512PF, AVX512VL, AVX512DQ, AVX512BW, AVX512_4FMAPS, AVX512_4VNNIW, AVX512_BITALG, AVX512_IFMA, AVX512_VBMI, AVX512_VBMI2, AVX512_VNNI, AVX512_BF16
03ec8d
+	x86 feature used: x86, x87, MMX, XMM, YMM, ZMM, FXSR, XSAVE, XSAVEOPT, XSAVEC
03ec8d
--- /dev/null	2020-08-20 07:54:24.260993139 +0100
03ec8d
+++ binutils-2.30/gas/testsuite/gas/i386/property-2.s	2020-08-20 15:44:34.770964195 +0100
03ec8d
@@ -0,0 +1,32 @@
03ec8d
+	.text
03ec8d
+	fsin
03ec8d
+	movq		%mm0, %mm1
03ec8d
+	fxsave		(%eax)
03ec8d
+	xsave		(%eax)
03ec8d
+	xsaveopt	(%eax)
03ec8d
+	xsavec		(%eax)
03ec8d
+	cmove		%eax,%ebx
03ec8d
+	movaps		%xmm0, %xmm1
03ec8d
+	movapd		%xmm0, %xmm1
03ec8d
+	mwait
03ec8d
+	psignb		%xmm0, %xmm1
03ec8d
+	blendvpd	%xmm0, %xmm1
03ec8d
+	pcmpgtq		%xmm0, %xmm1
03ec8d
+	vmovaps		%xmm0, %xmm1
03ec8d
+	vpabsb		%ymm0, %ymm1
03ec8d
+	vfmadd231ps	%ymm0, %ymm1, %ymm1
03ec8d
+	vmovaps		%zmm0, %zmm1
03ec8d
+	vplzcntd	%zmm0, %zmm1
03ec8d
+	vrsqrt28pd	%zmm0, %zmm1
03ec8d
+	vscatterpf0dpd	(%eax,%ymm1){%k1}
03ec8d
+	{evex} vpmovzxdq %xmm0, %xmm1
03ec8d
+	vandnpd		%zmm0, %zmm0, %zmm1
03ec8d
+	vpmaxuw		%zmm0, %zmm0, %zmm1
03ec8d
+	v4fnmaddss	(%ecx), %xmm4, %xmm1
03ec8d
+	vpopcntb	%zmm0, %zmm1
03ec8d
+	vp4dpwssd	(%ecx), %zmm0, %zmm1
03ec8d
+	vpmadd52luq	(%ecx), %zmm0, %zmm1
03ec8d
+	vpermt2b	(%ecx), %zmm0, %zmm1
03ec8d
+	vpcompressb	%zmm0, %zmm1
03ec8d
+	vpdpwssds	(%ecx), %zmm0, %zmm1
03ec8d
+	vcvtne2ps2bf16	(%ecx), %zmm0, %zmm1
03ec8d
--- /dev/null	2020-08-20 07:54:24.260993139 +0100
03ec8d
+++ binutils-2.30/ld/testsuite/ld-elf/pr23900-1-32.rd	2020-08-20 15:46:11.850699543 +0100
03ec8d
@@ -0,0 +1,14 @@
03ec8d
+#source: pr23900-1.s
03ec8d
+#ld:
03ec8d
+#readelf: -l --wide
03ec8d
+#target: *-*-linux* *-*-gnu* *-*-nacl*
03ec8d
+
03ec8d
+#...
03ec8d
+  GNU_PROPERTY .* +0x4
03ec8d
+#...
03ec8d
+ +[0-9]+ +.*\ \.note\.gnu\.property .*
03ec8d
+#...
03ec8d
+ +[0-9]+ +\.note\.gnu\.property 
03ec8d
+#...
03ec8d
+ +[0-9]+ +\.note\.gnu\.property 
03ec8d
+#...
03ec8d
--- /dev/null	2020-08-20 07:54:24.260993139 +0100
03ec8d
+++ binutils-2.30/ld/testsuite/ld-elf/pr23900-1-64.rd	2020-08-20 15:46:16.968685596 +0100
03ec8d
@@ -0,0 +1,14 @@
03ec8d
+#source: pr23900-1.s
03ec8d
+#ld:
03ec8d
+#readelf: -l --wide
03ec8d
+#target: *-*-linux* *-*-gnu* *-*-nacl*
03ec8d
+
03ec8d
+#...
03ec8d
+  GNU_PROPERTY .* +0x8
03ec8d
+#...
03ec8d
+ +[0-9]+ +.*\ \.note\.gnu\.property .*
03ec8d
+#...
03ec8d
+ +[0-9]+ +\.note\.gnu\.property 
03ec8d
+#...
03ec8d
+ +[0-9]+ +\.note\.gnu\.property 
03ec8d
+#...
03ec8d
--- /dev/null	2020-08-20 07:54:24.260993139 +0100
03ec8d
+++ binutils-2.30/ld/testsuite/ld-elf/pr23900-1.d	2020-08-20 15:46:26.546659490 +0100
03ec8d
@@ -0,0 +1,16 @@
03ec8d
+#ld:
03ec8d
+#readelf: --notes --wide -l
03ec8d
+#target: *-*-linux* *-*-gnu* *-*-nacl*
03ec8d
+
03ec8d
+#...
03ec8d
+  GNU_PROPERTY .*
03ec8d
+#...
03ec8d
+ +[0-9]+ +.*\.note\.gnu\.property.*
03ec8d
+#...
03ec8d
+ +[0-9]+ +\.note\.gnu\.property 
03ec8d
+#...
03ec8d
+ +[0-9]+ +\.note\.gnu\.property 
03ec8d
+#...
03ec8d
+Displaying notes found in: \.note\.gnu\.property
03ec8d
+[ 	]+Owner[ 	]+Data size[ 	]+Description
03ec8d
+[ 	]+GNU[ 	]+0x0+..[ 	]+NT_GNU_PROPERTY_TYPE_0[ 	]+Properties: no copy on protected 
03ec8d
--- /dev/null	2020-08-20 07:54:24.260993139 +0100
03ec8d
+++ binutils-2.30/ld/testsuite/ld-elf/pr23900-1.s	2020-08-20 15:46:30.072649878 +0100
03ec8d
@@ -0,0 +1,30 @@
03ec8d
+	.text
03ec8d
+	.global start	/* Used by SH targets.  */
03ec8d
+start:
03ec8d
+	.global _start
03ec8d
+_start:
03ec8d
+	.global __start
03ec8d
+__start:
03ec8d
+	.global main	/* Used by HPPA targets.  */
03ec8d
+main:
03ec8d
+	.globl	_main	/* Used by LynxOS targets.  */
03ec8d
+_main:
03ec8d
+	.dc.a 0
03ec8d
+
03ec8d
+	.section .note.gnu.property, "a"
03ec8d
+	.p2align ALIGN
03ec8d
+	.dc.l .L1 - .L0		/* name length.  */
03ec8d
+	.dc.l .L3 - .L1		/* data length.  */
03ec8d
+	/* NT_GNU_PROPERTY_TYPE_0 */
03ec8d
+	.dc.l 5			/* note type.  */
03ec8d
+.L0:
03ec8d
+	.asciz "GNU"		/* vendor name.  */
03ec8d
+.L1:
03ec8d
+	.p2align ALIGN
03ec8d
+	/* GNU_PROPERTY_NO_COPY_ON_PROTECTED */
03ec8d
+	.dc.l 2			/* pr_type.  */
03ec8d
+	.dc.l .L5 - .L4		/* pr_datasz.  */
03ec8d
+.L4:
03ec8d
+.L5:
03ec8d
+	.p2align ALIGN
03ec8d
+.L3:
03ec8d
--- /dev/null	2020-08-20 07:54:24.260993139 +0100
03ec8d
+++ binutils-2.30/ld/testsuite/ld-elf/pr23900-2.s	2020-08-20 15:46:36.328632828 +0100
03ec8d
@@ -0,0 +1,32 @@
03ec8d
+	.text
03ec8d
+	.global start	/* Used by SH targets.  */
03ec8d
+start:
03ec8d
+	.global _start
03ec8d
+_start:
03ec8d
+	.global __start
03ec8d
+__start:
03ec8d
+	.global main	/* Used by HPPA targets.  */
03ec8d
+main:
03ec8d
+	.globl	_main	/* Used by LynxOS targets.  */
03ec8d
+_main:
03ec8d
+	.dc.a 0
03ec8d
+
03ec8d
+	/* NB: Deliberately incorrect section name.  Should be
03ec8d
+	       .note.gnu.property.  */
03ec8d
+	.section .note, "a"
03ec8d
+	.p2align ALIGN
03ec8d
+	.dc.l .L1 - .L0		/* name length.  */
03ec8d
+	.dc.l .L3 - .L1		/* data length.  */
03ec8d
+	/* NT_GNU_PROPERTY_TYPE_0 */
03ec8d
+	.dc.l 5			/* note type.  */
03ec8d
+.L0:
03ec8d
+	.asciz "GNU"		/* vendor name.  */
03ec8d
+.L1:
03ec8d
+	.p2align ALIGN
03ec8d
+	/* GNU_PROPERTY_NO_COPY_ON_PROTECTED */
03ec8d
+	.dc.l 2			/* pr_type.  */
03ec8d
+	.dc.l .L5 - .L4		/* pr_datasz.  */
03ec8d
+.L4:
03ec8d
+.L5:
03ec8d
+	.p2align ALIGN
03ec8d
+.L3:
03ec8d
--- /dev/null	2020-08-20 07:54:24.260993139 +0100
03ec8d
+++ binutils-2.30/ld/testsuite/ld-elf/pr23900-2a.d	2020-08-20 15:46:42.642615623 +0100
03ec8d
@@ -0,0 +1,9 @@
03ec8d
+#source: pr23900-2.s
03ec8d
+#ld:
03ec8d
+#readelf: --notes --wide
03ec8d
+#target: *-*-linux* *-*-gnu* *-*-nacl*
03ec8d
+
03ec8d
+#...
03ec8d
+Displaying notes found in: \.note
03ec8d
+[ 	]+Owner[ 	]+Data size[ 	]+Description
03ec8d
+[ 	]+GNU[ 	]+0x0+..[ 	]+NT_GNU_PROPERTY_TYPE_0[ 	]+Properties: no copy on protected 
03ec8d
--- /dev/null	2020-08-20 07:54:24.260993139 +0100
03ec8d
+++ binutils-2.30/ld/testsuite/ld-elf/pr23900-2b.d	2020-08-20 15:46:48.738599006 +0100
03ec8d
@@ -0,0 +1,9 @@
03ec8d
+#source: pr23900-2.s
03ec8d
+#ld:
03ec8d
+#readelf: -l --wide
03ec8d
+#target: *-*-linux* *-*-gnu* *-*-nacl*
03ec8d
+
03ec8d
+#failif
03ec8d
+#...
03ec8d
+  GNU_PROPERTY .*
03ec8d
+#...
03ec8d
--- /dev/null	2020-08-20 07:54:24.260993139 +0100
03ec8d
+++ binutils-2.30/ld/testsuite/ld-elf/stack-noexec.rd	2020-08-20 15:46:59.907568567 +0100
03ec8d
@@ -0,0 +1,3 @@
03ec8d
+#...
03ec8d
+  GNU_STACK      0x0+00000 0x0+000000 0x0+000000 0x0+000 0x.+0000 RW  0x[0-9a-f]+
03ec8d
+#pass