[AArch64] Add -mmark-bti-property flag.
authorDaniel Kiss <daniel.kiss@arm.com>
Wed, 16 Sep 2020 21:55:46 +0000 (23:55 +0200)
committerDaniel Kiss <daniel.kiss@arm.com>
Wed, 16 Sep 2020 23:18:36 +0000 (01:18 +0200)
commitf70baaf71f62ba8623b3522345527271add74f6b
treef6489ae016643f9531ba61bc13114f50a5441382
parent60e244f82c1f97c1b7d65c06d2b0b4f634f8d696
[AArch64] Add -mmark-bti-property flag.

Writing the .note.gnu.property manually is error prone and hard to
maintain in the assembly files.
The -mmark-bti-property is for the assembler to emit the section with the
GNU_PROPERTY_AARCH64_FEATURE_1_BTI. To be used when C/C++ is compiled
with -mbranch-protection=bti.

This patch refactors the .note.gnu.property handling.

Reviewed By: chill, nickdesaulniers

Differential Revision: https://reviews.llvm.org/D81930

Reland with test dependency on aarch64 target.
clang/include/clang/Driver/Options.td
clang/lib/Driver/ToolChains/Clang.cpp
clang/test/Driver/arm64-markbti.S [new file with mode: 0644]
llvm/lib/Target/AArch64/AArch64AsmPrinter.cpp
llvm/lib/Target/AArch64/MCTargetDesc/AArch64TargetStreamer.cpp
llvm/lib/Target/AArch64/MCTargetDesc/AArch64TargetStreamer.h