From 90c745dc545408a6a3115ff97485672826649ade Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Mon, 27 Aug 2018 15:41:09 -0700 Subject: 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 "" 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 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. --- bfd/ChangeLog | 5 +++++ bfd/elfxx-x86.c | 5 +---- 2 files changed, 6 insertions(+), 4 deletions(-) (limited to 'bfd') diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 3af19d5..b6e9363 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,8 @@ +2018-08-27 H.J. Lu + + * elfxx-x86.c (_bfd_x86_elf_parse_gnu_properties): Don't mask + out the GNU_PROPERTY_X86_UINT32_VALID bit. + 2018-08-25 H.J. Lu PR ld/23499 diff --git a/bfd/elfxx-x86.c b/bfd/elfxx-x86.c index d44ec5a..fc99b28 100644 --- a/bfd/elfxx-x86.c +++ b/bfd/elfxx-x86.c @@ -2378,10 +2378,7 @@ _bfd_x86_elf_parse_gnu_properties (bfd *abfd, unsigned int type, return property_corrupt; } prop = _bfd_elf_get_property (abfd, type, datasz); - /* Mask out GNU_PROPERTY_X86_UINT32_VALID and combine properties - of the same type. */ - prop->u.number |= (bfd_h_get_32 (abfd, ptr) - & ~GNU_PROPERTY_X86_UINT32_VALID); + prop->u.number |= bfd_h_get_32 (abfd, ptr); prop->pr_kind = property_number; return property_number; } -- cgit v1.1