diff options
author | Reid Kleckner <reid@kleckner.net> | 2013-09-17 23:18:05 +0000 |
---|---|---|
committer | Reid Kleckner <reid@kleckner.net> | 2013-09-17 23:18:05 +0000 |
commit | 28860823ad34d41d4f58561dc14a982fb0843fdd (patch) | |
tree | c9accba4573b7a3d6dad99873d16f283411b017a /test | |
parent | c61c8116212c68ebc81a9dc06327d6cc806b1f08 (diff) | |
download | llvm-28860823ad34d41d4f58561dc14a982fb0843fdd.tar.gz llvm-28860823ad34d41d4f58561dc14a982fb0843fdd.tar.bz2 llvm-28860823ad34d41d4f58561dc14a982fb0843fdd.tar.xz |
COFF: Ensure that objects produced by LLVM link with /safeseh
Summary:
We indicate that the object files are safe by emitting a @feat.00
absolute address symbol. The address is presumably interpreted as a
bitfield of features that the compiler would like to enable. Bit 0 is
documented in the PE COFF spec to opt in to "registered SEH", which is
what /safeseh enables.
LLVM's object files are safe by default because LLVM doesn't know how to
produce SEH handlers.
Reviewers: Bigcheese
CC: llvm-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D1691
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190898 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r-- | test/CodeGen/X86/coff-feat00.ll | 7 | ||||
-rw-r--r-- | test/MC/COFF/feat00.s | 13 |
2 files changed, 20 insertions, 0 deletions
diff --git a/test/CodeGen/X86/coff-feat00.ll b/test/CodeGen/X86/coff-feat00.ll new file mode 100644 index 0000000000..1dcd427639 --- /dev/null +++ b/test/CodeGen/X86/coff-feat00.ll @@ -0,0 +1,7 @@ +; RUN: llc -O0 -mtriple=i386-pc-win32 -filetype=asm -o - %s | FileCheck %s + +define i32 @foo() { + ret i32 0 +} + +; CHECK: @feat.00 = 1 diff --git a/test/MC/COFF/feat00.s b/test/MC/COFF/feat00.s new file mode 100644 index 0000000000..b8862de198 --- /dev/null +++ b/test/MC/COFF/feat00.s @@ -0,0 +1,13 @@ +// RUN: llvm-mc -filetype=obj -triple i686-pc-win32 %s -o - | llvm-readobj -t | FileCheck %s + +"@feat.00" = 123 + +// CHECK: Symbol { +// CHECK: Name: @feat.00 +// CHECK: Value: 123 +// CHECK: Section: (-1) +// CHECK: BaseType: Null (0x0) +// CHECK: ComplexType: Null (0x0) +// CHECK: StorageClass: External (0x2) +// CHECK: AuxSymbolCount: 0 +// CHECK: } |