From 2b964108a07da4718354af675138aa0ccd0e1a1f Mon Sep 17 00:00:00 2001 From: Martin Storsjo Date: Tue, 12 Dec 2017 08:22:29 +0000 Subject: [PATCH] [COFF] Don't error out on undefined references to __enclave_config This is required for linking the CRT from MSVC 2017 15.5. Differential Revision: https://reviews.llvm.org/D41089 llvm-svn: 320462 --- lld/COFF/Driver.cpp | 2 ++ lld/test/COFF/guardcf.test | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/lld/COFF/Driver.cpp b/lld/COFF/Driver.cpp index 835c4b396ef2..016efc8a02ea 100644 --- a/lld/COFF/Driver.cpp +++ b/lld/COFF/Driver.cpp @@ -1167,6 +1167,8 @@ void LinkerDriver::link(ArrayRef ArgsArr) { Symtab->addAbsolute(mangle("__guard_iat_table"), 0); Symtab->addAbsolute(mangle("__guard_longjmp_count"), 0); Symtab->addAbsolute(mangle("__guard_longjmp_table"), 0); + // Needed for MSVC 2017 15.5 CRT. + Symtab->addAbsolute(mangle("__enclave_config"), 0); // This code may add new undefined symbols to the link, which may enqueue more // symbol resolution tasks, so we need to continue executing tasks until we diff --git a/lld/test/COFF/guardcf.test b/lld/test/COFF/guardcf.test index 4f99d705301c..57dca5870d0f 100644 --- a/lld/test/COFF/guardcf.test +++ b/lld/test/COFF/guardcf.test @@ -71,4 +71,10 @@ symbols: SimpleType: IMAGE_SYM_TYPE_NULL ComplexType: IMAGE_SYM_DTYPE_NULL StorageClass: IMAGE_SYM_CLASS_EXTERNAL + - Name: __enclave_config + Value: 0 + SectionNumber: 0 + SimpleType: IMAGE_SYM_TYPE_NULL + ComplexType: IMAGE_SYM_DTYPE_NULL + StorageClass: IMAGE_SYM_CLASS_EXTERNAL ... -- GitLab