Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 20 Aug 2017 21:03:55 +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: r322734 - in vendor/lld/dist: COFF ELF test/COFF test/ELF
Message-ID:  <201708202103.v7KL3t98015740@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: dim
Date: Sun Aug 20 21:03:55 2017
New Revision: 322734
URL: https://svnweb.freebsd.org/changeset/base/322734

Log:
  Vendor import of lld release_50 branch r311219:
  https://llvm.org/svn/llvm-project/lld/branches/release_50@311219

Added:
  vendor/lld/dist/test/ELF/icf-none.s   (contents, props changed)
Modified:
  vendor/lld/dist/COFF/Driver.cpp
  vendor/lld/dist/ELF/Driver.cpp
  vendor/lld/dist/ELF/Options.td
  vendor/lld/dist/test/COFF/def-export-stdcall.s
  vendor/lld/dist/test/COFF/export.test

Modified: vendor/lld/dist/COFF/Driver.cpp
==============================================================================
--- vendor/lld/dist/COFF/Driver.cpp	Sun Aug 20 21:03:52 2017	(r322733)
+++ vendor/lld/dist/COFF/Driver.cpp	Sun Aug 20 21:03:55 2017	(r322734)
@@ -458,8 +458,8 @@ static void createImportLibrary(bool AsLib) {
   std::vector<COFFShortExport> Exports;
   for (Export &E1 : Config->Exports) {
     COFFShortExport E2;
-    // Use SymbolName, which will have any stdcall or fastcall qualifiers.
-    E2.Name = E1.SymbolName;
+    E2.Name = E1.Name;
+    E2.SymbolName = E1.SymbolName;
     E2.ExtName = E1.ExtName;
     E2.Ordinal = E1.Ordinal;
     E2.Noname = E1.Noname;
@@ -470,7 +470,7 @@ static void createImportLibrary(bool AsLib) {
   }
 
   writeImportLibrary(getImportName(AsLib), getImplibPath(), Exports,
-                     Config->Machine);
+                     Config->Machine, false);
 }
 
 static void parseModuleDefs(StringRef Path) {

Modified: vendor/lld/dist/ELF/Driver.cpp
==============================================================================
--- vendor/lld/dist/ELF/Driver.cpp	Sun Aug 20 21:03:52 2017	(r322733)
+++ vendor/lld/dist/ELF/Driver.cpp	Sun Aug 20 21:03:55 2017	(r322734)
@@ -638,7 +638,7 @@ void LinkerDriver::readConfigs(opt::InputArgList &Args
   Config->Fini = Args.getLastArgValue(OPT_fini, "_fini");
   Config->GcSections = getArg(Args, OPT_gc_sections, OPT_no_gc_sections, false);
   Config->GdbIndex = Args.hasArg(OPT_gdb_index);
-  Config->ICF = Args.hasArg(OPT_icf);
+  Config->ICF = getArg(Args, OPT_icf_all, OPT_icf_none, false);
   Config->Init = Args.getLastArgValue(OPT_init, "_init");
   Config->LTOAAPipeline = Args.getLastArgValue(OPT_lto_aa_pipeline);
   Config->LTONewPmPasses = Args.getLastArgValue(OPT_lto_newpm_passes);

Modified: vendor/lld/dist/ELF/Options.td
==============================================================================
--- vendor/lld/dist/ELF/Options.td	Sun Aug 20 21:03:52 2017	(r322733)
+++ vendor/lld/dist/ELF/Options.td	Sun Aug 20 21:03:55 2017	(r322734)
@@ -126,7 +126,9 @@ def hash_style: S<"hash-style">,
 
 def help: F<"help">, HelpText<"Print option help">;
 
-def icf: F<"icf=all">, HelpText<"Enable identical code folding">;
+def icf_all: F<"icf=all">, HelpText<"Enable identical code folding">;
+
+def icf_none: F<"icf=none">, HelpText<"Disable identical code folding">;
 
 def image_base : J<"image-base=">, HelpText<"Set the base address">;
 

Modified: vendor/lld/dist/test/COFF/def-export-stdcall.s
==============================================================================
--- vendor/lld/dist/test/COFF/def-export-stdcall.s	Sun Aug 20 21:03:52 2017	(r322733)
+++ vendor/lld/dist/test/COFF/def-export-stdcall.s	Sun Aug 20 21:03:55 2017	(r322734)
@@ -2,7 +2,8 @@
 # RUN: llvm-mc -filetype=obj -triple=i686-windows-msvc %s -o %t.obj
 # RUN: echo -e "LIBRARY foo\nEXPORTS\n  stdcall" > %t.def
 # RUN: lld-link -entry:dllmain -dll -def:%t.def %t.obj -out:%t.dll -implib:%t.lib
-# RUN: llvm-nm %t.lib | FileCheck %s
+# RUN: llvm-readobj %t.lib | FileCheck %s
+# CHECK: Name type: undecorate
 # CHECK: __imp__stdcall@8
 # CHECK: _stdcall@8
 

Modified: vendor/lld/dist/test/COFF/export.test
==============================================================================
--- vendor/lld/dist/test/COFF/export.test	Sun Aug 20 21:03:52 2017	(r322733)
+++ vendor/lld/dist/test/COFF/export.test	Sun Aug 20 21:03:55 2017	(r322734)
@@ -39,8 +39,9 @@ CHECK3-NEXT:       4        0
 CHECK3-NEXT:       5   0x1008
 CHECK3-NEXT:       6   0x1010  exportfn2
 
-# RUN: lld-link /out:%t.dll /dll %t.obj /export:f1=exportfn1 /export:f2=exportfn2
+# RUN: lld-link /out:%t.dll /dll %t.obj /export:f1=exportfn1 /export:f2=exportfn2 /implib:%t.lib
 # RUN: llvm-objdump -p %t.dll | FileCheck -check-prefix=CHECK4 %s
+# RUN: llvm-nm %t.lib | FileCheck -check-prefix=CHECK4-NM %s
 
 CHECK4:      Export Table:
 CHECK4:      DLL name: export.test.tmp.dll
@@ -49,6 +50,8 @@ CHECK4-NEXT:       0        0
 CHECK4-NEXT:       1   0x1010  exportfn3
 CHECK4-NEXT:       2   0x1008  f1
 CHECK4-NEXT:       3   0x1010  f2
+CHECK4-NM: 00000000 T f1
+CHECK4-NM: 00000000 T f2
 
 # RUN: echo "EXPORTS exportfn1 @3" > %t.def
 # RUN: echo "fn2=exportfn2 @2" >> %t.def

Added: vendor/lld/dist/test/ELF/icf-none.s
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ vendor/lld/dist/test/ELF/icf-none.s	Sun Aug 20 21:03:55 2017	(r322734)
@@ -0,0 +1,22 @@
+# REQUIRES: x86
+
+# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t
+# RUN: ld.lld %t -o %t2 --icf=all --icf=none --verbose | FileCheck %s
+
+# CHECK-NOT: selected .text.f1
+
+.globl _start, f1, f2
+_start:
+  ret
+
+.section .text.f1, "ax"
+f1:
+  mov $60, %rax
+  mov $42, %rdi
+  syscall
+
+.section .text.f2, "ax"
+f2:
+  mov $60, %rax
+  mov $42, %rdi
+  syscall



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