x86: Properly set IBT and SHSTK properties for -z ibt/shstk
authorH.J. Lu <hjl.tools@gmail.com>
Wed, 13 Mar 2019 06:38:15 +0000 (14:38 +0800)
committerH.J. Lu <hjl.tools@gmail.com>
Wed, 13 Mar 2019 06:38:29 +0000 (14:38 +0800)
commit44b27f959abf267fc9ec228f4131c932597b01d4
treea678750a291412005272a2d770452a15f69f33dc
parent204f543cae7a5dc908264b49d558191d0ceb989c
x86: Properly set IBT and SHSTK properties for -z ibt/shstk

There should be no AND properties if some input doesn't have them.  We
should set IBT and SHSTK properties for -z ibt and -z shstk if needed.

bfd/

PR ld/24322
* elfxx-x86.c (_bfd_x86_elf_merge_gnu_properties): Properly
merge GNU_PROPERTY_X86_FEATURE_1_[IBT|SHSTK].

ld/

PR ld/24322
* testsuite/ld-i386/i386.exp: Run PR ld/24322 tests.
* testsuite/ld-x86-64/x86-64.exp: Likewise.
* testsuite/ld-i386/pr24322a.d: New file.
* testsuite/ld-i386/pr24322b.d: Likewise.
* testsuite/ld-x86-64/pr24322a-x32.d: Likewise.
* testsuite/ld-x86-64/pr24322a.d: Likewise.
* testsuite/ld-x86-64/pr24322b-x32.d: Likewise.
* testsuite/ld-x86-64/pr24322b.d: Likewise.
* testsuite/ld-x86-64/pr24322a.s: Likewise.
* testsuite/ld-x86-64/pr24322b.s: Likewise.
* testsuite/ld-x86-64/pr24322c.s: Likewise.
14 files changed:
bfd/ChangeLog
bfd/elfxx-x86.c
ld/ChangeLog
ld/testsuite/ld-i386/i386.exp
ld/testsuite/ld-i386/pr24322a.d [new file with mode: 0644]
ld/testsuite/ld-i386/pr24322b.d [new file with mode: 0644]
ld/testsuite/ld-x86-64/pr24322a-x32.d [new file with mode: 0644]
ld/testsuite/ld-x86-64/pr24322a.d [new file with mode: 0644]
ld/testsuite/ld-x86-64/pr24322a.s [new file with mode: 0644]
ld/testsuite/ld-x86-64/pr24322b-x32.d [new file with mode: 0644]
ld/testsuite/ld-x86-64/pr24322b.d [new file with mode: 0644]
ld/testsuite/ld-x86-64/pr24322b.s [new file with mode: 0644]
ld/testsuite/ld-x86-64/pr24322c.s [new file with mode: 0644]
ld/testsuite/ld-x86-64/x86-64.exp