brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.5 KiB · 7380768 Raw
99 lines · plain
1# REQUIRES: x862# RUN: llvm-mc -triple x86_64-windows-msvc %s -filetype=obj -o %t.obj3# RUN: lld-link %t.obj -guard:cf -guard:ehcont -out:%t.exe -entry:main4# RUN: llvm-readobj --file-headers --coff-load-config %t.exe | FileCheck %s5 6# CHECK: ImageBase: 0x1400000007# CHECK: LoadConfig [8# CHECK:   SEHandlerTable: 0x09# CHECK:   SEHandlerCount: 010# CHECK:   GuardCFCheckFunction: 0x011# CHECK:   GuardCFCheckDispatch: 0x012# CHECK:   GuardCFFunctionTable: 0x14000{{.*}}13# CHECK:   GuardCFFunctionCount: 114# CHECK:   GuardFlags [ (0x400500)15# CHECK:     CF_FUNCTION_TABLE_PRESENT (0x400)16# CHECK:     CF_INSTRUMENTED (0x100)17# CHECK:     EH_CONTINUATION_TABLE_PRESENT (0x400000)18# CHECK:   ]19# CHECK:   GuardAddressTakenIatEntryTable: 0x020# CHECK:   GuardAddressTakenIatEntryCount: 021# CHECK:   GuardEHContinuationTable: 0x14000{{.*}}22# CHECK:   GuardEHContinuationCount: 223# CHECK: ]24# CHECK:      GuardEHContTable [25# CHECK-NEXT:   0x14000{{.*}}26# CHECK-NEXT:   0x14000{{.*}}27# CHECK-NEXT: ]28 29# We need @feat.00 to have 0x4000 to indicate /guard:ehcont.30        .def     @feat.00;31        .scl    3;32        .type   0;33        .endef34        .globl  @feat.0035@feat.00 = 0x400036        .def     main; .scl    2; .type   32; .endef37        .globl	main                            # -- Begin function main38        .p2align	4, 0x9039main:40.seh_proc main41        .seh_handler __C_specific_handler, @unwind, @except42        .seh_handlerdata43        .long 244        .long (seh_begin)@IMGREL45        .long (seh_end)@IMGREL46        .long 147        .long (seh_except)@IMGREL48        .long (seh2_begin)@IMGREL49        .long (seh2_end)@IMGREL50        .long 151        .long (seh2_except)@IMGREL52        .text53    seh_begin:54        nop55        int356        nop57    seh_end:58        nop59    seh_except:60        nop61 62    seh2_begin:63        nop64        int365        nop66    seh2_end:67        nop68    seh2_except:69        nop70 71        xor %eax, %eax72        ret73.seh_endproc74 75__C_specific_handler:76        ret77 78.section	.gehcont$y,"dr"79.symidx	seh_except80.symidx	seh2_except81 82.section  .rdata,"dr"83.globl _load_config_used84_load_config_used:85        .long 31286        .fill 124, 1, 087        .quad __guard_fids_table88        .quad __guard_fids_count89        .long __guard_flags90        .fill 12, 1, 091        .quad __guard_iat_table92        .quad __guard_iat_count93        .quad __guard_longjmp_table94        .quad __guard_longjmp_count95        .fill 72, 1, 096        .quad __guard_eh_cont_table97        .quad __guard_eh_cont_count98        .fill 32, 1, 099