2 # RUN: llvm-mc -triple x86_64-windows-msvc %s -filetype=obj -o %t.obj
3 # RUN: lld-link %t.obj -guard:cf -guard:ehcont -out:%t.exe -entry:main
4 # RUN: llvm-readobj --file-headers --coff-load-config %t.exe | FileCheck %s
6 # CHECK: ImageBase: 0x140000000
8 # CHECK: SEHandlerTable: 0x0
9 # CHECK: SEHandlerCount: 0
10 # CHECK: GuardCFCheckFunction: 0x0
11 # CHECK: GuardCFCheckDispatch: 0x0
12 # CHECK: GuardCFFunctionTable: 0x14000{{.*}}
13 # CHECK: GuardCFFunctionCount: 1
14 # CHECK: GuardFlags [ (0x400500)
15 # CHECK: CF_FUNCTION_TABLE_PRESENT (0x400)
16 # CHECK: CF_INSTRUMENTED (0x100)
17 # CHECK: EH_CONTINUATION_TABLE_PRESENT (0x400000)
19 # CHECK: GuardAddressTakenIatEntryTable: 0x0
20 # CHECK: GuardAddressTakenIatEntryCount: 0
21 # CHECK: GuardEHContinuationTable: 0x14000{{.*}}
22 # CHECK: GuardEHContinuationCount: 2
24 # CHECK: GuardEHContTable [
25 # CHECK-NEXT: 0x14000{{.*}}
26 # CHECK-NEXT: 0x14000{{.*}}
29 # We need @feat.00 to have 0x4000 to indicate /guard:ehcont.
36 .def main; .scl 2; .type 32; .endef
37 .globl main # -- Begin function main
41 .seh_handler __C_specific_handler, @unwind, @except
44 .long (seh_begin)@IMGREL
45 .long (seh_end)@IMGREL
47 .long (seh_except)@IMGREL
48 .long (seh2_begin)@IMGREL
49 .long (seh2_end)@IMGREL
51 .long (seh2_except)@IMGREL
78 .section .gehcont$y,"dr"
83 .globl _load_config_used
87 .quad __guard_fids_table
88 .quad __guard_fids_count
91 .quad __guard_iat_table
92 .quad __guard_iat_count
93 .quad __guard_longjmp_table
94 .quad __guard_longjmp_count
96 .quad __guard_eh_cont_table
97 .quad __guard_eh_cont_count