[lld] r218077 - [PECOFF] /safeseh:no on x64 is not an error

Rui Ueyama ruiu at google.com
Thu Sep 18 14:18:06 PDT 2014


Author: ruiu
Date: Thu Sep 18 16:18:05 2014
New Revision: 218077

URL: http://llvm.org/viewvc/llvm-project?rev=218077&view=rev
Log:
[PECOFF] /safeseh:no on x64 is not an error

I made LLD to report an error if /safeseh:no option is given on x64,
but it turned out MSVC link.exe doesn't report error on it.
Removing the check.

Modified:
    lld/trunk/lib/ReaderWriter/PECOFF/PECOFFLinkingContext.cpp
    lld/trunk/test/pecoff/safeseh.test

Modified: lld/trunk/lib/ReaderWriter/PECOFF/PECOFFLinkingContext.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/PECOFF/PECOFFLinkingContext.cpp?rev=218077&r1=218076&r2=218077&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/PECOFF/PECOFFLinkingContext.cpp (original)
+++ lld/trunk/lib/ReaderWriter/PECOFF/PECOFFLinkingContext.cpp Thu Sep 18 16:18:05 2014
@@ -74,12 +74,6 @@ bool PECOFFLinkingContext::validateImpl(
     return false;
   }
 
-  // /safeseh is only valid for x86.
-  if (getMachineType() != llvm::COFF::IMAGE_FILE_MACHINE_I386 && noSEH()) {
-    diagnostics << "/SAFESEH:NO is only valid for x86.\n";
-    return false;
-  }
-
   // Architectures other than x86/x64 is not supported yet.
   if (_machineType != llvm::COFF::IMAGE_FILE_MACHINE_I386 &&
       _machineType != llvm::COFF::IMAGE_FILE_MACHINE_AMD64) {

Modified: lld/trunk/test/pecoff/safeseh.test
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/pecoff/safeseh.test?rev=218077&r1=218076&r2=218077&view=diff
==============================================================================
--- lld/trunk/test/pecoff/safeseh.test (original)
+++ lld/trunk/test/pecoff/safeseh.test Thu Sep 18 16:18:05 2014
@@ -7,10 +7,3 @@
 # RUN: FileCheck -check-prefix=INCOMPAT %s < %t1.err
 
 INCOMPAT: /SAFESEH is specified, but {{.*}} is not compatible with SEH.
-
-# RUN: yaml2obj %p/Inputs/seh.obj.yaml > %t2.obj
-# RUN: not lld -flavor link /machine:x64 /safeseh:no /out:%t2.exe \
-# RUN:   /subsystem:console -- %t2.obj 2> %t2.err
-# RUN: FileCheck -check-prefix=X64 %s < %t2.err
-
-X64: /SAFESEH:NO is only valid for x86.





More information about the llvm-commits mailing list