[all-commits] [llvm/llvm-project] 1c4664: [RISCV] Support Shadow Call Stack

Zhaoshi Zheng via All-commits all-commits at lists.llvm.org
Thu Sep 17 16:03:00 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 1c466477ad468d8a18c43b738df7b7fc6213e9a8
      https://github.com/llvm/llvm-project/commit/1c466477ad468d8a18c43b738df7b7fc6213e9a8
  Author: Zhaoshi Zheng <zhaoshiz at quicinc.com>
  Date:   2020-09-17 (Thu, 17 Sep 2020)

  Changed paths:
    M clang/lib/Driver/SanitizerArgs.cpp
    M clang/lib/Driver/ToolChain.cpp
    M clang/test/CodeGen/shadowcallstack-attr.c
    M clang/test/Driver/sanitizer-ld.c
    M llvm/lib/Target/RISCV/RISCVFrameLowering.cpp
    M llvm/lib/Target/RISCV/Utils/RISCVBaseInfo.cpp
    M llvm/lib/Target/RISCV/Utils/RISCVBaseInfo.h
    A llvm/test/CodeGen/RISCV/shadowcallstack.ll

  Log Message:
  -----------
  [RISCV] Support Shadow Call Stack

Currenlty assume x18 is used as pointer to shadow call stack. User shall pass
flags:

"-fsanitize=shadow-call-stack -ffixed-x18"

Runtime supported is needed to setup x18.

If SCS is desired, all parts of the program should be built with -ffixed-x18 to
maintain inter-operatability.

There's no particuluar reason that we must use x18 as SCS pointer. Any register
may be used, as long as it does not have designated purpose already, like RA or
passing call arguments.

Differential Revision: https://reviews.llvm.org/D84414




More information about the All-commits mailing list