Files
llvm/lld/test/COFF/pdb-unknown-subsection.s
Reid Kleckner fe44a531e0 [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-16 18:17:33 +00:00

61 lines
1.8 KiB
ArmAsm

# Check that unknown symbol subsections are ignored with a warning, and a PDB
# is produced anyway.
# REQUIRES: x86
# RUN: llvm-mc -triple=i386-pc-win32 -filetype=obj -o %t.obj %s
# RUN: lld-link -safeseh:no -subsystem:console -debug -nodefaultlib -entry:foo -out:%t.exe -pdb:%t.pdb %t.obj 2>&1 | FileCheck %s --check-prefix=WARNING
# RUN: llvm-pdbutil dump -symbols %t.pdb | FileCheck %s
# WARNING-NOT: ignoring unknown
# WARNING: ignoring unknown debug$S subsection kind 0xFF
# WARNING-NOT: ignoring unknown
# CHECK: Symbols
# CHECK: 4 | S_COMPILE3 [size = 52]
# CHECK: machine = intel x86-x64, Ver = clang version SENTINEL, language = c
.text
_foo:
ret
.global _foo
.section .debug$S,"dr"
.p2align 2
.long 4 # Debug section magic
.long 0xF1 # Symbol subsection
.long .Ltmp6-.Ltmp5 # Subsection size
.Ltmp5:
.short .Ltmp8-.Ltmp7 # Record length
.Ltmp7:
.short 4412 # Record kind: S_COMPILE3
.long 0 # Flags and language
.short 208 # CPUType
.short 9 # Frontend version
.short 0
.short 0
.short 0
.short 9000 # Backend version
.short 0
.short 0
.short 0
.asciz "clang version SENTINEL" # Null-terminated compiler version string
.p2align 2
.Ltmp8:
.Ltmp6:
.long 0xFF # Unknown subsection kind
.long 4 # Subsection size
.long 0
.long 0x800000F1 # Unknown subsection kind
.long 4 # Subsection size
.long 0
.long 0x800000F2 # Unknown subsection kind
.long 4 # Subsection size
.long 0
.long 0x800000F3 # Unknown subsection kind
.long 4 # Subsection size
.long 0
.long 0x800000F4 # Unknown subsection kind
.long 4 # Subsection size
.long 0