[PATCH] D119384: [MTE] [lld] Add --memtag-* options to synthetise ELF notes.

Mitch Phillips via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 9 15:51:34 PST 2022


hctim created this revision.
hctim added reviewers: eugenis, MaskRay.
Herald added subscribers: dang, kristof.beyls, arichardson, emaste.
hctim requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

This ELF note is aarch64 and Android-specific. It specifies to the
dynamic loader that specific work should be scheduled to enable MTE
protection of stack and heap regions.

Current synthesis of the ".note.android.memtag" ELF note is done in the
Android build system. We'd like to move that to the compiler. This patch
adds the --memtag-stack, --memtag-heap, and --memtag-mode={async, sync,
none} flags to the linker, which synthesises the note for us.

Future changes will add -fsanitize=memtag* flags to clang which will
pass these through to lld.

Depends on D119381 <https://reviews.llvm.org/D119381>.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D119384

Files:
  lld/ELF/Config.h
  lld/ELF/Driver.cpp
  lld/ELF/Options.td
  lld/ELF/SyntheticSections.cpp
  lld/ELF/SyntheticSections.h
  lld/ELF/Writer.cpp
  lld/test/ELF/aarch64-memtag-android-abi.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D119384.407329.patch
Type: text/x-patch
Size: 10615 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220209/bc012333/attachment.bin>


More information about the llvm-commits mailing list