1# REQUIRES: x86 2# RUN: llvm-mc -triple i686-windows-msvc %s -filetype=obj -o %t.obj 3# RUN: lld-link %t.obj -safeseh -out:%t.exe -entry:main 4# RUN: llvm-readobj --file-headers %t.exe | FileCheck %s 5 6# This object lacks a _load_config_used global, so we set 7# IMAGE_DLL_CHARACTERISTICS_NO_SEH even though there is an exception handler. 8# This is a more secure default. If someone wants to use a CRT without a load 9# config and they want to use 32-bit SEH, they will need to provide a 10# safeseh-compatible load config. 11 12# CHECK-LABEL: Characteristics [ 13# CHECK: IMAGE_DLL_CHARACTERISTICS_NO_SEH 14# CHECK: ] 15 16# CHECK-LABEL: DataDirectory { 17# CHECK: LoadConfigTableRVA: 0x0 18# CHECK: LoadConfigTableSize: 0x0 19# CHECK: } 20 21# CHECK-NOT: LoadConfig 22# CHECK-NOT: SEHTable 23 24 .def @feat.00; 25 .scl 3; 26 .type 0; 27 .endef 28 .globl @feat.00 29@feat.00 = 1 30 31 .text 32 .def _main; .scl 2; .type 32; .endef 33 .globl _main 34_main: 35 pushl $_my_handler 36 movl $42, %eax 37 popl %ecx 38 ret 39 40 .def _my_handler; .scl 3; .type 32; .endef 41_my_handler: 42 ret 43 44.safeseh _my_handler 45