Implement CET Shadow Stack (Intel Controlflow Enforcement Technology) support on...
authorRui Ueyama <ruiu@google.com>
Fri, 13 Mar 2020 10:41:18 +0000 (19:41 +0900)
committerRui Ueyama <ruiu@google.com>
Mon, 16 Mar 2020 08:51:32 +0000 (17:51 +0900)
commita2923b2a1e4536dd14e93bed5c1306e0e54d5304
treeb4d75201a1de994a4e92164a158716133a56cc7b
parent2005c60a6bf4a43a921decf713aafc6279cbf07a
Implement CET Shadow Stack (Intel Controlflow Enforcement Technology) support on Windows

Patch by Petr Penzin.

Windows support for CET is limited to shadow stack, which is enabled
by setting a PE bit in the linker.

Docs:

MSVC linker flag:
https://docs.microsoft.com/en-us/cpp/build/reference/cetcompat?view=vs-2019

IMAGE_DLLCHARACTERISTICS_EX_CET_COMPAT PE bit:
https://docs.microsoft.com/en-us/windows/win32/debug/pe-format#extended-dll-characteristics

Differential Revision: https://reviews.llvm.org/D70606
lld/COFF/Config.h
lld/COFF/Driver.cpp
lld/COFF/Options.td
lld/COFF/Writer.cpp
lld/test/COFF/options.test
llvm/include/llvm/BinaryFormat/COFF.h
llvm/test/tools/llvm-readobj/COFF/Inputs/has-cet.exe [new file with mode: 0644]
llvm/test/tools/llvm-readobj/COFF/cetcompat.test [new file with mode: 0644]
llvm/tools/llvm-readobj/COFFDumper.cpp