[PATCH 2/3][GCC][AARCH64] Add new -mbranch-protection option to combine pointer signi...
authorSam Tebbs <sam.tebbs@arm.com>
Tue, 8 Jan 2019 10:31:11 +0000 (10:31 +0000)
committerSam Tebbs <samtebbs@gcc.gnu.org>
Tue, 8 Jan 2019 10:31:11 +0000 (10:31 +0000)
commitefac62a3d17d534e8fec39a53031689efb0dc724
treead35cab19dbd793ab596cc3677d2357b029e01c7
parent35724e51548e17ed4af8bed121f9b89a603ff0e7
[PATCH 2/3][GCC][AARCH64] Add new -mbranch-protection option to combine pointer signing and BTI

gcc/ChangeLog:

2019-01-08  Sam Tebbs  <sam.tebbs@arm.com>

* config/aarch64/aarch64.c (BRANCH_PROTECT_STR_MAX,
aarch64_parse_branch_protection,
struct aarch64_branch_protect_type,
aarch64_handle_no_branch_protection,
aarch64_handle_standard_branch_protection,
aarch64_validate_mbranch_protection,
aarch64_handle_pac_ret_protection,
aarch64_handle_attr_branch_protection,
accepted_branch_protection_string,
aarch64_pac_ret_subtypes,
aarch64_branch_protect_types,
aarch64_handle_pac_ret_leaf): Define.
(aarch64_override_options_after_change_1, aarch64_override_options):
Add check for accepted_branch_protection_string.
(aarch64_option_save): Save accepted_branch_protection_string.
(aarch64_option_restore): Save accepted_branch_protection_string.
* config/aarch64/aarch64.c (aarch64_attributes): Add branch-protection.
* config/aarch64/aarch64.opt: Add mbranch-protection. Deprecate
msign-return-address.
* doc/invoke.texi: Add mbranch-protection.

gcc/testsuite/Changelog:

2019-01-08  Sam Tebbs  <sam.tebbs@arm.com>

* gcc.target/aarch64/(return_address_sign_1.c,
return_address_sign_2.c, return_address_sign_3.c (__attribute__)):
Change option to -mbranch-protection.
* gcc.target/aarch64/(branch-protection-option.c,
branch-protection-option-2.c, branch-protection-attr.c,
branch-protection-attr-2.c): New file.

From-SVN: r267717
12 files changed:
gcc/ChangeLog
gcc/config/aarch64/aarch64.c
gcc/config/aarch64/aarch64.opt
gcc/doc/invoke.texi
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/aarch64/branch-protection-attr-2.c [new file with mode: 0644]
gcc/testsuite/gcc.target/aarch64/branch-protection-attr.c [new file with mode: 0644]
gcc/testsuite/gcc.target/aarch64/branch-protection-option-2.c [new file with mode: 0644]
gcc/testsuite/gcc.target/aarch64/branch-protection-option.c [new file with mode: 0644]
gcc/testsuite/gcc.target/aarch64/return_address_sign_1.c
gcc/testsuite/gcc.target/aarch64/return_address_sign_2.c
gcc/testsuite/gcc.target/aarch64/return_address_sign_3.c