RISC-V: Add support for TLS stack protector canary access
authorCooper Qu <cooper.qu@linux.alibaba.com>
Mon, 13 Jul 2020 08:15:08 +0000 (16:15 +0800)
committerKito Cheng <kito.cheng@sifive.com>
Thu, 30 Jul 2020 16:25:52 +0000 (00:25 +0800)
commitc931e8d5a96463427040b0d11f9c4352ac22b2b0
tree7c12893a5d0b6583368da7a8dca22d352ccdfca9
parentfebd7c43bce0a305aa24ed214ea6a5cba69753dd
RISC-V: Add support for TLS stack protector canary access

gcc/
* config/riscv/riscv-opts.h (stack_protector_guard): New enum.
* config/riscv/riscv.c (riscv_option_override): Handle
the new options.
* config/riscv/riscv.md (stack_protect_set): New pattern to handle
flexible stack protector guard settings.
(stack_protect_set_<mode>): Ditto.
(stack_protect_test): Ditto.
(stack_protect_test_<mode>): Ditto.
* config/riscv/riscv.opt (mstack-protector-guard=,
mstack-protector-guard-reg=, mstack-protector-guard-offset=): New
options.
* doc/invoke.texi (Option Summary) [RISC-V Options]:
Add -mstack-protector-guard=, -mstack-protector-guard-reg=, and
-mstack-protector-guard-offset=.
(RISC-V Options): Ditto.

Signed-off-by: cooper <cooper.qu@linux.alibaba.com>
Signed-off-by: Guo Ren <guoren@linux.alibaba.com>
gcc/config/riscv/riscv-opts.h
gcc/config/riscv/riscv.c
gcc/config/riscv/riscv.md
gcc/config/riscv/riscv.opt
gcc/doc/invoke.texi