[PATCH] D59780: Support Intel Control-flow Enforcement Technology

Peter Smith via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 25 10:53:55 PDT 2019


peter.smith added a comment.

I'll take a look at this tomorrow. I found https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=92ac8192dd3bd4b48d6ba882af1f1649231258e9 which was the initial commit for cet and ibt. Specifically:

  +    case OPT_mcet:
  +    case OPT_mibt:
  +      if (value)
  +       {
  +         opts->x_ix86_isa_flags2 |= OPTION_MASK_ISA_IBT_SET;
  +         opts->x_ix86_isa_flags2_explicit |= OPTION_MASK_ISA_IBT_SET;
  +       }
  +      else
  +       {
  +         opts->x_ix86_isa_flags2 &= ~OPTION_MASK_ISA_IBT_UNSET;
  +         opts->x_ix86_isa_flags2_explicit |= OPTION_MASK_ISA_IBT_UNSET;
  +       }
  +      if (code != OPT_mcet)
  +       return true;
  +      /* fall through.  */
  +
  +    case OPT_mshstk:
  +      if (value)
  +       {
  +         opts->x_ix86_isa_flags2 |= OPTION_MASK_ISA_SHSTK_SET;
  +         opts->x_ix86_isa_flags2_explicit |= OPTION_MASK_ISA_SHSTK_SET;
  +       }
  +      else
  +       {
  +         opts->x_ix86_isa_flags2 &= ~OPTION_MASK_ISA_SHSTK_UNSET;
  +         opts->x_ix86_isa_flags2_explicit |= OPTION_MASK_ISA_SHSTK_UNSET;
  +       }
  +      return true;
  +

I think -mibt and -mcet both enable IBT but only -mcet allows -mshstk.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D59780/new/

https://reviews.llvm.org/D59780





More information about the llvm-commits mailing list