aboutsummaryrefslogtreecommitdiff
path: root/gcc/config.gcc
diff options
context:
space:
mode:
authorAndrea Corallo <andrea.corallo@arm.com>2022-04-07 11:51:56 +0200
committerAndrea Corallo <andrea.corallo@arm.com>2023-01-23 11:45:28 +0100
commitdb6b9a9ddb7855f348ea978c392d8ebc258199af (patch)
treec3e3b4f52eda158fc050d729506387af17f06c3d /gcc/config.gcc
parentf7ad35a3ff369e10a6db6098439ca346b9e668de (diff)
downloadgcc-db6b9a9ddb7855f348ea978c392d8ebc258199af.zip
gcc-db6b9a9ddb7855f348ea978c392d8ebc258199af.tar.gz
gcc-db6b9a9ddb7855f348ea978c392d8ebc258199af.tar.bz2
[PATCH 12/15] arm: implement bti injection
Hi all, this patch enables Branch Target Identification Armv8.1-M Mechanism [1]. This is achieved by using the bti pass made common with Aarch64. The pass iterates through the instructions and adds the necessary BTI instructions at the beginning of every function and at every landing pads targeted by indirect jumps. Best Regards Andrea [1] <https://community.arm.com/developer/ip-products/processors/b/processors-ip-blog/posts/armv8-1-m-pointer-authentication-and-branch-target-identification-extension> gcc/ChangeLog 2022-04-07 Andrea Corallo <andrea.corallo@arm.com> * config.gcc (arm*-*-*): Add 'aarch-bti-insert.o' object. * config/arm/arm-protos.h: Update. * config/arm/aarch-common-protos.h: Declare 'aarch_bti_arch_check'. * config/arm/arm.cc (aarch_bti_enabled) Update. (aarch_bti_j_insn_p, aarch_pac_insn_p, aarch_gen_bti_c) (aarch_gen_bti_j, aarch_bti_arch_check): New functions. * config/arm/arm.md (bti_nop): New insn. * config/arm/t-arm (PASSES_EXTRA): Add 'arm-passes.def'. (aarch-bti-insert.o): New target. * config/arm/unspecs.md (VUNSPEC_BTI_NOP): New unspec. * config/arm/aarch-bti-insert.cc (rest_of_insert_bti): Verify arch compatibility. (gate): Make use of 'aarch_bti_arch_check'. * config/arm/arm-passes.def: New file. * config/aarch64/aarch64.cc (aarch_bti_arch_check): New function. gcc/testsuite/ChangeLog 2022-04-07 Andrea Corallo <andrea.corallo@arm.com> * gcc.target/arm/bti-1.c: New testcase. * gcc.target/arm/bti-2.c: Likewise.
Diffstat (limited to 'gcc/config.gcc')
-rw-r--r--gcc/config.gcc2
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/config.gcc b/gcc/config.gcc
index 0d5a5ee..a5b0cbc 100644
--- a/gcc/config.gcc
+++ b/gcc/config.gcc
@@ -362,7 +362,7 @@ arc*-*-*)
;;
arm*-*-*)
cpu_type=arm
- extra_objs="arm-builtins.o arm-mve-builtins.o aarch-common.o"
+ extra_objs="arm-builtins.o arm-mve-builtins.o aarch-common.o aarch-bti-insert.o"
extra_headers="mmintrin.h arm_neon.h arm_acle.h arm_fp16.h arm_cmse.h arm_bf16.h arm_mve_types.h arm_mve.h arm_cde.h"
target_type_format_char='%'
c_target_objs="arm-c.o"