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
17 lines
506 B
Plaintext
17 lines
506 B
Plaintext
# To regenerate has-cet.exe
|
|
# $ echo int main() { return 0; } > has-cet.c
|
|
# $ cl has-cet.c /link /cetcompat
|
|
RUN: llvm-readobj --coff-debug-directory %p/Inputs/has-cet.exe | FileCheck %s
|
|
|
|
CHECK: DebugEntry {
|
|
CHECK: Characteristics: 0x0
|
|
CHECK: Type: ExtendedDLLCharacteristics (0x14)
|
|
CHECK: ExtendedCharacteristics [ (0x1)
|
|
CHECK: IMAGE_DLL_CHARACTERISTICS_EX_CET_COMPAT (0x1)
|
|
CHECK: ]
|
|
CHECK: RawData (
|
|
CHECK: 0000: 01000000 |....|
|
|
CHECK: )
|
|
CHECK: }
|
|
|