2020-08-21 06:00:25 +08:00
|
|
|
# RUN: yaml2obj %s -o %t.obj
|
[COFF] Implement /safeseh:no and check @feat.00 flags by default
Summary:
Fixes PR41828. Before this, LLD always emitted SafeSEH chunks and
defined __safe_se_handler_table & size. Now, /safeseh:no leaves those
undefined.
Additionally, we were checking for the safeseh @feat.00 flag in two
places: once to emit errors, and once during safeseh table construction.
The error was set up to be off by default, but safeseh is supposed to be
on by default. I combined the two checks, so now LLD emits an error if
an input object lacks @feat.00 and safeseh is enabled. This caused the
majority of 32-bit LLD tests to fail, since many test input object files
lack @feat.00 symbols. I explicitly added -safeseh:no to those tests to
preserve behavior.
Finally, LLD no longer sets IMAGE_DLL_CHARACTERISTICS_NO_SEH if any
input file wasn't compiled for safeseh.
Reviewers: mstorsjo, ruiu, thakis
Reviewed By: ruiu, thakis
Subscribers: llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D63570
llvm-svn: 366238
2019-07-17 02:17:33 +08:00
|
|
|
# RUN: lld-link -safeseh:no /out:%t.exe %t.obj /entry:main /subsystem:console
|
2019-05-01 13:49:01 +08:00
|
|
|
# RUN: llvm-readobj --file-headers %t.exe | FileCheck %s
|
2015-07-17 02:30:35 +08:00
|
|
|
|
2018-04-05 03:15:55 +08:00
|
|
|
# CHECK: LoadConfigTableRVA: 0x2000
|
2015-07-17 02:30:35 +08:00
|
|
|
# CHECK: LoadConfigTableSize: 0x40
|
|
|
|
|
2016-06-28 04:17:08 +08:00
|
|
|
--- !COFF
|
2015-07-17 02:30:35 +08:00
|
|
|
header:
|
|
|
|
Machine: IMAGE_FILE_MACHINE_I386
|
|
|
|
Characteristics: []
|
|
|
|
sections:
|
|
|
|
- Name: .text
|
|
|
|
Characteristics: [ IMAGE_SCN_CNT_CODE, IMAGE_SCN_MEM_EXECUTE, IMAGE_SCN_MEM_READ ]
|
|
|
|
Alignment: 4
|
|
|
|
SectionData: B82A000000C3
|
2016-03-15 17:48:27 +08:00
|
|
|
- Name: .rdata
|
|
|
|
Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_READ ]
|
|
|
|
Alignment: 4
|
|
|
|
SectionData: '40000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000'
|
2015-07-17 02:30:35 +08:00
|
|
|
symbols:
|
|
|
|
- Name: .text
|
|
|
|
Value: 0
|
|
|
|
SectionNumber: 1
|
|
|
|
SimpleType: IMAGE_SYM_TYPE_NULL
|
|
|
|
ComplexType: IMAGE_SYM_DTYPE_NULL
|
|
|
|
StorageClass: IMAGE_SYM_CLASS_STATIC
|
|
|
|
SectionDefinition:
|
|
|
|
Length: 6
|
|
|
|
NumberOfRelocations: 0
|
|
|
|
NumberOfLinenumbers: 0
|
|
|
|
CheckSum: 0
|
|
|
|
Number: 0
|
|
|
|
- Name: _main
|
|
|
|
Value: 0
|
|
|
|
SectionNumber: 1
|
|
|
|
SimpleType: IMAGE_SYM_TYPE_NULL
|
|
|
|
ComplexType: IMAGE_SYM_DTYPE_NULL
|
|
|
|
StorageClass: IMAGE_SYM_CLASS_EXTERNAL
|
2016-03-15 17:48:27 +08:00
|
|
|
- Name: .rdata
|
|
|
|
Value: 0
|
|
|
|
SectionNumber: 2
|
|
|
|
SimpleType: IMAGE_SYM_TYPE_NULL
|
|
|
|
ComplexType: IMAGE_SYM_DTYPE_NULL
|
|
|
|
StorageClass: IMAGE_SYM_CLASS_STATIC
|
|
|
|
SectionDefinition:
|
|
|
|
Length: 64
|
|
|
|
NumberOfRelocations: 0
|
|
|
|
NumberOfLinenumbers: 0
|
|
|
|
CheckSum: 0
|
|
|
|
Number: 2
|
2015-07-17 02:30:35 +08:00
|
|
|
- Name: __load_config_used
|
|
|
|
Value: 0
|
2016-03-15 17:48:27 +08:00
|
|
|
SectionNumber: 2
|
2015-07-17 02:30:35 +08:00
|
|
|
SimpleType: IMAGE_SYM_TYPE_NULL
|
|
|
|
ComplexType: IMAGE_SYM_DTYPE_NULL
|
|
|
|
StorageClass: IMAGE_SYM_CLASS_EXTERNAL
|
|
|
|
...
|