[PATCH] D70961: [LLD][ELF] add support for PT_GNU_PROPERTY

Peter Smith via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 3 06:04:04 PST 2019


peter.smith created this revision.
peter.smith added reviewers: ruiu, MaskRay, grimar.
Herald added subscribers: arichardson, emaste.
Herald added a reviewer: espindola.
Herald added a project: LLVM.

The PT_GNU_PROPERTY program header describes the location of the .note.gnu.property SHT_NOTES section. The linux kernel uses this program header to find the .note.gnu.property section rather than parsing. Executables that have properties that the kernel needs to act on that don't have the PT_GNU_PROPERTY program header will not boot.

The change to add the program header is simple. It shifts the addresses around in the existing .note.gnu.property tests, but otherwise has no effect.

Depends on D70959 <https://reviews.llvm.org/D70959> for definition of PT_GNU_PROPERTY and llvm-readobj support.

- PT_GNU_PROPERTY is described in https://github.com/hjl-tools/linux-abi/wiki/linux-abi-draft.pdf
- Somewhat long binutils thread that introduces PT_GNU_PROPERTY https://sourceware.org/ml/binutils/2018-11/msg00191.html, also spills over into December.
- Backport for binutils referencing kernel requirements for PT_GNU_PROPERTY for intel CET https://bugzilla.redhat.com/show_bug.cgi?id=1721606


https://reviews.llvm.org/D70961

Files:
  lld/ELF/Writer.cpp
  lld/test/ELF/aarch64-feature-bti.s
  lld/test/ELF/aarch64-feature-btipac.s
  lld/test/ELF/aarch64-feature-pac.s
  lld/test/ELF/aarch64-ifunc-bti.s
  lld/test/ELF/aarch64-pt-gnu-property.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D70961.231889.patch
Type: text/x-patch
Size: 22809 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20191203/91531f44/attachment.bin>


More information about the llvm-commits mailing list