2 # RUN: llvm-mc -triple x86_64-windows-msvc %s -filetype=obj -o %t.obj
3 # RUN: lld-link %t.obj -opt:noref -guard:cf,nolongjmp -out:%t.exe -entry:main 2>&1 | FileCheck %s --check-prefix=ERRS
4 # RUN: llvm-readobj --file-headers --coff-load-config %t.exe | FileCheck %s
6 # ERRS: warning: ignoring .gfids$y symbol table index section in object {{.*}}gfids-corrupt{{.*}}
7 # ERRS: warning: ignoring invalid symbol table index in section .gfids$y in object {{.*}}gfids-corrupt{{.*}}
9 # The table is arbitrary, really.
10 # CHECK: ImageBase: 0x140000000
12 # CHECK: SEHandlerTable: 0x0
13 # CHECK: SEHandlerCount: 0
14 # CHECK: GuardCFCheckFunction: 0x0
15 # CHECK: GuardCFCheckDispatch: 0x0
16 # CHECK: GuardCFFunctionTable: 0x14000{{.*}}
17 # CHECK: GuardCFFunctionCount: 2
18 # CHECK: GuardFlags [ (0x500)
19 # CHECK: CF_FUNCTION_TABLE_PRESENT (0x400)
20 # CHECK: CF_INSTRUMENTED (0x100)
22 # CHECK: GuardAddressTakenIatEntryTable: 0x0
23 # CHECK: GuardAddressTakenIatEntryCount: 0
24 # CHECK: GuardLongJumpTargetTable: 0x0
25 # CHECK: GuardLongJumpTargetCount: 0
27 # CHECK: GuardFidTable [
28 # CHECK-NEXT: 0x14000{{.*}}
29 # CHECK-NEXT: 0x14000{{.*}}
33 # Indicate that gfids are present.
34 .def @feat.00; .scl 3; .type 0; .endef
38 .def f1; .scl 2; .type 32; .endef
39 .section .text,"xr",one_only,f1
45 .def f2; .scl 2; .type 32; .endef
46 .section .text,"xr",one_only,f2
52 .section .data,"dw",one_only,fp1
57 .section .data,"dw",one_only,fp2
62 .section .gfids$y,"dr",associative,fp1
66 .section .gfids$y,"dr",associative,fp2
70 .def main; .scl 2; .type 32; .endef
71 .section .text,"xr",one_only,main
80 .globl _load_config_used
84 .quad __guard_fids_table
85 .quad __guard_fids_count