[LLD][ELF][AArch64] Change the semantics of -z pac-plt.
authorDaniel Kiss <daniel.kiss@arm.com>
Tue, 18 Feb 2020 08:53:39 +0000 (09:53 +0100)
committerDaniel Kiss <daniel.kiss@arm.com>
Tue, 18 Feb 2020 08:56:57 +0000 (09:56 +0100)
commitb6162622c054fa74a7f2588df00059475f112212
treed3e9359356d904eebaad29155b29202ec1b0bf9b
parent8ffea27ae42ad210b9162c3afc91c61dfb82acf7
[LLD][ELF][AArch64] Change the semantics of -z pac-plt.

Summary:
Generate PAC protected plt only when "-z pac-plt" is passed to the
linker. GNU toolchain generates when it is explicitly requested[1].
When pac-plt is requested then set the GNU_PROPERTY_AARCH64_FEATURE_1_PAC
note even when not all function compiled with PAC but issue a warning.
Harmonizing the warning style for BTI/PAC/IBT.
Generate BTI protected PLT if case of "-z force-bti".

[1] https://www.sourceware.org/ml/binutils/2019-03/msg00021.html

Reviewers: peter.smith, espindola, MaskRay, grimar

Reviewed By: peter.smith, MaskRay

Subscribers: tatyana-krasnukha, emaste, arichardson, kristof.beyls, MaskRay, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D74537
lld/ELF/Arch/AArch64.cpp
lld/ELF/Driver.cpp
lld/ELF/SyntheticSections.cpp
lld/test/ELF/aarch64-feature-bti.s
lld/test/ELF/aarch64-feature-btipac.s
lld/test/ELF/aarch64-feature-pac.s