mirror of
https://github.com/intel/llvm.git
synced 2026-02-08 08:57:43 +08:00
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
22 lines
834 B
Plaintext
22 lines
834 B
Plaintext
# RUN: yaml2obj < %p/Inputs/hello32.yaml > %t.obj
|
|
# RUN: lld-link -safeseh:no %t.obj %p/Inputs/std32.lib /subsystem:console \
|
|
# RUN: /entry:main@0 /out:%t.exe /largeaddressaware
|
|
# RUN: llvm-readobj --file-headers %t.exe | FileCheck -check-prefix=HEADER %s
|
|
|
|
HEADER: Format: COFF-i386
|
|
HEADER-NEXT: Arch: i386
|
|
HEADER-NEXT: AddressSize: 32bit
|
|
HEADER-NEXT: ImageFileHeader {
|
|
HEADER-NEXT: Machine: IMAGE_FILE_MACHINE_I386 (0x14C)
|
|
HEADER-NEXT: SectionCount: 4
|
|
HEADER-NEXT: TimeDateStamp:
|
|
HEADER-NEXT: PointerToSymbolTable: 0x0
|
|
HEADER-NEXT: SymbolCount: 0
|
|
HEADER-NEXT: OptionalHeaderSize: 224
|
|
HEADER-NEXT: Characteristics [ (0x122)
|
|
HEADER-NEXT: IMAGE_FILE_32BIT_MACHINE (0x100)
|
|
HEADER-NEXT: IMAGE_FILE_EXECUTABLE_IMAGE (0x2)
|
|
HEADER-NEXT: IMAGE_FILE_LARGE_ADDRESS_AWARE (0x20)
|
|
HEADER-NEXT: ]
|
|
HEADER-NEXT: }
|