]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit - binutils/readelf.c
x86: Don't mask out the GNU_PROPERTY_X86_UINT32_VALID bit
authorH.J. Lu <hjl.tools@gmail.com>
Mon, 27 Aug 2018 22:41:09 +0000 (15:41 -0700)
committerH.J. Lu <hjl.tools@gmail.com>
Mon, 27 Aug 2018 22:42:14 +0000 (15:42 -0700)
commit90c745dc545408a6a3115ff97485672826649ade
tree852cc043ddd5910306b2530acdc72bfb718fb926
parent3bf9c013e4a7b72aaa7e242e163a776ad7347c26
x86: Don't mask out the GNU_PROPERTY_X86_UINT32_VALID bit

Since only the GNU_PROPERTY_X86_UINT32_VALID bit may be set in data-only
relocatable objects which don't contain any instructions, linker
shouldn't mask out the GNU_PROPERTY_X86_UINT32_VALID bit when merging
GNU_PROPERTY_X86_XXX bits.  Otherwise, linker output doesn't contain
GNU_PROPERTY_X86_XXX property with any data-only relocatable inputs.
This patch keeps the GNU_PROPERTY_X86_UINT32_VALID bit and updates
readelf to print "<None>" if GNU_PROPERTY_X86_XXX property only has
the GNU_PROPERTY_X86_UINT32_VALID bit.

bfd/

* elfxx-x86.c (_bfd_x86_elf_parse_gnu_properties): Don't mask
out the GNU_PROPERTY_X86_UINT32_VALID bit.

binutils/

* readelf.c (decode_x86_isa): Print <None> if bitmask only
contains the GNU_PROPERTY_X86_UINT32_VALID bit.
(decode_x86_feature_1): Likewise.
(decode_x86_feature_2): Likewise.
(print_gnu_property_note): Don't mask out the
GNU_PROPERTY_X86_UINT32_VALID bit.
* testsuite/binutils-all/i386/pr21231b.d: Updated.
* testsuite/binutils-all/x86-64/pr21231b.d: Likewise.

gas/

* testsuite/gas/i386/i386.exp: Run property-1 and
x86-64-property-1.
* testsuite/gas/i386/property-1.d: New file.
* testsuite/gas/i386/property-1.s: Likewise.
* testsuite/gas/i386/x86-64-property-1.d: Likewise.

ld/

* testsuite/ld-i386/i386.exp: Run property-x86-5.
* testsuite/ld-i386/property-x86-5.d: New file.
* testsuite/ld-x86-64/property-x86-5-x32.d: Likewise.
* testsuite/ld-x86-64/property-x86-5.d: Likewise.
* testsuite/ld-x86-64/property-x86-5a.s: Likewise.
* testsuite/ld-x86-64/property-x86-5b.s: Likewise.
* testsuite/ld-x86-64/x86-64.exp: Run property-x86-5 and
property-x86-5-x32.
19 files changed:
bfd/ChangeLog
bfd/elfxx-x86.c
binutils/ChangeLog
binutils/readelf.c
binutils/testsuite/binutils-all/i386/pr21231b.d
binutils/testsuite/binutils-all/x86-64/pr21231b.d
gas/ChangeLog
gas/testsuite/gas/i386/i386.exp
gas/testsuite/gas/i386/property-1.d [new file with mode: 0644]
gas/testsuite/gas/i386/property-1.s [new file with mode: 0644]
gas/testsuite/gas/i386/x86-64-property-1.d [new file with mode: 0644]
ld/ChangeLog
ld/testsuite/ld-i386/i386.exp
ld/testsuite/ld-i386/property-x86-5.d [new file with mode: 0644]
ld/testsuite/ld-x86-64/property-x86-5-x32.d [new file with mode: 0644]
ld/testsuite/ld-x86-64/property-x86-5.d [new file with mode: 0644]
ld/testsuite/ld-x86-64/property-x86-5a.s [new file with mode: 0644]
ld/testsuite/ld-x86-64/property-x86-5b.s [new file with mode: 0644]
ld/testsuite/ld-x86-64/x86-64.exp