[lld] r202215 - [PECOFF] Fix DLLCharacteristics field.
Rui Ueyama
ruiu at google.com
Tue Feb 25 18:31:53 PST 2014
Author: ruiu
Date: Tue Feb 25 20:31:53 2014
New Revision: 202215
URL: http://llvm.org/viewvc/llvm-project?rev=202215&view=rev
Log:
[PECOFF] Fix DLLCharacteristics field.
IMAGE_DLL_CHARACTERISTICS_NO_SEH flag should be set only when SEH is disabled.
Modified:
lld/trunk/lib/ReaderWriter/PECOFF/WriterPECOFF.cpp
lld/trunk/test/pecoff/pe32plus.test
lld/trunk/test/pecoff/trivial.test
Modified: lld/trunk/lib/ReaderWriter/PECOFF/WriterPECOFF.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/PECOFF/WriterPECOFF.cpp?rev=202215&r1=202214&r2=202215&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/PECOFF/WriterPECOFF.cpp (original)
+++ lld/trunk/lib/ReaderWriter/PECOFF/WriterPECOFF.cpp Tue Feb 25 20:31:53 2014
@@ -385,7 +385,9 @@ PEHeaderChunk<PEHeader>::PEHeaderChunk(c
// executables and DLLs. We are not very sure if the following bits must
// be set, but regular binaries seem to have these bits, so we follow
// them.
- uint16_t dllCharacteristics = llvm::COFF::IMAGE_DLL_CHARACTERISTICS_NO_SEH;
+ uint16_t dllCharacteristics = 0;
+ if (ctx.noSEH())
+ dllCharacteristics |= llvm::COFF::IMAGE_DLL_CHARACTERISTICS_NO_SEH;
if (ctx.isTerminalServerAware())
dllCharacteristics |=
llvm::COFF::IMAGE_DLL_CHARACTERISTICS_TERMINAL_SERVER_AWARE;
Modified: lld/trunk/test/pecoff/pe32plus.test
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/pecoff/pe32plus.test?rev=202215&r1=202214&r2=202215&view=diff
==============================================================================
--- lld/trunk/test/pecoff/pe32plus.test (original)
+++ lld/trunk/test/pecoff/pe32plus.test Tue Feb 25 20:31:53 2014
@@ -39,9 +39,8 @@ CHECK-NEXT: MinorSubsystemVersion: 0
CHECK-NEXT: SizeOfImage: 12288
CHECK-NEXT: SizeOfHeaders: 512
CHECK-NEXT: Subsystem: IMAGE_SUBSYSTEM_WINDOWS_CUI (0x3)
-CHECK-NEXT: Subsystem [ (0x8540)
+CHECK-NEXT: Subsystem [ (0x8140)
CHECK-NEXT: IMAGE_DLL_CHARACTERISTICS_DYNAMIC_BASE (0x40)
-CHECK-NEXT: IMAGE_DLL_CHARACTERISTICS_NO_SEH (0x400)
CHECK-NEXT: IMAGE_DLL_CHARACTERISTICS_NX_COMPAT (0x100)
CHECK-NEXT: IMAGE_DLL_CHARACTERISTICS_TERMINAL_SERVER_AWARE (0x8000)
CHECK-NEXT: ]
Modified: lld/trunk/test/pecoff/trivial.test
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/pecoff/trivial.test?rev=202215&r1=202214&r2=202215&view=diff
==============================================================================
--- lld/trunk/test/pecoff/trivial.test (original)
+++ lld/trunk/test/pecoff/trivial.test Tue Feb 25 20:31:53 2014
@@ -48,9 +48,8 @@ FILE-NEXT: MinorSubsystemVersion: 11
FILE-NEXT: SizeOfImage: 8192
FILE-NEXT: SizeOfHeaders: 512
FILE-NEXT: Subsystem: IMAGE_SUBSYSTEM_WINDOWS_CUI (0x3)
-FILE-NEXT: Subsystem [ (0x8540)
+FILE-NEXT: Subsystem [ (0x8140)
FILE-NEXT: IMAGE_DLL_CHARACTERISTICS_DYNAMIC_BASE (0x40)
-FILE-NEXT: IMAGE_DLL_CHARACTERISTICS_NO_SEH (0x400)
FILE-NEXT: IMAGE_DLL_CHARACTERISTICS_NX_COMPAT (0x100)
FILE-NEXT: IMAGE_DLL_CHARACTERISTICS_TERMINAL_SERVER_AWARE (0x8000)
FILE-NEXT: ]
More information about the llvm-commits
mailing list