diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2018-08-24 04:41:50 -0700 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2018-08-24 04:42:15 -0700 |
commit | a9eafb08b3f3dd4cd59757f0b99b44e896d620f1 (patch) | |
tree | 0d114c314acfa1f1324028d87a25ffe697b1caeb /binutils | |
parent | aa7bca9b2e30cf128966631382731369f7b753d8 (diff) | |
download | gdb-a9eafb08b3f3dd4cd59757f0b99b44e896d620f1.zip gdb-a9eafb08b3f3dd4cd59757f0b99b44e896d620f1.tar.gz gdb-a9eafb08b3f3dd4cd59757f0b99b44e896d620f1.tar.bz2 |
x86: Update GNU_PROPERTY_X86_XXX macros
This patch updates GNU_PROPERTY_X86_XXX macros:
1. GNU_PROPERTY_X86_UINT32_AND_XXX: A 4-byte unsigned integer property.
A bit is set if it is set in all relocatable inputs:
#define GNU_PROPERTY_X86_UINT32_AND_LO 0xc0000002
#define GNU_PROPERTY_X86_UINT32_AND_HI 0xc0007fff
2. GNU_PROPERTY_X86_UINT32_OR_XXX: A 4-byte unsigned integer property.
A bit is set if it is set in any relocatable inputs:
#define GNU_PROPERTY_X86_UINT32_OR_LO 0xc0008000
#define GNU_PROPERTY_X86_UINT32_OR_HI 0xc000ffff
3. GNU_PROPERTY_X86_UINT32_OR_AND_XXX: A 4-byte unsigned integer property.
A bit is set if it is set in any relocatable inputs and the property is
present in all relocatable inputs:
#define GNU_PROPERTY_X86_UINT32_OR_AND_LO 0xc0010000
#define GNU_PROPERTY_X86_UINT32_OR_AND_HI 0xc0017fff
4. GNU_PROPERTY_X86_FEATURE_2_NEEDED, GNU_PROPERTY_X86_FEATURE_2_USED
and GNU_PROPERTY_X86_FEATURE_2_XXX bits.
GNU_PROPERTY_X86_FEATURE_1_AND is unchanged. GNU_PROPERTY_X86_ISA_1_USED
and GNU_PROPERTY_X86_ISA_1_NEEDED are updated to better support targeted
processors since GNU_PROPERTY_X86_ISA_1_?86 aren't isn't very useful.
A new set of GNU_PROPERTY_X86_ISA_1_XXX bits are defined. The previous
GNU_PROPERTY_X86_ISA_1_XXX macros are deprecated and renamed to
GNU_PROPERTY_X86_COMPAT_ISA_1_XXX.
bfd/
* elfxx-x86.c (_bfd_x86_elf_parse_gnu_properties): Handle
X86_COMPAT_ISA_1_USED, X86_COMPAT_ISA_1_NEEDED,
X86_UINT32_AND_LO, X86_UINT32_AND_HI, X86_UINT32_OR_LO,
X86_UINT32_OR_HI, X86_UINT32_OR_AND_LO and X86_UINT32_OR_AND_HI
instead of X86_ISA_1_USED, X86_ISA_1_NEEDED and X86_FEATURE_1_AND.
(_bfd_x86_elf_merge_gnu_properties): Likewise.
(_bfd_x86_elf_link_setup_gnu_properties): Add X86_FEATURE_2_NEEDED
instead of X86_ISA_1_NEEDED.
(_bfd_x86_elf_link_fixup_gnu_properties): Handle
X86_COMPAT_ISA_1_USED, X86_COMPAT_ISA_1_NEEDED, X86_UINT32_AND_LO,
X86_UINT32_AND_HI, X86_UINT32_OR_LO, X86_UINT32_OR_HI,
X86_UINT32_OR_AND_LO and X86_UINT32_OR_AND_HI instead of
X86_ISA_1_USED, X86_ISA_1_NEEDED and X86_FEATURE_1_AND.
binutils/
* readelf.c (decode_x86_compat_isa): New function.
(decode_x86_feature_2): Likewise.
(decode_x86_isa): Updated for new X86_ISA_1_XXX bits.
(decode_x86_feature): Renamed to ...
(decode_x86_feature_1): This. Remove the type argument.
(print_gnu_property_note): Handle X86_COMPAT_ISA_1_USED,
X86_COMPAT_ISA_1_NEEDED, X86_UINT32_AND_LO, X86_UINT32_AND_HI,
X86_UINT32_OR_LO, X86_UINT32_OR_HI, X86_UINT32_OR_AND_LO and
X86_UINT32_OR_AND_HI instead of X86_ISA_1_USED, X86_ISA_1_NEEDED
and X86_FEATURE_1_AND.
* testsuite/binutils-all/i386/pr21231b.s: Updated to the current
GNU_PROPERTY_X86_ISA_1_USED and GNU_PROPERTY_X86_ISA_1_NEEDED
values.
* testsuite/binutils-all/x86-64/pr21231b.s: Likewise.
* testsuite/binutils-all/x86-64/pr23494a.s: Likewise.
* testsuite/binutils-all/x86-64/pr23494b.s: Likewise.
* testsuite/binutils-all/x86-64/pr23494c.s: Likewise.
* testsuite/binutils-all/i386/pr21231b.d: Updated.
* testsuite/binutils-all/x86-64/pr21231b.d: Likewise.
* testsuite/binutils-all/x86-64/pr23494a-x32.d: Likewise.
* testsuite/binutils-all/x86-64/pr23494a.d: Likewise.
* testsuite/binutils-all/x86-64/pr23494c-x32.d: Likewise.
* testsuite/binutils-all/x86-64/pr23494c.d: Likewise.
* testsuite/binutils-all/x86-64/pr23494d-x32.d: Likewise.
* testsuite/binutils-all/x86-64/pr23494d.d: Likewise.
* testsuite/binutils-all/x86-64/pr23494e-x32.d: Likewise.
* testsuite/binutils-all/x86-64/pr23494e.d: Likewise.
include/
* elf/common.h (GNU_PROPERTY_X86_ISA_1_USED): Renamed to ...
(GNU_PROPERTY_X86_COMPAT_ISA_1_USED): This.
(GNU_PROPERTY_X86_ISA_1_NEEDED): Renamed to ...
(GNU_PROPERTY_X86_COMPAT_ISA_1_NEEDED): This.
(GNU_PROPERTY_X86_ISA_1_XXX): Renamed to ...
(GNU_PROPERTY_X86_COMPAT_ISA_1_XXX): This.
(GNU_PROPERTY_X86_UINT32_AND_LO): New.
(GNU_PROPERTY_X86_UINT32_AND_HI): Likewise.
(GNU_PROPERTY_X86_UINT32_OR_LO): Likewise.
(GNU_PROPERTY_X86_UINT32_OR_HI): Likewise.
(GNU_PROPERTY_X86_UINT32_OR_AND_LO): Likewise.
(GNU_PROPERTY_X86_UINT32_OR_AND_HI): Likewise.
(GNU_PROPERTY_X86_ISA_1_CMOV): Likewise.
(GNU_PROPERTY_X86_ISA_1_SSE): Likewise.
(GNU_PROPERTY_X86_ISA_1_SSE2): Likewise.
(GNU_PROPERTY_X86_ISA_1_SSE3): Likewise.
(GNU_PROPERTY_X86_ISA_1_SSSE3): Likewise.
(GNU_PROPERTY_X86_ISA_1_SSE4_1): Likewise.
(GNU_PROPERTY_X86_ISA_1_SSE4_2): Likewise.
(GNU_PROPERTY_X86_ISA_1_AVX): Likewise.
(GNU_PROPERTY_X86_ISA_1_AVX2): Likewise.
(GNU_PROPERTY_X86_ISA_1_FMA): Likewise.
(GNU_PROPERTY_X86_ISA_1_AVX512F): Likewise.
(GNU_PROPERTY_X86_ISA_1_AVX512CD): Likewise.
(GNU_PROPERTY_X86_ISA_1_AVX512ER): Likewise.
(GNU_PROPERTY_X86_ISA_1_AVX512PF): Likewise.
(GNU_PROPERTY_X86_ISA_1_AVX512VL): Likewise.
(GNU_PROPERTY_X86_ISA_1_AVX512DQ): Likewise.
(GNU_PROPERTY_X86_ISA_1_AVX512BW): Likewise.
(GNU_PROPERTY_X86_ISA_1_AVX512_4FMAPS): Likewise.
(GNU_PROPERTY_X86_ISA_1_AVX512_4VNNIW): Likewise.
(GNU_PROPERTY_X86_ISA_1_AVX512_BITALG): Likewise.
(GNU_PROPERTY_X86_ISA_1_AVX512_IFMA): Likewise.
(GNU_PROPERTY_X86_ISA_1_AVX512_VBMI): Likewise.
(GNU_PROPERTY_X86_ISA_1_AVX512_VBMI2): Likewise.
(GNU_PROPERTY_X86_ISA_1_AVX512_VNNI): Likewise.
(GNU_PROPERTY_X86_FEATURE_2_X86): Likewise.
(GNU_PROPERTY_X86_FEATURE_2_X87): Likewise.
(GNU_PROPERTY_X86_FEATURE_2_MMX): Likewise.
(GNU_PROPERTY_X86_FEATURE_2_XMM): Likewise.
(GNU_PROPERTY_X86_FEATURE_2_YMM): Likewise.
(GNU_PROPERTY_X86_FEATURE_2_ZMM): Likewise.
(GNU_PROPERTY_X86_FEATURE_2_FXSR): Likewise.
(GNU_PROPERTY_X86_FEATURE_2_XSAVE): Likewise.
(GNU_PROPERTY_X86_FEATURE_2_XSAVEOPT): Likewise.
(GNU_PROPERTY_X86_FEATURE_2_XSAVEC): Likewise.
(GNU_PROPERTY_X86_FEATURE_1_AND): Updated to
(GNU_PROPERTY_X86_UINT32_AND_LO + 0).
(GNU_PROPERTY_X86_ISA_1_NEEDED): Defined to
(GNU_PROPERTY_X86_UINT32_OR_LO + 0).
(GNU_PROPERTY_X86_FEATURE_2_NEEDED): New. Defined to
(GNU_PROPERTY_X86_UINT32_OR_LO + 1).
(GNU_PROPERTY_X86_ISA_1_USED): Defined to
(GNU_PROPERTY_X86_UINT32_OR_AND_LO + 0).
(GNU_PROPERTY_X86_FEATURE_2_USED): New. Defined to
(GNU_PROPERTY_X86_UINT32_OR_AND_LO + 1).
ld/
* testsuite/ld-i386/i386.exp: Run pr23372c, pr23372d, pr23486c
and pr23486d.
* testsuite/ld-i386/pr23372a.s: Update comments.
* testsuite/ld-i386/pr23372b.s: Likewise.
* testsuite/ld-i386/pr23372c.s: Likewise.
* testsuite/ld-x86-64/pr23372a.s: Likewise.
* testsuite/ld-x86-64/pr23372b.s: Likewise.
* testsuite/ld-x86-64/pr23372c.s: Likewise.
* testsuite/ld-x86-64/pr23486a.s: Likewise.
* testsuite/ld-x86-64/pr23486b.s: Likewise.
* testsuite/ld-i386/pr23372c.d: New file.
* testsuite/ld-i386/pr23372d.d: Likewise.
* testsuite/ld-i386/pr23486c.d: Likewise.
* testsuite/ld-i386/pr23486d.d: Likewise.
* testsuite/ld-x86-64/pr23372c-x32.d: Likewise.
* testsuite/ld-x86-64/pr23372c.d: Likewise.
* testsuite/ld-x86-64/pr23372d-x32.d: Likewise.
* testsuite/ld-x86-64/pr23372d.d: Likewise.
* testsuite/ld-x86-64/pr23372d.s: Likewise.
* testsuite/ld-x86-64/pr23372e.s: Likewise.
* testsuite/ld-x86-64/pr23372f.s: Likewise.
* testsuite/ld-x86-64/pr23486c-x32.d: Likewise.
* testsuite/ld-x86-64/pr23486c.d: Likewise.
* testsuite/ld-x86-64/pr23486c.s: Likewise.
* testsuite/ld-x86-64/pr23486d-x32.d: Likewise.
* testsuite/ld-x86-64/pr23486d.d: Likewise.
* testsuite/ld-x86-64/pr23486d.s: Likewise.
* testsuite/ld-i386/property-3.r: Updated.
* testsuite/ld-i386/property-4.r: Likewise.
* testsuite/ld-i386/property-5.r: Likewise.
* testsuite/ld-i386/property-x86-3.d: Likewise.
* testsuite/ld-i386/property-x86-ibt3a.d: Likewise.
* testsuite/ld-i386/property-x86-shstk3a.d: Likewise.
* testsuite/ld-i386/property-x86-shstk3b.d: Likewise.
* testsuite/ld-x86-64/property-3.r: Likewise.
* testsuite/ld-x86-64/property-4.r: Likewise.
* testsuite/ld-x86-64/property-5.r: Likewise.
* testsuite/ld-x86-64/property-x86-3-x32.d: Likewise.
* testsuite/ld-x86-64/property-x86-3.d: Likewise.
* testsuite/ld-x86-64/property-x86-ibt3a-x32.d: Likewise.
* testsuite/ld-x86-64/property-x86-ibt3a.d: Likewise.
* testsuite/ld-x86-64/property-x86-ibt3b-x32.d: Likewise.
* testsuite/ld-x86-64/property-x86-ibt3b.d: Likewise.
* testsuite/ld-x86-64/property-x86-shstk3a-x32.d: Likewise.
* testsuite/ld-x86-64/property-x86-shstk3a.d: Likewise.
* testsuite/ld-x86-64/property-x86-shstk3b-x32.d: Likewise.
* testsuite/ld-x86-64/property-x86-shstk3b.d: Likewise.
* testsuite/ld-i386/property-x86-1.S: Updated to the current
GNU_PROPERTY_X86_ISA_1_USED and GNU_PROPERTY_X86_ISA_1_NEEDED
values.
* testsuite/ld-i386/property-x86-2.S: Likewise.
* testsuite/ld-i386/property-x86-3.s: Likewise.
* testsuite/ld-x86-64/property-x86-1.S: Likewise.
* testsuite/ld-x86-64/property-x86-2.S: Likewise.
* testsuite/ld-x86-64/property-x86-3.s: Likewise.
* ld/testsuite/ld-x86-64/x86-64.exp: Run pr23372c, pr23372c-x32,
pr23372d, pr23372d-x32, pr23486c, pr23486c-x32, pr23486d and
pr23486d-x32.
Diffstat (limited to 'binutils')
-rw-r--r-- | binutils/ChangeLog | 30 | ||||
-rw-r--r-- | binutils/readelf.c | 275 | ||||
-rw-r--r-- | binutils/testsuite/binutils-all/i386/pr21231b.d | 4 | ||||
-rw-r--r-- | binutils/testsuite/binutils-all/i386/pr21231b.s | 4 | ||||
-rw-r--r-- | binutils/testsuite/binutils-all/x86-64/pr21231b.d | 4 | ||||
-rw-r--r-- | binutils/testsuite/binutils-all/x86-64/pr21231b.s | 4 | ||||
-rw-r--r-- | binutils/testsuite/binutils-all/x86-64/pr23494a-x32.d | 4 | ||||
-rw-r--r-- | binutils/testsuite/binutils-all/x86-64/pr23494a.d | 4 | ||||
-rw-r--r-- | binutils/testsuite/binutils-all/x86-64/pr23494a.s | 6 | ||||
-rw-r--r-- | binutils/testsuite/binutils-all/x86-64/pr23494b.s | 2 | ||||
-rw-r--r-- | binutils/testsuite/binutils-all/x86-64/pr23494c-x32.d | 2 | ||||
-rw-r--r-- | binutils/testsuite/binutils-all/x86-64/pr23494c.d | 2 | ||||
-rw-r--r-- | binutils/testsuite/binutils-all/x86-64/pr23494c.s | 6 | ||||
-rw-r--r-- | binutils/testsuite/binutils-all/x86-64/pr23494d-x32.d | 4 | ||||
-rw-r--r-- | binutils/testsuite/binutils-all/x86-64/pr23494d.d | 4 | ||||
-rw-r--r-- | binutils/testsuite/binutils-all/x86-64/pr23494e-x32.d | 4 | ||||
-rw-r--r-- | binutils/testsuite/binutils-all/x86-64/pr23494e.d | 4 |
17 files changed, 296 insertions, 67 deletions
diff --git a/binutils/ChangeLog b/binutils/ChangeLog index 76af83b..3e26571 100644 --- a/binutils/ChangeLog +++ b/binutils/ChangeLog @@ -1,5 +1,35 @@ 2018-08-24 H.J. Lu <hongjiu.lu@intel.com> + * readelf.c (decode_x86_compat_isa): New function. + (decode_x86_feature_2): Likewise. + (decode_x86_isa): Updated for new X86_ISA_1_XXX bits. + (decode_x86_feature): Renamed to ... + (decode_x86_feature_1): This. Remove the type argument. + (print_gnu_property_note): Handle X86_COMPAT_ISA_1_USED, + X86_COMPAT_ISA_1_NEEDED, X86_UINT32_AND_LO, X86_UINT32_AND_HI, + X86_UINT32_OR_LO, X86_UINT32_OR_HI, X86_UINT32_OR_AND_LO and + X86_UINT32_OR_AND_HI instead of X86_ISA_1_USED, X86_ISA_1_NEEDED + and X86_FEATURE_1_AND. + * testsuite/binutils-all/i386/pr21231b.s: Updated to the current + GNU_PROPERTY_X86_ISA_1_USED and GNU_PROPERTY_X86_ISA_1_NEEDED + values. + * testsuite/binutils-all/x86-64/pr21231b.s: Likewise. + * testsuite/binutils-all/x86-64/pr23494a.s: Likewise. + * testsuite/binutils-all/x86-64/pr23494b.s: Likewise. + * testsuite/binutils-all/x86-64/pr23494c.s: Likewise. + * testsuite/binutils-all/i386/pr21231b.d: Updated. + * testsuite/binutils-all/x86-64/pr21231b.d: Likewise. + * testsuite/binutils-all/x86-64/pr23494a-x32.d: Likewise. + * testsuite/binutils-all/x86-64/pr23494a.d: Likewise. + * testsuite/binutils-all/x86-64/pr23494c-x32.d: Likewise. + * testsuite/binutils-all/x86-64/pr23494c.d: Likewise. + * testsuite/binutils-all/x86-64/pr23494d-x32.d: Likewise. + * testsuite/binutils-all/x86-64/pr23494d.d: Likewise. + * testsuite/binutils-all/x86-64/pr23494e-x32.d: Likewise. + * testsuite/binutils-all/x86-64/pr23494e.d: Likewise. + +2018-08-24 H.J. Lu <hongjiu.lu@intel.com> + * readelf.c (print_gnu_property_note): Check the GNU_PROPERTY_X86_UINT32_VALID bit for invalid GNU property note. diff --git a/binutils/readelf.c b/binutils/readelf.c index df94652..8d4054f 100644 --- a/binutils/readelf.c +++ b/binutils/readelf.c @@ -16947,6 +16947,77 @@ get_gnu_elf_note_type (unsigned e_type) } static void +decode_x86_compat_isa (unsigned int bitmask) +{ + while (bitmask) + { + unsigned int bit = bitmask & (- bitmask); + + bitmask &= ~ bit; + switch (bit) + { + case GNU_PROPERTY_X86_COMPAT_ISA_1_486: + printf ("i486"); + break; + case GNU_PROPERTY_X86_COMPAT_ISA_1_586: + printf ("586"); + break; + case GNU_PROPERTY_X86_COMPAT_ISA_1_686: + printf ("686"); + break; + case GNU_PROPERTY_X86_COMPAT_ISA_1_SSE: + printf ("SSE"); + break; + case GNU_PROPERTY_X86_COMPAT_ISA_1_SSE2: + printf ("SSE2"); + break; + case GNU_PROPERTY_X86_COMPAT_ISA_1_SSE3: + printf ("SSE3"); + break; + case GNU_PROPERTY_X86_COMPAT_ISA_1_SSSE3: + printf ("SSSE3"); + break; + case GNU_PROPERTY_X86_COMPAT_ISA_1_SSE4_1: + printf ("SSE4_1"); + break; + case GNU_PROPERTY_X86_COMPAT_ISA_1_SSE4_2: + printf ("SSE4_2"); + break; + case GNU_PROPERTY_X86_COMPAT_ISA_1_AVX: + printf ("AVX"); + break; + case GNU_PROPERTY_X86_COMPAT_ISA_1_AVX2: + printf ("AVX2"); + break; + case GNU_PROPERTY_X86_COMPAT_ISA_1_AVX512F: + printf ("AVX512F"); + break; + case GNU_PROPERTY_X86_COMPAT_ISA_1_AVX512CD: + printf ("AVX512CD"); + break; + case GNU_PROPERTY_X86_COMPAT_ISA_1_AVX512ER: + printf ("AVX512ER"); + break; + case GNU_PROPERTY_X86_COMPAT_ISA_1_AVX512PF: + printf ("AVX512PF"); + break; + case GNU_PROPERTY_X86_COMPAT_ISA_1_AVX512VL: + printf ("AVX512VL"); + break; + case GNU_PROPERTY_X86_COMPAT_ISA_1_AVX512DQ: + printf ("AVX512DQ"); + break; + case GNU_PROPERTY_X86_COMPAT_ISA_1_AVX512BW: + printf ("AVX512BW"); + break; + default: printf (_("<unknown: %x>"), bit); break; + } + if (bitmask) + printf (", "); + } +} + +static void decode_x86_isa (unsigned int bitmask) { while (bitmask) @@ -16956,24 +17027,78 @@ decode_x86_isa (unsigned int bitmask) bitmask &= ~ bit; switch (bit) { - case GNU_PROPERTY_X86_ISA_1_486: printf ("i486"); break; - case GNU_PROPERTY_X86_ISA_1_586: printf ("586"); break; - case GNU_PROPERTY_X86_ISA_1_686: printf ("686"); break; - case GNU_PROPERTY_X86_ISA_1_SSE: printf ("SSE"); break; - case GNU_PROPERTY_X86_ISA_1_SSE2: printf ("SSE2"); break; - case GNU_PROPERTY_X86_ISA_1_SSE3: printf ("SSE3"); break; - case GNU_PROPERTY_X86_ISA_1_SSSE3: printf ("SSSE3"); break; - case GNU_PROPERTY_X86_ISA_1_SSE4_1: printf ("SSE4_1"); break; - case GNU_PROPERTY_X86_ISA_1_SSE4_2: printf ("SSE4_2"); break; - case GNU_PROPERTY_X86_ISA_1_AVX: printf ("AVX"); break; - case GNU_PROPERTY_X86_ISA_1_AVX2: printf ("AVX2"); break; - case GNU_PROPERTY_X86_ISA_1_AVX512F: printf ("AVX512F"); break; - case GNU_PROPERTY_X86_ISA_1_AVX512CD: printf ("AVX512CD"); break; - case GNU_PROPERTY_X86_ISA_1_AVX512ER: printf ("AVX512ER"); break; - case GNU_PROPERTY_X86_ISA_1_AVX512PF: printf ("AVX512PF"); break; - case GNU_PROPERTY_X86_ISA_1_AVX512VL: printf ("AVX512VL"); break; - case GNU_PROPERTY_X86_ISA_1_AVX512DQ: printf ("AVX512DQ"); break; - case GNU_PROPERTY_X86_ISA_1_AVX512BW: printf ("AVX512BW"); break; + case GNU_PROPERTY_X86_ISA_1_CMOV: + printf ("CMOV"); + break; + case GNU_PROPERTY_X86_ISA_1_SSE: + printf ("SSE"); + break; + case GNU_PROPERTY_X86_ISA_1_SSE2: + printf ("SSE2"); + break; + case GNU_PROPERTY_X86_ISA_1_SSE3: + printf ("SSE3"); + break; + case GNU_PROPERTY_X86_ISA_1_SSSE3: + printf ("SSSE3"); + break; + case GNU_PROPERTY_X86_ISA_1_SSE4_1: + printf ("SSE4_1"); + break; + case GNU_PROPERTY_X86_ISA_1_SSE4_2: + printf ("SSE4_2"); + break; + case GNU_PROPERTY_X86_ISA_1_AVX: + printf ("AVX"); + break; + case GNU_PROPERTY_X86_ISA_1_AVX2: + printf ("AVX2"); + break; + case GNU_PROPERTY_X86_ISA_1_FMA: + printf ("FMA"); + break; + case GNU_PROPERTY_X86_ISA_1_AVX512F: + printf ("AVX512F"); + break; + case GNU_PROPERTY_X86_ISA_1_AVX512CD: + printf ("AVX512CD"); + break; + case GNU_PROPERTY_X86_ISA_1_AVX512ER: + printf ("AVX512ER"); + break; + case GNU_PROPERTY_X86_ISA_1_AVX512PF: + printf ("AVX512PF"); + break; + case GNU_PROPERTY_X86_ISA_1_AVX512VL: + printf ("AVX512VL"); + break; + case GNU_PROPERTY_X86_ISA_1_AVX512DQ: + printf ("AVX512DQ"); + break; + case GNU_PROPERTY_X86_ISA_1_AVX512BW: + printf ("AVX512BW"); + break; + case GNU_PROPERTY_X86_ISA_1_AVX512_4FMAPS: + printf ("AVX512_4FMAPS"); + break; + case GNU_PROPERTY_X86_ISA_1_AVX512_4VNNIW: + printf ("AVX512_4VNNIW"); + break; + case GNU_PROPERTY_X86_ISA_1_AVX512_BITALG: + printf ("AVX512_BITALG"); + break; + case GNU_PROPERTY_X86_ISA_1_AVX512_IFMA: + printf ("AVX512_IFMA"); + break; + case GNU_PROPERTY_X86_ISA_1_AVX512_VBMI: + printf ("AVX512_VBMI"); + break; + case GNU_PROPERTY_X86_ISA_1_AVX512_VBMI2: + printf ("AVX512_VBMI2"); + break; + case GNU_PROPERTY_X86_ISA_1_AVX512_VNNI: + printf ("AVX512_VNNI"); + break; default: printf (_("<unknown: %x>"), bit); break; } if (bitmask) @@ -16982,7 +17107,7 @@ decode_x86_isa (unsigned int bitmask) } static void -decode_x86_feature (unsigned int type, unsigned int bitmask) +decode_x86_feature_1 (unsigned int bitmask) { while (bitmask) { @@ -16992,26 +17117,10 @@ decode_x86_feature (unsigned int type, unsigned int bitmask) switch (bit) { case GNU_PROPERTY_X86_FEATURE_1_IBT: - switch (type) - { - case GNU_PROPERTY_X86_FEATURE_1_AND: - printf ("IBT"); - break; - default: - /* This should never happen. */ - abort (); - } + printf ("IBT"); break; case GNU_PROPERTY_X86_FEATURE_1_SHSTK: - switch (type) - { - case GNU_PROPERTY_X86_FEATURE_1_AND: - printf ("SHSTK"); - break; - default: - /* This should never happen. */ - abort (); - } + printf ("SHSTK"); break; default: printf (_("<unknown: %x>"), bit); @@ -17023,6 +17132,53 @@ decode_x86_feature (unsigned int type, unsigned int bitmask) } static void +decode_x86_feature_2 (unsigned int bitmask) +{ + while (bitmask) + { + unsigned int bit = bitmask & (- bitmask); + + bitmask &= ~ bit; + switch (bit) + { + case GNU_PROPERTY_X86_FEATURE_2_X86: + printf ("x86"); + break; + case GNU_PROPERTY_X86_FEATURE_2_X87: + printf ("x87"); + break; + case GNU_PROPERTY_X86_FEATURE_2_MMX: + printf ("MMX"); + break; + case GNU_PROPERTY_X86_FEATURE_2_XMM: + printf ("XMM"); + break; + case GNU_PROPERTY_X86_FEATURE_2_YMM: + printf ("YMM"); + break; + case GNU_PROPERTY_X86_FEATURE_2_ZMM: + printf ("ZMM"); + break; + case GNU_PROPERTY_X86_FEATURE_2_FXSR: + printf ("FXSR"); + break; + case GNU_PROPERTY_X86_FEATURE_2_XSAVE: + printf ("XSAVE"); + break; + case GNU_PROPERTY_X86_FEATURE_2_XSAVEOPT: + printf ("XSAVEOPT"); + break; + case GNU_PROPERTY_X86_FEATURE_2_XSAVEC: + printf ("XSAVEC"); + break; + default: printf (_("<unknown: %x>"), bit); break; + } + if (bitmask) + printf (", "); + } +} + +static void print_gnu_property_note (Filedata * filedata, Elf_Internal_Note * pnote) { unsigned char * ptr = (unsigned char *) pnote->descdata; @@ -17115,7 +17271,50 @@ print_gnu_property_note (Filedata * filedata, Elf_Internal_Note * pnote) else { printf ("x86 feature: "); - decode_x86_feature (type, bitmask); + decode_x86_feature_1 (bitmask); + } + goto next; + + case GNU_PROPERTY_X86_FEATURE_2_USED: + if (datasz != 4) + printf (_("x86 feature used: <corrupt length: %#x> "), + datasz); + else + { + printf ("x86 feature used: "); + decode_x86_feature_2 (bitmask); + } + goto next; + + case GNU_PROPERTY_X86_FEATURE_2_NEEDED: + if (datasz != 4) + printf (_("x86 feature needed: <corrupt length: %#x> "), datasz); + else + { + printf ("x86 feature needed: "); + decode_x86_feature_2 (bitmask); + } + goto next; + + case GNU_PROPERTY_X86_COMPAT_ISA_1_USED: + if (datasz != 4) + printf (_("x86 ISA used: <corrupt length: %#x> "), + datasz); + else + { + printf ("x86 ISA used: "); + decode_x86_compat_isa (bitmask); + } + goto next; + + case GNU_PROPERTY_X86_COMPAT_ISA_1_NEEDED: + if (datasz != 4) + printf (_("x86 ISA needed: <corrupt length: %#x> "), + datasz); + else + { + printf ("x86 ISA needed: "); + decode_x86_compat_isa (bitmask); } goto next; diff --git a/binutils/testsuite/binutils-all/i386/pr21231b.d b/binutils/testsuite/binutils-all/i386/pr21231b.d index 29a8f44..55d878f 100644 --- a/binutils/testsuite/binutils-all/i386/pr21231b.d +++ b/binutils/testsuite/binutils-all/i386/pr21231b.d @@ -8,5 +8,5 @@ Displaying notes found in: .note.gnu.property GNU 0x0000002c NT_GNU_PROPERTY_TYPE_0 Properties: stack size: 0x800000 no copy on protected - 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> - x86 ISA needed: i486, 586, 686, SSE, SSE2, SSE3, SSSE3, SSE4_1, SSE4_2, AVX, AVX2, AVX512F, AVX512CD, AVX512ER, AVX512PF, AVX512VL + 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, <unknown: 1000000>, <unknown: 2000000>, <unknown: 4000000>, <unknown: 8000000>, <unknown: 10000000>, <unknown: 20000000>, <unknown: 40000000>, <unknown: 80000000> + x86 ISA needed: CMOV, SSE, SSE2, SSE3, SSSE3, SSE4_1, SSE4_2, AVX, AVX2, FMA, AVX512F, AVX512CD, AVX512ER, AVX512PF, AVX512VL, AVX512DQ diff --git a/binutils/testsuite/binutils-all/i386/pr21231b.s b/binutils/testsuite/binutils-all/i386/pr21231b.s index 3d54745..793e282 100644 --- a/binutils/testsuite/binutils-all/i386/pr21231b.s +++ b/binutils/testsuite/binutils-all/i386/pr21231b.s @@ -19,14 +19,14 @@ .long 0 /* pr_datasz. */ .p2align 2 /* GNU_PROPERTY_X86_ISA_1_USED */ - .long 0xc0000000 /* pr_type. */ + .long 0xc0010000 /* pr_type. */ .long 4f - 3f /* pr_datasz. */ 3: .long -1 4: .p2align 2 /* GNU_PROPERTY_X86_ISA_1_NEEDED */ - .long 0xc0000001 /* pr_type. */ + .long 0xc0008000 /* pr_type. */ .long 4f - 3f /* pr_datasz. */ 3: .long 0xffff diff --git a/binutils/testsuite/binutils-all/x86-64/pr21231b.d b/binutils/testsuite/binutils-all/x86-64/pr21231b.d index 9d7761c..f433685 100644 --- a/binutils/testsuite/binutils-all/x86-64/pr21231b.d +++ b/binutils/testsuite/binutils-all/x86-64/pr21231b.d @@ -8,5 +8,5 @@ Displaying notes found in: .note.gnu.property GNU 0x00000038 NT_GNU_PROPERTY_TYPE_0 Properties: stack size: 0x800000 no copy on protected - 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> - x86 ISA needed: i486, 586, 686, SSE, SSE2, SSE3, SSSE3, SSE4_1, SSE4_2, AVX, AVX2, AVX512F, AVX512CD, AVX512ER, AVX512PF, AVX512VL + 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, <unknown: 1000000>, <unknown: 2000000>, <unknown: 4000000>, <unknown: 8000000>, <unknown: 10000000>, <unknown: 20000000>, <unknown: 40000000>, <unknown: 80000000> + x86 ISA needed: CMOV, SSE, SSE2, SSE3, SSSE3, SSE4_1, SSE4_2, AVX, AVX2, FMA, AVX512F, AVX512CD, AVX512ER, AVX512PF, AVX512VL, AVX512DQ diff --git a/binutils/testsuite/binutils-all/x86-64/pr21231b.s b/binutils/testsuite/binutils-all/x86-64/pr21231b.s index afba4de..add9227 100644 --- a/binutils/testsuite/binutils-all/x86-64/pr21231b.s +++ b/binutils/testsuite/binutils-all/x86-64/pr21231b.s @@ -19,14 +19,14 @@ .long 0 /* pr_datasz. */ .p2align 3 /* GNU_PROPERTY_X86_ISA_1_USED */ - .long 0xc0000000 /* pr_type. */ + .long 0xc0010000 /* pr_type. */ .long 4f - 3f /* pr_datasz. */ 3: .long -1 4: .p2align 3 /* GNU_PROPERTY_X86_ISA_1_NEEDED */ - .long 0xc0000001 /* pr_type. */ + .long 0xc0008000 /* pr_type. */ .long 4f - 3f /* pr_datasz. */ 3: .long 0xffff diff --git a/binutils/testsuite/binutils-all/x86-64/pr23494a-x32.d b/binutils/testsuite/binutils-all/x86-64/pr23494a-x32.d index 67e3aab..ad8f9b1 100644 --- a/binutils/testsuite/binutils-all/x86-64/pr23494a-x32.d +++ b/binutils/testsuite/binutils-all/x86-64/pr23494a-x32.d @@ -8,5 +8,5 @@ Displaying notes found in: .note.gnu.property Owner Data size Description GNU 0x00000020 NT_GNU_PROPERTY_TYPE_0 - Properties: x86 ISA used: 586, SSE, SSE3, SSE4_1 - x86 ISA needed: SSE3, SSE4_1 + Properties: x86 ISA needed: SSE4_1, AVX + x86 ISA used: SSE, SSE3, SSE4_1, AVX diff --git a/binutils/testsuite/binutils-all/x86-64/pr23494a.d b/binutils/testsuite/binutils-all/x86-64/pr23494a.d index 06c1938..32e296f 100644 --- a/binutils/testsuite/binutils-all/x86-64/pr23494a.d +++ b/binutils/testsuite/binutils-all/x86-64/pr23494a.d @@ -8,5 +8,5 @@ Displaying notes found in: .note.gnu.property Owner Data size Description GNU 0x00000018 NT_GNU_PROPERTY_TYPE_0 - Properties: x86 ISA used: 586, SSE, SSE3, SSE4_1 - x86 ISA needed: SSE3, SSE4_1 + Properties: x86 ISA needed: SSE4_1, AVX + x86 ISA used: SSE, SSE3, SSE4_1, AVX diff --git a/binutils/testsuite/binutils-all/x86-64/pr23494a.s b/binutils/testsuite/binutils-all/x86-64/pr23494a.s index 77185bd..26f7139 100644 --- a/binutils/testsuite/binutils-all/x86-64/pr23494a.s +++ b/binutils/testsuite/binutils-all/x86-64/pr23494a.s @@ -17,7 +17,7 @@ .p2align 2 .endif /* GNU_PROPERTY_X86_ISA_1_USED */ - .long 0xc0000000 /* pr_type. */ + .long 0xc0010000 /* pr_type. */ .long 5f - 4f /* pr_datasz. */ 4: .long 0xa @@ -48,7 +48,7 @@ .p2align 2 .endif /* GNU_PROPERTY_X86_ISA_1_NEEDED */ - .long 0xc0000001 /* pr_type. */ + .long 0xc0008000 /* pr_type. */ .long 5f - 4f /* pr_datasz. */ 4: .long 0xa0 @@ -79,7 +79,7 @@ .p2align 2 .endif /* GNU_PROPERTY_X86_ISA_1_USED */ - .long 0xc0000000 /* pr_type. */ + .long 0xc0010000 /* pr_type. */ .long 5f - 4f /* pr_datasz. */ 4: .long 0xa0 diff --git a/binutils/testsuite/binutils-all/x86-64/pr23494b.s b/binutils/testsuite/binutils-all/x86-64/pr23494b.s index 239477b..75a8d5a 100644 --- a/binutils/testsuite/binutils-all/x86-64/pr23494b.s +++ b/binutils/testsuite/binutils-all/x86-64/pr23494b.s @@ -17,7 +17,7 @@ .p2align 2 .endif /* GNU_PROPERTY_X86_ISA_1_USED */ - .long 0xc0000000 /* pr_type. */ + .long 0xc0010000 /* pr_type. */ .long 5f - 4f /* pr_datasz. */ 4: .long 0xa diff --git a/binutils/testsuite/binutils-all/x86-64/pr23494c-x32.d b/binutils/testsuite/binutils-all/x86-64/pr23494c-x32.d index c4a9414..761c137 100644 --- a/binutils/testsuite/binutils-all/x86-64/pr23494c-x32.d +++ b/binutils/testsuite/binutils-all/x86-64/pr23494c-x32.d @@ -8,4 +8,4 @@ Displaying notes found in: .note.gnu.property Owner Data size Description GNU 0x00000010 NT_GNU_PROPERTY_TYPE_0 - Properties: x86 ISA used: 586, SSE + Properties: x86 ISA used: SSE, SSE3 diff --git a/binutils/testsuite/binutils-all/x86-64/pr23494c.d b/binutils/testsuite/binutils-all/x86-64/pr23494c.d index 545777a..e98b2ae 100644 --- a/binutils/testsuite/binutils-all/x86-64/pr23494c.d +++ b/binutils/testsuite/binutils-all/x86-64/pr23494c.d @@ -8,4 +8,4 @@ Displaying notes found in: .note.gnu.property Owner Data size Description GNU 0x0000000c NT_GNU_PROPERTY_TYPE_0 - Properties: x86 ISA used: 586, SSE + Properties: x86 ISA used: SSE, SSE3 diff --git a/binutils/testsuite/binutils-all/x86-64/pr23494c.s b/binutils/testsuite/binutils-all/x86-64/pr23494c.s index a478e7a..474182c 100644 --- a/binutils/testsuite/binutils-all/x86-64/pr23494c.s +++ b/binutils/testsuite/binutils-all/x86-64/pr23494c.s @@ -48,7 +48,7 @@ .p2align 2 .endif /* GNU_PROPERTY_X86_ISA_1_USED */ - .long 0xc0000000 /* pr_type. */ + .long 0xc0010000 /* pr_type. */ .long 5f - 4f /* pr_datasz. */ 4: .long 0xa @@ -79,7 +79,7 @@ .p2align 2 .endif /* GNU_PROPERTY_X86_ISA_1_NEEDED */ - .long 0xc0000001 /* pr_type. */ + .long 0xc0008000 /* pr_type. */ .long 5f - 4f /* pr_datasz. */ 4: .long 0xa0 @@ -110,7 +110,7 @@ .p2align 2 .endif /* GNU_PROPERTY_X86_ISA_1_USED */ - .long 0xc0000000 /* pr_type. */ + .long 0xc0010000 /* pr_type. */ .long 5f - 4f /* pr_datasz. */ 4: .long 0xa0 diff --git a/binutils/testsuite/binutils-all/x86-64/pr23494d-x32.d b/binutils/testsuite/binutils-all/x86-64/pr23494d-x32.d index 264c9d9..b0af2d9 100644 --- a/binutils/testsuite/binutils-all/x86-64/pr23494d-x32.d +++ b/binutils/testsuite/binutils-all/x86-64/pr23494d-x32.d @@ -8,5 +8,5 @@ Displaying notes found in: .note.gnu.property Owner Data size Description GNU 0x00000020 NT_GNU_PROPERTY_TYPE_0 - Properties: x86 ISA used: 586, SSE, SSE3, SSE4_1 - x86 ISA needed: SSE3, SSE4_1 + Properties: x86 ISA needed: SSE4_1, AVX + x86 ISA used: SSE, SSE3, SSE4_1, AVX diff --git a/binutils/testsuite/binutils-all/x86-64/pr23494d.d b/binutils/testsuite/binutils-all/x86-64/pr23494d.d index 3237eca..1731c03 100644 --- a/binutils/testsuite/binutils-all/x86-64/pr23494d.d +++ b/binutils/testsuite/binutils-all/x86-64/pr23494d.d @@ -8,5 +8,5 @@ Displaying notes found in: .note.gnu.property Owner Data size Description GNU 0x00000018 NT_GNU_PROPERTY_TYPE_0 - Properties: x86 ISA used: 586, SSE, SSE3, SSE4_1 - x86 ISA needed: SSE3, SSE4_1 + Properties: x86 ISA needed: SSE4_1, AVX + x86 ISA used: SSE, SSE3, SSE4_1, AVX diff --git a/binutils/testsuite/binutils-all/x86-64/pr23494e-x32.d b/binutils/testsuite/binutils-all/x86-64/pr23494e-x32.d index 825f45d..4adfb4a 100644 --- a/binutils/testsuite/binutils-all/x86-64/pr23494e-x32.d +++ b/binutils/testsuite/binutils-all/x86-64/pr23494e-x32.d @@ -9,5 +9,5 @@ Displaying notes found in: .note.gnu.property Owner Data size Description GNU 0x00000030 NT_GNU_PROPERTY_TYPE_0 Properties: stack size: 0xffffffff - x86 ISA used: 586, SSE, SSE3, SSE4_1 - x86 ISA needed: SSE3, SSE4_1 + x86 ISA needed: SSE4_1, AVX + x86 ISA used: SSE, SSE3, SSE4_1, AVX diff --git a/binutils/testsuite/binutils-all/x86-64/pr23494e.d b/binutils/testsuite/binutils-all/x86-64/pr23494e.d index ffb8988..d9b0538 100644 --- a/binutils/testsuite/binutils-all/x86-64/pr23494e.d +++ b/binutils/testsuite/binutils-all/x86-64/pr23494e.d @@ -9,5 +9,5 @@ Displaying notes found in: .note.gnu.property Owner Data size Description GNU 0x00000024 NT_GNU_PROPERTY_TYPE_0 Properties: stack size: 0xffffffff - x86 ISA used: 586, SSE, SSE3, SSE4_1 - x86 ISA needed: SSE3, SSE4_1 + x86 ISA needed: SSE4_1, AVX + x86 ISA used: SSE, SSE3, SSE4_1, AVX |