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


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

Re: [PATCH] x86: Don't remove empty x86 properties


> > The way you've defined the values, ISA_1_USED uses the OR_AND rule,
> > which implements the behavior you want for ISA_1_NEEDED. ISA_1_NEEDED
> > uses the OR rule, which implements the behavior you want for
> > ISA_1_USED. Likewise for FEATURE_2_USED and FEATURE_2_NEEDED.
>
> I committed a typo fix.  Now it reads
>
> GNU_PROPERTY_X86_FEATURE_2_NEEDED The x86 processor features in-
> dicated by the corresponding bits are needed in program and they must be
> supported by the hardware. Loader may refuse to load the program whose
> GNU_PROPERTY_X86_FEATURE_2_NEEDED features aren’t supported by the
> hardware.
> GNU_PROPERTY_X86_ISA_1_NEEDED The x86 instruction sets indicated
> by the corresponding bits are needed in program and they must be sup-
> ported by the hardware.
> Loader may refuse to load the program whose
> GNU_PROPERTY_X86_ISA_1_NEEDED ISAs aren’t supported by the hardware.

That doesn't fix a thing. Here's the fix you need:

   Table 5.3: Program Property Types
   Name                               Value
   GNU_PROPERTY_X86_FEATURE_1_AND     GNU_PROPERTY_X86_UINT32_AND_LO + 0
-   GNU_PROPERTY_X86_FEATURE_2_USED    GNU_PROPERTY_X86_UINT32_OR_AND_LO + 1
+  GNU_PROPERTY_X86_FEATURE_2_USED    GNU_PROPERTY_X86_UINT32_OR_LO + 1
-   GNU_PROPERTY_X86_FEATURE_2_NEEDED  GNU_PROPERTY_X86_UINT32_OR_LO + 1
+  GNU_PROPERTY_X86_FEATURE_2_NEEDED  GNU_PROPERTY_X86_UINT32_OR_AND_LO + 1
-   GNU_PROPERTY_X86_ISA_1_USED        GNU_PROPERTY_X86_UINT32_OR_AND_LO + 0
+  GNU_PROPERTY_X86_ISA_1_USED        GNU_PROPERTY_X86_UINT32_OR_LO + 0
-   GNU_PROPERTY_X86_ISA_1_NEEDED      GNU_PROPERTY_X86_UINT32_OR_LO + 0
+  GNU_PROPERTY_X86_ISA_1_NEEDED      GNU_PROPERTY_X86_UINT32_OR_AND_LO + 0

And this:

--- a/bfd/elfxx-x86.c
+++ b/bfd/elfxx-x86.c
@@ -2408,7 +2408,7 @@ _bfd_x86_elf_merge_gnu_properties (struct
bfd_link_info *info,
   bfd_boolean updated = FALSE;
   unsigned int pr_type = aprop != NULL ? aprop->pr_type : bprop->pr_type;

-  if (pr_type == GNU_PROPERTY_X86_COMPAT_ISA_1_USED
+  if (pr_type == GNU_PROPERTY_X86_COMPAT_ISA_1_NEEDED
       || (pr_type >= GNU_PROPERTY_X86_UINT32_OR_AND_LO
          && pr_type <= GNU_PROPERTY_X86_UINT32_OR_AND_HI))
     {
@@ -2426,7 +2426,7 @@ _bfd_x86_elf_merge_gnu_properties (struct
bfd_link_info *info,
        }
       goto or_property;
     }
-  else if (pr_type == GNU_PROPERTY_X86_COMPAT_ISA_1_NEEDED
+  else if (pr_type == GNU_PROPERTY_X86_COMPAT_ISA_1_USED
           || (pr_type >= GNU_PROPERTY_X86_UINT32_OR_LO
               && pr_type <= GNU_PROPERTY_X86_UINT32_OR_HI))
     {

-cary


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