Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 11 Sep 2018 10:10:17 +0000 (UTC)
From:      Dimitry Andric <dim@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org
Subject:   svn commit: r338583 - in vendor/lld/dist-release_70: COFF docs lib/ReaderWriter/MachO test/COFF test/ELF test/ELF/lto
Message-ID:  <201809111010.w8BAAHi0027728@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: dim
Date: Tue Sep 11 10:10:16 2018
New Revision: 338583
URL: https://svnweb.freebsd.org/changeset/base/338583

Log:
  Vendor import of lld release_70 branch r341916:
  https://llvm.org/svn/llvm-project/lld/branches/release_70@341916

Added:
  vendor/lld/dist-release_70/test/COFF/entry-inference332.test
  vendor/lld/dist-release_70/test/COFF/entry-inference4.test
  vendor/lld/dist-release_70/test/COFF/subsystem-inference32.test
Modified:
  vendor/lld/dist-release_70/COFF/Driver.cpp
  vendor/lld/dist-release_70/COFF/Driver.h
  vendor/lld/dist-release_70/docs/ReleaseNotes.rst
  vendor/lld/dist-release_70/lib/ReaderWriter/MachO/MachONormalizedFileBinaryUtils.h
  vendor/lld/dist-release_70/test/COFF/entry-inference3.test
  vendor/lld/dist-release_70/test/COFF/guardcf-align.s
  vendor/lld/dist-release_70/test/ELF/icf13.s
  vendor/lld/dist-release_70/test/ELF/icf15.s
  vendor/lld/dist-release_70/test/ELF/icf16.s
  vendor/lld/dist-release_70/test/ELF/icf17.s
  vendor/lld/dist-release_70/test/ELF/lto/libcall-archive.ll

Modified: vendor/lld/dist-release_70/COFF/Driver.cpp
==============================================================================
--- vendor/lld/dist-release_70/COFF/Driver.cpp	Tue Sep 11 10:10:13 2018	(r338582)
+++ vendor/lld/dist-release_70/COFF/Driver.cpp	Tue Sep 11 10:10:16 2018	(r338583)
@@ -116,6 +116,19 @@ static std::future<MBErrPair> createFutureForFile(std:
   });
 }
 
+// Symbol names are mangled by prepending "_" on x86.
+static StringRef mangle(StringRef Sym) {
+  assert(Config->Machine != IMAGE_FILE_MACHINE_UNKNOWN);
+  if (Config->Machine == I386)
+    return Saver.save("_" + Sym);
+  return Sym;
+}
+
+static bool findUnderscoreMangle(StringRef Sym) {
+  StringRef Entry = Symtab->findMangle(mangle(Sym));
+  return !Entry.empty() && !isa<Undefined>(Symtab->find(Entry));
+}
+
 MemoryBufferRef LinkerDriver::takeBuffer(std::unique_ptr<MemoryBuffer> MB) {
   MemoryBufferRef MBRef = *MB;
   make<std::unique_ptr<MemoryBuffer>>(std::move(MB)); // take ownership
@@ -407,54 +420,38 @@ Symbol *LinkerDriver::addUndefined(StringRef Name) {
   return B;
 }
 
-// Symbol names are mangled by appending "_" prefix on x86.
-StringRef LinkerDriver::mangle(StringRef Sym) {
-  assert(Config->Machine != IMAGE_FILE_MACHINE_UNKNOWN);
-  if (Config->Machine == I386)
-    return Saver.save("_" + Sym);
-  return Sym;
-}
-
 // Windows specific -- find default entry point name.
 //
 // There are four different entry point functions for Windows executables,
 // each of which corresponds to a user-defined "main" function. This function
 // infers an entry point from a user-defined "main" function.
 StringRef LinkerDriver::findDefaultEntry() {
+  assert(Config->Subsystem != IMAGE_SUBSYSTEM_UNKNOWN &&
+         "must handle /subsystem before calling this");
+
   // As a special case, if /nodefaultlib is given, we directly look for an
   // entry point. This is because, if no default library is linked, users
   // need to define an entry point instead of a "main".
-  if (Config->NoDefaultLibAll) {
-    for (StringRef S : {"mainCRTStartup", "wmainCRTStartup",
-                        "WinMainCRTStartup", "wWinMainCRTStartup"}) {
-      StringRef Entry = Symtab->findMangle(S);
-      if (!Entry.empty() && !isa<Undefined>(Symtab->find(Entry)))
-        return mangle(S);
-    }
-    return "";
+  bool FindMain = !Config->NoDefaultLibAll;
+  if (Config->Subsystem == IMAGE_SUBSYSTEM_WINDOWS_GUI) {
+    if (findUnderscoreMangle(FindMain ? "WinMain" : "WinMainCRTStartup"))
+      return mangle("WinMainCRTStartup");
+    if (findUnderscoreMangle(FindMain ? "wWinMain" : "wWinMainCRTStartup"))
+      return mangle("wWinMainCRTStartup");
   }
-
-  // User-defined main functions and their corresponding entry points.
-  static const char *Entries[][2] = {
-      {"main", "mainCRTStartup"},
-      {"wmain", "wmainCRTStartup"},
-      {"WinMain", "WinMainCRTStartup"},
-      {"wWinMain", "wWinMainCRTStartup"},
-  };
-  for (auto E : Entries) {
-    StringRef Entry = Symtab->findMangle(mangle(E[0]));
-    if (!Entry.empty() && !isa<Undefined>(Symtab->find(Entry)))
-      return mangle(E[1]);
-  }
+  if (findUnderscoreMangle(FindMain ? "main" : "mainCRTStartup"))
+    return mangle("mainCRTStartup");
+  if (findUnderscoreMangle(FindMain ? "wmain" : "wmainCRTStartup"))
+    return mangle("wmainCRTStartup");
   return "";
 }
 
 WindowsSubsystem LinkerDriver::inferSubsystem() {
   if (Config->DLL)
     return IMAGE_SUBSYSTEM_WINDOWS_GUI;
-  if (Symtab->findUnderscore("main") || Symtab->findUnderscore("wmain"))
+  if (findUnderscoreMangle("main") || findUnderscoreMangle("wmain"))
     return IMAGE_SUBSYSTEM_WINDOWS_CUI;
-  if (Symtab->findUnderscore("WinMain") || Symtab->findUnderscore("wWinMain"))
+  if (findUnderscoreMangle("WinMain") || findUnderscoreMangle("wWinMain"))
     return IMAGE_SUBSYSTEM_WINDOWS_GUI;
   return IMAGE_SUBSYSTEM_UNKNOWN;
 }
@@ -1335,25 +1332,6 @@ void LinkerDriver::link(ArrayRef<const char *> ArgsArr
     error("/dynamicbase:no is not compatible with " +
           machineToStr(Config->Machine));
 
-  // Handle /entry and /dll
-  if (auto *Arg = Args.getLastArg(OPT_entry)) {
-    Config->Entry = addUndefined(mangle(Arg->getValue()));
-  } else if (!Config->Entry && !Config->NoEntry) {
-    if (Args.hasArg(OPT_dll)) {
-      StringRef S = (Config->Machine == I386) ? "__DllMainCRTStartup@12"
-                                              : "_DllMainCRTStartup";
-      Config->Entry = addUndefined(S);
-    } else {
-      // Windows specific -- If entry point name is not given, we need to
-      // infer that from user-defined entry name.
-      StringRef S = findDefaultEntry();
-      if (S.empty())
-        fatal("entry point must be defined");
-      Config->Entry = addUndefined(S);
-      log("Entry name inferred: " + S);
-    }
-  }
-
   // Handle /export
   for (auto *Arg : Args.filtered(OPT_export)) {
     Export E = parseExport(Arg->getValue());
@@ -1379,6 +1357,34 @@ void LinkerDriver::link(ArrayRef<const char *> ArgsArr
     return;
   }
 
+  // Windows specific -- if no /subsystem is given, we need to infer
+  // that from entry point name.  Must happen before /entry handling,
+  // and after the early return when just writing an import library.
+  if (Config->Subsystem == IMAGE_SUBSYSTEM_UNKNOWN) {
+    Config->Subsystem = inferSubsystem();
+    if (Config->Subsystem == IMAGE_SUBSYSTEM_UNKNOWN)
+      fatal("subsystem must be defined");
+  }
+
+  // Handle /entry and /dll
+  if (auto *Arg = Args.getLastArg(OPT_entry)) {
+    Config->Entry = addUndefined(mangle(Arg->getValue()));
+  } else if (!Config->Entry && !Config->NoEntry) {
+    if (Args.hasArg(OPT_dll)) {
+      StringRef S = (Config->Machine == I386) ? "__DllMainCRTStartup@12"
+                                              : "_DllMainCRTStartup";
+      Config->Entry = addUndefined(S);
+    } else {
+      // Windows specific -- If entry point name is not given, we need to
+      // infer that from user-defined entry name.
+      StringRef S = findDefaultEntry();
+      if (S.empty())
+        fatal("entry point must be defined");
+      Config->Entry = addUndefined(S);
+      log("Entry name inferred: " + S);
+    }
+  }
+
   // Handle /delayload
   for (auto *Arg : Args.filtered(OPT_delayload)) {
     Config->DelayLoads.insert(StringRef(Arg->getValue()).lower());
@@ -1490,14 +1496,6 @@ void LinkerDriver::link(ArrayRef<const char *> ArgsArr
   Symtab->reportRemainingUndefines();
   if (errorCount())
     return;
-
-  // Windows specific -- if no /subsystem is given, we need to infer
-  // that from entry point name.
-  if (Config->Subsystem == IMAGE_SUBSYSTEM_UNKNOWN) {
-    Config->Subsystem = inferSubsystem();
-    if (Config->Subsystem == IMAGE_SUBSYSTEM_UNKNOWN)
-      fatal("subsystem must be defined");
-  }
 
   // Handle /safeseh.
   if (Args.hasFlag(OPT_safeseh, OPT_safeseh_no, false)) {

Modified: vendor/lld/dist-release_70/COFF/Driver.h
==============================================================================
--- vendor/lld/dist-release_70/COFF/Driver.h	Tue Sep 11 10:10:13 2018	(r338582)
+++ vendor/lld/dist-release_70/COFF/Driver.h	Tue Sep 11 10:10:16 2018	(r338583)
@@ -103,7 +103,6 @@ class LinkerDriver { (private)
   std::set<std::string> VisitedLibs;
 
   Symbol *addUndefined(StringRef Sym);
-  StringRef mangle(StringRef Sym);
 
   // Windows specific -- "main" is not the only main function in Windows.
   // You can choose one from these four -- {w,}{WinMain,main}.

Modified: vendor/lld/dist-release_70/docs/ReleaseNotes.rst
==============================================================================
--- vendor/lld/dist-release_70/docs/ReleaseNotes.rst	Tue Sep 11 10:10:13 2018	(r338582)
+++ vendor/lld/dist-release_70/docs/ReleaseNotes.rst	Tue Sep 11 10:10:16 2018	(r338583)
@@ -5,35 +5,82 @@ LLD 7.0.0 Release Notes
 .. contents::
     :local:
 
-.. warning::
-   These are in-progress notes for the upcoming LLVM 7.0.0 release.
-   Release notes for previous releases can be found on
-   `the Download Page <http://releases.llvm.org/download.html>`_.
-
 Introduction
 ============
 
-This document contains the release notes for the lld linker, release 7.0.0.
-Here we describe the status of lld, including major improvements
-from the previous release. All lld releases may be downloaded
-from the `LLVM releases web site <http://llvm.org/releases/>`_.
+lld is a high-performance linker that supports ELF (Unix), COFF (Windows),
+Mach-O (macOS), MinGW and WebAssembly. lld is command-line-compatible with GNU
+linkers and Microsoft link.exe, and is significantly faster than these system
+default linkers.
 
+lld 7 for ELF and COFF are production-ready. lld/ELF can build the entire
+FreeBSD/AMD64 and will be the default linker of the next version of the
+operating system. lld/COFF is being used to build popular large programs such as
+the Chrome web browser. Mach-O, MinGW and WebAssembly supports are still
+experimental.
+
 Non-comprehensive list of changes in this release
 =================================================
 
 ELF Improvements
 ----------------
 
-* lld is now able to overcome MIPS GOT entries number limitation
-  and generate multi-GOT if necessary.
+* Fixed a lot of long-tail compatibility issues with GNU linkers.
 
-* lld is now able to produce MIPS position-independent executable (PIE).
+* Added ``-z retpolineplt`` to emit a PLT entry that doesn't contain an indirect
+  jump instruction to mitigate Spectre v2 vulnerability.
 
+* Added experimental support for `SHT_RELR sections
+  <https://groups.google.com/forum/#!topic/generic-abi/bX460iggiKg>`_ to create a
+  compact dynamic relocation table.
+
+* Added support for `split stacks <https://gcc.gnu.org/wiki/SplitStacks>`_.
+
+* Added support for address significance table (section with type
+  SHT_LLVM_ADDRSIG) to improve Identical Code Folding (ICF). Combined with the
+  ``-faddrsig`` compiler option added to Clang 7, lld's ``--icf=all`` can now
+  safely merge functions and data to generate smaller outputs than before.
+
+* Improved ``--gdb-index`` so that it is faster (`r336790
+  <https://reviews.llvm.org/rL336790>`_) and uses less memory (`r336672
+  <https://reviews.llvm.org/rL336672>`_).
+
+* Reduced memory usage of ``--compress-debug-sections`` (`r338913
+  <https://reviews.llvm.org/rL338913>`_).
+
+* Added linker script OVERLAY support (`r335714 <https://reviews.llvm.org/rL335714>`_).
+
+* Added ``--warn-backref`` to make it easy to identify command line option order
+  that doesn't work with GNU linkers (`r329636 <https://reviews.llvm.org/rL329636>`_)
+
+* Added ld.lld.1 man page (`r324512 <https://reviews.llvm.org/rL324512>`_).
+
+* Added support for multi-GOT.
+
+* Added support for MIPS position-independent executable (PIE).
+
 * Fixed MIPS TLS GOT entries for local symbols in shared libraries.
 
-* Fixed calculation of MIPS GP relative relocations
-  in case of relocatable output.
+* Fixed calculation of MIPS GP relative relocations in case of relocatable
+  output.
 
+* Added support for PPCv2 ABI.
+
+* Removed an incomplete support of PPCv1 ABI.
+
+* Added support for Qualcomm Hexagon ISA.
+
+* Added the following flags: ``--apply-dynamic-relocs``, ``--check-sections``,
+  ``--cref``, ``--just-symbols``, ``--keep-unique``,
+  ``--no-allow-multiple-definition``, ``--no-apply-dynamic-relocs``,
+  ``--no-check-sections``, ``--no-gnu-unique, ``--no-pic-executable``,
+  ``--no-undefined-version``, ``--no-warn-common``, ``--pack-dyn-relocs=relr``,
+  ``--pop-state``, ``--print-icf-sections``, ``--push-state``,
+  ``--thinlto-index-only``, ``--thinlto-object-suffix-replace``,
+  ``--thinlto-prefix-replace``, ``--warn-backref``, ``-z combreloc``, ``-z
+  copyreloc``, ``-z initfirst``, ``-z keep-text-section-prefix``, ``-z lazy``,
+  ``-z noexecstack``, ``-z relro``, ``-z retpolineplt``, ``-z text``
+
 COFF Improvements
 -----------------
 
@@ -45,7 +92,11 @@ COFF Improvements
 
 * Improved compatibility of output binaries with GNU binutils objcopy/strip.
 
-MachO Improvements
-------------------
+* Sped up PDB file creation.
 
-* Item 1.
+* Changed section layout to improve compatibility with link.exe.
+
+* Added the following flags: ``--color-diagnostics={always,never,auto}``,
+  ``--no-color-diagnostics``, ``/brepro``, ``/debug:full``, ``/debug:ghash``,
+  ``/guard:cf``, ``/guard:longjmp``, ``/guard:nolongjmp``, ``/integritycheck``,
+  ``/order``, ``/pdbsourcepath``, ``/timestamp``

Modified: vendor/lld/dist-release_70/lib/ReaderWriter/MachO/MachONormalizedFileBinaryUtils.h
==============================================================================
--- vendor/lld/dist-release_70/lib/ReaderWriter/MachO/MachONormalizedFileBinaryUtils.h	Tue Sep 11 10:10:13 2018	(r338582)
+++ vendor/lld/dist-release_70/lib/ReaderWriter/MachO/MachONormalizedFileBinaryUtils.h	Tue Sep 11 10:10:16 2018	(r338583)
@@ -186,11 +186,10 @@ packRelocation(const Relocation &r, bool swap, bool is
 }
 
 inline StringRef getString16(const char s[16]) {
-  StringRef x = s;
-  if ( x.size() > 16 )
-    return x.substr(0, 16);
-  else
-    return x;
+  // The StringRef(const char *) constructor passes the const char * to
+  // strlen(), so we can't use this constructor here, because if there is no
+  // null terminator in s, then strlen() will read past the end of the array.
+  return StringRef(s, strnlen(s, 16));
 }
 
 inline void setString16(StringRef str, char s[16]) {

Modified: vendor/lld/dist-release_70/test/COFF/entry-inference3.test
==============================================================================
--- vendor/lld/dist-release_70/test/COFF/entry-inference3.test	Tue Sep 11 10:10:13 2018	(r338582)
+++ vendor/lld/dist-release_70/test/COFF/entry-inference3.test	Tue Sep 11 10:10:16 2018	(r338583)
@@ -1,7 +1,11 @@
-# RUN: yaml2obj < %s > %t.obj
-# RUN: not lld-link /out:%t.exe %t.obj /verbose /nodefaultlib > %t.log 2>&1
+# RUN: sed -e s/ENTRYNAME/mainCRTStartup/ %s | yaml2obj > %t.obj
+# RUN: lld-link /subsystem:console /out:%t.exe %t.obj /verbose /nodefaultlib > %t.log 2>&1
 # RUN: FileCheck %s < %t.log
 
+# RUN: sed -e s/ENTRYNAME/?mainCRTStartup@@YAHXZ/ %s | yaml2obj > %t.obj
+# RUN: lld-link /subsystem:console /out:%t.exe %t.obj /verbose /nodefaultlib > %t.log 2>&1
+# RUN: FileCheck %s < %t.log
+
 # CHECK: Entry name inferred: mainCRTStartup
 
 --- !COFF
@@ -26,7 +30,7 @@ symbols:
       NumberOfLinenumbers: 0
       CheckSum:        0
       Number:          0
-  - Name:            mainCRTStartup
+  - Name:            "ENTRYNAME"
     Value:           0
     SectionNumber:   1
     SimpleType:      IMAGE_SYM_TYPE_NULL

Added: vendor/lld/dist-release_70/test/COFF/entry-inference332.test
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ vendor/lld/dist-release_70/test/COFF/entry-inference332.test	Tue Sep 11 10:10:16 2018	(r338583)
@@ -0,0 +1,39 @@
+# RUN: sed -e s/ENTRYNAME/_mainCRTStartup/ %s | yaml2obj > %t.obj
+# RUN: lld-link /subsystem:console /out:%t.exe %t.obj /verbose /nodefaultlib > %t.log 2>&1
+# RUN: FileCheck %s < %t.log
+
+# RUN: sed -e s/ENTRYNAME/?mainCRTStartup@@YAHXZ/ %s | yaml2obj > %t.obj
+# RUN: lld-link /subsystem:console /out:%t.exe %t.obj /verbose /nodefaultlib > %t.log 2>&1
+# RUN: FileCheck %s < %t.log
+
+# CHECK: Entry name inferred: _mainCRTStartup
+
+--- !COFF
+header:
+  Machine:         IMAGE_FILE_MACHINE_I386
+  Characteristics: []
+sections:
+  - Name:            .text
+    Characteristics: [ IMAGE_SCN_CNT_CODE, IMAGE_SCN_MEM_EXECUTE, IMAGE_SCN_MEM_READ ]
+    Alignment:       4
+    SectionData:     B82A000000C3
+symbols:
+  - Name:            .text
+    Value:           0
+    SectionNumber:   1
+    SimpleType:      IMAGE_SYM_TYPE_NULL
+    ComplexType:     IMAGE_SYM_DTYPE_NULL
+    StorageClass:    IMAGE_SYM_CLASS_STATIC
+    SectionDefinition:
+      Length:          6
+      NumberOfRelocations: 0
+      NumberOfLinenumbers: 0
+      CheckSum:        0
+      Number:          0
+  - Name:            "ENTRYNAME"
+    Value:           0
+    SectionNumber:   1
+    SimpleType:      IMAGE_SYM_TYPE_NULL
+    ComplexType:     IMAGE_SYM_DTYPE_NULL
+    StorageClass:    IMAGE_SYM_CLASS_EXTERNAL
+...

Added: vendor/lld/dist-release_70/test/COFF/entry-inference4.test
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ vendor/lld/dist-release_70/test/COFF/entry-inference4.test	Tue Sep 11 10:10:16 2018	(r338583)
@@ -0,0 +1,56 @@
+# RUN: sed 's/ENTRY1/WinMain/;s/ENTRY2/main/' %s | yaml2obj > %t.obj
+# RUN: not lld-link /subsystem:windows /out:%t.exe %t.obj > %t.log 2>&1
+# RUN: FileCheck -check-prefix=WINMAIN %s < %t.log
+
+# RUN: sed 's/ENTRY1/wWinMain/;s/ENTRY2/main/' %s | yaml2obj > %t.obj
+# RUN: not lld-link /subsystem:windows /out:%t.exe %t.obj > %t.log 2>&1
+# RUN: FileCheck -check-prefix=WWINMAIN %s < %t.log
+
+# RUN: sed 's/ENTRY1/WinMain/;s/ENTRY2/main/' %s | yaml2obj > %t.obj
+# RUN: not lld-link /subsystem:console /out:%t.exe %t.obj > %t.log 2>&1
+# RUN: FileCheck -check-prefix=MAIN %s < %t.log
+
+# RUN: sed 's/ENTRY1/WinMain/;s/ENTRY2/wmain/' %s | yaml2obj > %t.obj
+# RUN: not lld-link /subsystem:console /out:%t.exe %t.obj > %t.log 2>&1
+# RUN: FileCheck -check-prefix=WMAIN %s < %t.log
+
+# MAIN:     error: <root>: undefined symbol: mainCRTStartup
+# WMAIN:    error: <root>: undefined symbol: wmainCRTStartup
+# WINMAIN:  error: <root>: undefined symbol: WinMainCRTStartup
+# WWINMAIN: error: <root>: undefined symbol: wWinMainCRTStartup
+
+--- !COFF
+header:
+  Machine:         IMAGE_FILE_MACHINE_AMD64
+  Characteristics: []
+sections:
+  - Name:            .text
+    Characteristics: [ IMAGE_SCN_CNT_CODE, IMAGE_SCN_MEM_EXECUTE, IMAGE_SCN_MEM_READ ]
+    Alignment:       4
+    SectionData:     B82A000000C3
+symbols:
+  - Name:            .text
+    Value:           0
+    SectionNumber:   1
+    SimpleType:      IMAGE_SYM_TYPE_NULL
+    ComplexType:     IMAGE_SYM_DTYPE_NULL
+    StorageClass:    IMAGE_SYM_CLASS_STATIC
+    SectionDefinition:
+      Length:          6
+      NumberOfRelocations: 0
+      NumberOfLinenumbers: 0
+      CheckSum:        0
+      Number:          0
+  - Name:            ENTRY1
+    Value:           0
+    SectionNumber:   1
+    SimpleType:      IMAGE_SYM_TYPE_NULL
+    ComplexType:     IMAGE_SYM_DTYPE_NULL
+    StorageClass:    IMAGE_SYM_CLASS_EXTERNAL
+  - Name:            ENTRY2
+    Value:           0
+    SectionNumber:   1
+    SimpleType:      IMAGE_SYM_TYPE_NULL
+    ComplexType:     IMAGE_SYM_DTYPE_NULL
+    StorageClass:    IMAGE_SYM_CLASS_EXTERNAL
+...

Modified: vendor/lld/dist-release_70/test/COFF/guardcf-align.s
==============================================================================
--- vendor/lld/dist-release_70/test/COFF/guardcf-align.s	Tue Sep 11 10:10:13 2018	(r338582)
+++ vendor/lld/dist-release_70/test/COFF/guardcf-align.s	Tue Sep 11 10:10:16 2018	(r338583)
@@ -1,3 +1,4 @@
+# REQUIRES: x86
 # RUN: llvm-mc -triple x86_64-windows-msvc -filetype=obj -o %t.obj %s
 # RUN: yaml2obj < %p/Inputs/guardcf-align-foobar.yaml \
 # RUN:     > %T/guardcf-align-foobar.obj

Added: vendor/lld/dist-release_70/test/COFF/subsystem-inference32.test
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ vendor/lld/dist-release_70/test/COFF/subsystem-inference32.test	Tue Sep 11 10:10:16 2018	(r338583)
@@ -0,0 +1,74 @@
+# RUN: sed -e s/ENTRYNAME/_main/ %s | yaml2obj > %t.obj
+# RUN: lld-link /out:%t.exe %t.obj
+# RUN: llvm-readobj -file-headers %t.exe | FileCheck -check-prefix=MAIN %s
+
+# RUN: sed s/ENTRYNAME/_wmain/ %s | yaml2obj > %t.obj
+# RUN: lld-link /out:%t.exe %t.obj
+# RUN: llvm-readobj -file-headers %t.exe | FileCheck -check-prefix=WMAIN %s
+
+# RUN: sed s/ENTRYNAME/_WinMain@16/ %s | yaml2obj > %t.obj
+# RUN: lld-link /out:%t.exe %t.obj
+# RUN: llvm-readobj -file-headers %t.exe | FileCheck -check-prefix=WINMAIN %s
+
+# RUN: sed s/ENTRYNAME/_wWinMain@16/ %s | yaml2obj > %t.obj
+# RUN: lld-link /out:%t.exe %t.obj
+# RUN: llvm-readobj -file-headers %t.exe | FileCheck -check-prefix=WWINMAIN %s
+
+# MAIN:     Subsystem: IMAGE_SUBSYSTEM_WINDOWS_CUI
+# WMAIN:    Subsystem: IMAGE_SUBSYSTEM_WINDOWS_CUI
+# WINMAIN:  Subsystem: IMAGE_SUBSYSTEM_WINDOWS_GUI
+# WWINMAIN: Subsystem: IMAGE_SUBSYSTEM_WINDOWS_GUI
+
+--- !COFF
+header:
+  Machine:         IMAGE_FILE_MACHINE_I386
+  Characteristics: []
+sections:
+  - Name:            .text
+    Characteristics: [ IMAGE_SCN_CNT_CODE, IMAGE_SCN_MEM_EXECUTE, IMAGE_SCN_MEM_READ ]
+    Alignment:       4
+    SectionData:     B82A000000C3
+symbols:
+  - Name:            .text
+    Value:           0
+    SectionNumber:   1
+    SimpleType:      IMAGE_SYM_TYPE_NULL
+    ComplexType:     IMAGE_SYM_DTYPE_NULL
+    StorageClass:    IMAGE_SYM_CLASS_STATIC
+    SectionDefinition:
+      Length:          6
+      NumberOfRelocations: 0
+      NumberOfLinenumbers: 0
+      CheckSum:        0
+      Number:          0
+  - Name:            ENTRYNAME
+    Value:           0
+    SectionNumber:   1
+    SimpleType:      IMAGE_SYM_TYPE_NULL
+    ComplexType:     IMAGE_SYM_DTYPE_NULL
+    StorageClass:    IMAGE_SYM_CLASS_EXTERNAL
+  - Name:            _mainCRTStartup
+    Value:           0
+    SectionNumber:   1
+    SimpleType:      IMAGE_SYM_TYPE_NULL
+    ComplexType:     IMAGE_SYM_DTYPE_NULL
+    StorageClass:    IMAGE_SYM_CLASS_EXTERNAL
+  - Name:            _wmainCRTStartup
+    Value:           0
+    SectionNumber:   1
+    SimpleType:      IMAGE_SYM_TYPE_NULL
+    ComplexType:     IMAGE_SYM_DTYPE_NULL
+    StorageClass:    IMAGE_SYM_CLASS_EXTERNAL
+  - Name:            _WinMainCRTStartup
+    Value:           0
+    SectionNumber:   1
+    SimpleType:      IMAGE_SYM_TYPE_NULL
+    ComplexType:     IMAGE_SYM_DTYPE_NULL
+    StorageClass:    IMAGE_SYM_CLASS_EXTERNAL
+  - Name:            _wWinMainCRTStartup
+    Value:           0
+    SectionNumber:   1
+    SimpleType:      IMAGE_SYM_TYPE_NULL
+    ComplexType:     IMAGE_SYM_DTYPE_NULL
+    StorageClass:    IMAGE_SYM_CLASS_EXTERNAL
+...

Modified: vendor/lld/dist-release_70/test/ELF/icf13.s
==============================================================================
--- vendor/lld/dist-release_70/test/ELF/icf13.s	Tue Sep 11 10:10:13 2018	(r338582)
+++ vendor/lld/dist-release_70/test/ELF/icf13.s	Tue Sep 11 10:10:16 2018	(r338583)
@@ -1,3 +1,4 @@
+# REQUIRES: x86
 # RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t1
 # RUN: ld.lld -shared -z notext %t1 -o /dev/null --icf=all --print-icf-sections 2>&1 | FileCheck -allow-empty %s
 

Modified: vendor/lld/dist-release_70/test/ELF/icf15.s
==============================================================================
--- vendor/lld/dist-release_70/test/ELF/icf15.s	Tue Sep 11 10:10:13 2018	(r338582)
+++ vendor/lld/dist-release_70/test/ELF/icf15.s	Tue Sep 11 10:10:16 2018	(r338583)
@@ -1,3 +1,4 @@
+# REQUIRES: x86
 # RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t1
 # RUN: ld.lld %t1 -o /dev/null --icf=all --print-icf-sections 2>&1 | FileCheck -allow-empty %s
 

Modified: vendor/lld/dist-release_70/test/ELF/icf16.s
==============================================================================
--- vendor/lld/dist-release_70/test/ELF/icf16.s	Tue Sep 11 10:10:13 2018	(r338582)
+++ vendor/lld/dist-release_70/test/ELF/icf16.s	Tue Sep 11 10:10:16 2018	(r338583)
@@ -1,3 +1,4 @@
+# REQUIRES: x86
 # RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t1
 # RUN: ld.lld -shared -z notext %t1 -o /dev/null --icf=all --print-icf-sections 2>&1 | FileCheck -allow-empty %s
 

Modified: vendor/lld/dist-release_70/test/ELF/icf17.s
==============================================================================
--- vendor/lld/dist-release_70/test/ELF/icf17.s	Tue Sep 11 10:10:13 2018	(r338582)
+++ vendor/lld/dist-release_70/test/ELF/icf17.s	Tue Sep 11 10:10:16 2018	(r338583)
@@ -1,3 +1,4 @@
+# REQUIRES: x86
 # RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t1
 # RUN: ld.lld %t1 -o /dev/null --icf=all --print-icf-sections 2>&1 | FileCheck -allow-empty %s
 

Modified: vendor/lld/dist-release_70/test/ELF/lto/libcall-archive.ll
==============================================================================
--- vendor/lld/dist-release_70/test/ELF/lto/libcall-archive.ll	Tue Sep 11 10:10:13 2018	(r338582)
+++ vendor/lld/dist-release_70/test/ELF/lto/libcall-archive.ll	Tue Sep 11 10:10:16 2018	(r338583)
@@ -1,3 +1,4 @@
+; REQUIRES: x86
 ; RUN: rm -f %t.a
 ; RUN: llvm-as -o %t.o %s
 ; RUN: llvm-as -o %t2.o %S/Inputs/libcall-archive.ll



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201809111010.w8BAAHi0027728>