From 73caa85d4a97eb991e581ccba3ff4eccce5e2e1d Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Fri, 12 May 2017 08:07:21 -0700 Subject: x86: Merge X86_ISA_1_USED/X86_ISA_1_NEEDED properties If there are more than GNU property note in an input, we should merge X86_ISA_1_USED and X86_ISA_1_NEEDED properties. bfd/ * elf32-i386.c (elf_i386_parse_gnu_properties): Merge GNU_PROPERTY_X86_ISA_1_USED and GNU_PROPERTY_X86_ISA_1_NEEDED properties. * elf64-x86-64.c (elf_x86_64_parse_gnu_properties): Likewise. ld/ * testsuite/ld-i386/i386.exp: Run property-x86-3. * testsuite/ld-x86-64/x86-64.exp: Likewise. * testsuite/ld-i386/property-x86-3.d: New file. * testsuite/ld-i386/property-x86-3.s: Likewise. * testsuite/ld-x86-64/property-x86-3.d: Likewise. * testsuite/ld-x86-64/property-x86-3.s: Likewise. --- bfd/ChangeLog | 7 +++++++ bfd/elf32-i386.c | 3 ++- bfd/elf64-x86-64.c | 3 ++- 3 files changed, 11 insertions(+), 2 deletions(-) (limited to 'bfd') diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 9128808..bd7356c 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,10 @@ +2017-05-12 H.J. Lu + + * elf32-i386.c (elf_i386_parse_gnu_properties): Merge + GNU_PROPERTY_X86_ISA_1_USED and GNU_PROPERTY_X86_ISA_1_NEEDED + properties. + * elf64-x86-64.c (elf_x86_64_parse_gnu_properties): Likewise. + 2017-05-11 H.J. Lu * elf64-x86-64.c (elf_x86_64_link_hash_entry): Rename plt_bnd diff --git a/bfd/elf32-i386.c b/bfd/elf32-i386.c index 6f59fb7..513e296 100644 --- a/bfd/elf32-i386.c +++ b/bfd/elf32-i386.c @@ -6362,7 +6362,8 @@ elf_i386_parse_gnu_properties (bfd *abfd, unsigned int type, return property_corrupt; } prop = _bfd_elf_get_property (abfd, type, datasz); - prop->u.number = bfd_h_get_32 (abfd, ptr); + /* Combine properties of the same type. */ + prop->u.number |= bfd_h_get_32 (abfd, ptr); prop->pr_kind = property_number; break; diff --git a/bfd/elf64-x86-64.c b/bfd/elf64-x86-64.c index c77725d..1b93379 100644 --- a/bfd/elf64-x86-64.c +++ b/bfd/elf64-x86-64.c @@ -7003,7 +7003,8 @@ elf_x86_64_parse_gnu_properties (bfd *abfd, unsigned int type, return property_corrupt; } prop = _bfd_elf_get_property (abfd, type, datasz); - prop->u.number = bfd_h_get_32 (abfd, ptr); + /* Combine properties of the same type. */ + prop->u.number |= bfd_h_get_32 (abfd, ptr); prop->pr_kind = property_number; break; -- cgit v1.1