[all-commits] [llvm/llvm-project] 7cd429: [ELF] Add -z force-ibt and -z shstk for Intel Cont...

Fangrui Song via All-commits all-commits at lists.llvm.org
Mon Jan 13 23:40:42 PST 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 7cd429f27d4886bb841ed0e3702e970f5f6cccd1
      https://github.com/llvm/llvm-project/commit/7cd429f27d4886bb841ed0e3702e970f5f6cccd1
  Author: Fangrui Song <maskray at google.com>
  Date:   2020-01-13 (Mon, 13 Jan 2020)

  Changed paths:
    M lld/ELF/Arch/X86.cpp
    M lld/ELF/Arch/X86_64.cpp
    M lld/ELF/Config.h
    M lld/ELF/Driver.cpp
    M lld/ELF/Options.td
    M lld/ELF/SyntheticSections.cpp
    M lld/ELF/SyntheticSections.h
    M lld/ELF/Target.h
    M lld/ELF/Writer.cpp
    M lld/docs/ld.lld.1
    R lld/test/ELF/i386-cet.s
    A lld/test/ELF/i386-feature-cet.s
    R lld/test/ELF/x86-64-cet.s
    A lld/test/ELF/x86-64-feature-cet.s

  Log Message:
  -----------
  [ELF] Add -z force-ibt and -z shstk for Intel Control-flow Enforcement Technology

This patch is a joint work by Rui Ueyama and me based on D58102 by Xiang Zhang.

It adds Intel CET (Control-flow Enforcement Technology) support to lld.
The implementation follows the draft version of psABI which you can
download from https://github.com/hjl-tools/x86-psABI/wiki/X86-psABI.

CET introduces a new restriction on indirect jump instructions so that
you can limit the places to which you can jump to using indirect jumps.

In order to use the feature, you need to compile source files with
-fcf-protection=full.

* IBT is enabled if all input files are compiled with the flag. To force enabling ibt, pass -z force-ibt.
* SHSTK is enabled if all input files are compiled with the flag, or if -z shstk is specified.

IBT-enabled executables/shared objects have two PLT sections, ".plt" and
".plt.sec".  For the details as to why we have two sections, please read
the comments.

Reviewed By: xiangzhangllvm

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




More information about the All-commits mailing list