[PATCH] D70959: [ELF] Support for PT_GNU_PROPERTY in program headers and tools

Peter Smith via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 3 05:54:39 PST 2019


peter.smith created this revision.
peter.smith added reviewers: MaskRay, grimar, jhenderson.
Herald added subscribers: seiya, rupprecht, hiraditya, kristof.beyls, arichardson, emaste.
Herald added a reviewer: espindola.
Herald added a project: LLVM.

The PT_GNU_PROPERTY is generated by a linker to describe the .note.gnu.property section. The Linux kernel uses this program header to locate the .note.gnu.property section. If there is a program property that requires the kernel to perform some action before loading and ELF file such as AArch64 BTI or intel CET then the program won't load unless the PT_GNU_PROPERTY program header is present. This patch adds the definition and support in llvm-readobj, llvm-objdump to print it out. Support is also added to obj2yaml so that we can write a test for it. This patch is a pre-requisite for adding support for PT_GNU_PROPERTY generation in LLD.

The definition of PT_GNU_PROPERTY can be found in https://github.com/hjl-tools/linux-abi/wiki/linux-abi-draft.pdf


https://reviews.llvm.org/D70959

Files:
  llvm/include/llvm/BinaryFormat/ELF.h
  llvm/lib/ObjectYAML/ELFYAML.cpp
  llvm/test/tools/llvm-objdump/elf-pt-gnu-property.test
  llvm/test/tools/llvm-readobj/elf-pt-gnu-property.test
  llvm/test/tools/yaml2obj/ELF/program-header.yaml
  llvm/tools/llvm-objdump/ELFDump.cpp
  llvm/tools/llvm-readobj/ELFDumper.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D70959.231885.patch
Type: text/x-patch
Size: 5645 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20191203/0ba0b4c7/attachment.bin>


More information about the llvm-commits mailing list