+
+/* Fix up x86 GNU properties. */
+
+void
+_bfd_x86_elf_link_fixup_gnu_properties (struct bfd_link_info *info,
+ elf_property_list **listp)
+{
+ elf_property_list *p;
+
+ for (p = *listp; p; p = p->next)
+ {
+ unsigned int type = p->property.pr_type;
+ if (type == GNU_PROPERTY_X86_COMPAT_ISA_1_USED
+ || type == GNU_PROPERTY_X86_COMPAT_ISA_1_NEEDED
+ || (type >= GNU_PROPERTY_X86_UINT32_AND_LO
+ && type <= GNU_PROPERTY_X86_UINT32_AND_HI)
+ || (type >= GNU_PROPERTY_X86_UINT32_OR_LO
+ && type <= GNU_PROPERTY_X86_UINT32_OR_HI)
+ || (type >= GNU_PROPERTY_X86_UINT32_OR_AND_LO
+ && type <= GNU_PROPERTY_X86_UINT32_OR_AND_HI))
+ {
+ if (p->property.u.number == 0)
+ {
+ /* Remove empty property. */
+ *listp = p->next;
+ continue;
+ }
+
+ /* Mark x86-specific properties with X86_UINT32_VALID for
+ non-relocatable output. */
+ if (!bfd_link_relocatable (info))
+ p->property.u.number |= GNU_PROPERTY_X86_UINT32_VALID;
+
+ listp = &p->next;
+ }
+ else if (type > GNU_PROPERTY_HIPROC)
+ {
+ /* The property list is sorted in order of type. */
+ break;
+ }
+ }
+}