]> git.ipfire.org Git - thirdparty/gcc.git/commit - gcc/config/aarch64/aarch64.opt
[AArch64][1/4] Support Return address protection on AArch64
authorJiong Wang <jiong.wang@arm.com>
Fri, 20 Jan 2017 00:03:20 +0000 (00:03 +0000)
committerJiong Wang <jiwang@gcc.gnu.org>
Fri, 20 Jan 2017 00:03:20 +0000 (00:03 +0000)
commitdb58fd8954f5dfd868dbed110f2c8a04bb4b0753
tree37f06bdc0b1b1122a695d6a56a818ba288394b1f
parentc9038c70bde89e7023d21fe8752b9d6f0b0e3779
[AArch64][1/4] Support Return address protection on AArch64

gcc/
* config/aarch64/aarch64-opts.h (aarch64_function_type): New enum.
* config/aarch64/aarch64-protos.h
(aarch64_return_address_signing_enabled): New declaration.
* config/aarch64/aarch64.c (aarch64_return_address_signing_enabled):
New function.
(aarch64_expand_prologue): Sign return address before it's pushed onto
stack.
(aarch64_expand_epilogue): Authenticate return address fetched from
stack.
(aarch64_override_options): Sanity check for ILP32 and ISA level.
(aarch64_attributes): New function attributes for "sign-return-address".
* config/aarch64/aarch64.md (UNSPEC_AUTI1716, UNSPEC_AUTISP,
UNSPEC_PACI1716, UNSPEC_PACISP, UNSPEC_XPACLRI): New unspecs.
("*do_return"): Generate combined instructions according to key index.
("<pauth_mnem_prefix>sp", "<pauth_mnem_prefix1716", "xpaclri"): New.
* config/aarch64/iterators.md (PAUTH_LR_SP, PAUTH_17_16): New integer
iterators.
(pauth_mnem_prefix, pauth_hint_num_a): New integer attributes.
* config/aarch64/aarch64.opt (msign-return-address=): New.
* doc/extend.texi (AArch64 Function Attributes): Documents
"sign-return-address=".
* doc/invoke.texi (AArch64 Options): Documents "-msign-return-address=".

gcc/testsuite/
* gcc.target/aarch64/return_address_sign_1.c: New testcase for no
combined instructions.
* gcc.target/aarch64/return_address_sign_2.c: New testcase for combined
instructions.
* gcc.target/aarch64/return_address_sign_3.c: New testcase for disable
of pointer authentication.

From-SVN: r244666
13 files changed:
gcc/ChangeLog
gcc/config/aarch64/aarch64-opts.h
gcc/config/aarch64/aarch64-protos.h
gcc/config/aarch64/aarch64.c
gcc/config/aarch64/aarch64.md
gcc/config/aarch64/aarch64.opt
gcc/config/aarch64/iterators.md
gcc/doc/extend.texi
gcc/doc/invoke.texi
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/aarch64/return_address_sign_1.c [new file with mode: 0644]
gcc/testsuite/gcc.target/aarch64/return_address_sign_2.c [new file with mode: 0644]
gcc/testsuite/gcc.target/aarch64/return_address_sign_3.c [new file with mode: 0644]