[PATCH] D62862: [ELF][LLD] Allow reading of more than one FEATURE_1_AND in same object.

Peter Smith via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 4 09:20:30 PDT 2019


peter.smith created this revision.
peter.smith added reviewers: ruiu, MaskRay.
Herald added subscribers: kristof.beyls, arichardson, javed.absar, emaste.
Herald added a reviewer: espindola.
peter.smith added a parent revision: D62853: Read .note.gnu.property sections and emit a merged .note.gnu.property section..

This patch is a follow on from D62853 <https://reviews.llvm.org/D62853> . Although many relocatable objects will have a single GNU_PROPERTY_X86_FEATURE_1_AND in the .note.gnu.property section it is permissible to have more than one, and there is a test in ld.bfd that uses it. The behavior that ld.bfd follows is to set the feature bit for a relocatable object if any of the GNU_PROPERTY_X86_FEATURE_1_AND have the feature bit set.

The specific test in ld.bfd is https://github.com/bminor/binutils-gdb/blob/master/ld/testsuite/ld-aarch64/property-bti-pac1.s there isn't an X86 equivalent test but the same behaviour can be observed with IBT and SHSTK. I've added a test case for that.

This could be considered a corner case, however it is not known whether tools will just add another GNU_PROPERTY_X86_FEATURE_1_AND rather than find an existing one and add to it.


https://reviews.llvm.org/D62862

Files:
  ELF/InputFiles.cpp
  test/ELF/i386-cet.s
  test/ELF/x86-property-relocatable.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D62862.202955.patch
Type: text/x-patch
Size: 2893 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190604/e231ab34/attachment.bin>


More information about the llvm-commits mailing list