]> git.ipfire.org Git - thirdparty/gcc.git/commit
aarch64: Fix missing BTI instruction in trampolines
authorOmar Tahir <omar.tahir@arm.com>
Wed, 1 Jul 2020 20:56:16 +0000 (21:56 +0100)
committerGiuliano Belinassi <giuliano.belinassi@usp.br>
Mon, 17 Aug 2020 16:15:50 +0000 (13:15 -0300)
commitf5214a448db34aa997561c71cbe6cb94a7e62218
tree5c7e88ece469a267b4af7f7f4e66f2f2f2eecb61
parent14a866396b599ee5d19abc70fd83003f593fc01b
aarch64: Fix missing BTI instruction in trampolines

If two functions require trampolines, and the first has BTI enabled
while the second doesn't, the generated template will be lacking
a BTI instruction.  This patch fixes this by always adding a BTI
instruction, which is safe as BTI instructions are ignored on
unsupported architecture versions.

2020-07-01  Omar Tahir  <omar.tahir@arm.com>

gcc/
* config/aarch64/aarch64.c (aarch64_asm_trampoline_template): Always
generate a BTI instruction.

gcc/testsuite/
* gcc.target/aarch64/bti-4.c: New test.
gcc/config/aarch64/aarch64.c
gcc/testsuite/gcc.target/aarch64/bti-4.c [new file with mode: 0644]