diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2017-08-20 21:03:55 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2017-08-20 21:03:55 +0000 |
commit | f1f34882c73d8ed4f1be85e7237ed195fb27bd10 (patch) | |
tree | ca4c5aba38f9d71db0547e2d92d90069c0f0693d | |
parent | 9e3ca9b3ba1e0fdf794978cb8c8ae386aad936ad (diff) |
Vendor import of lld release_50 branch r311219:vendor/lld/lld-release_50-r311606vendor/lld/lld-release_50-r311219
Notes
Notes:
svn path=/vendor/lld/dist/; revision=322734
svn path=/vendor/lld/lld-release_50-r311606/; revision=322844; tag=vendor/lld/lld-release_50-r311606
-rw-r--r-- | COFF/Driver.cpp | 6 | ||||
-rw-r--r-- | ELF/Driver.cpp | 2 | ||||
-rw-r--r-- | ELF/Options.td | 4 | ||||
-rw-r--r-- | test/COFF/def-export-stdcall.s | 3 | ||||
-rw-r--r-- | test/COFF/export.test | 5 | ||||
-rw-r--r-- | test/ELF/icf-none.s | 22 |
6 files changed, 35 insertions, 7 deletions
diff --git a/COFF/Driver.cpp b/COFF/Driver.cpp index 6df59e4b08df..854c3e690981 100644 --- a/COFF/Driver.cpp +++ b/COFF/Driver.cpp @@ -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) { diff --git a/ELF/Driver.cpp b/ELF/Driver.cpp index 4630e110bcd8..47a50bb725e7 100644 --- a/ELF/Driver.cpp +++ b/ELF/Driver.cpp @@ -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); diff --git a/ELF/Options.td b/ELF/Options.td index 9c78608118cc..1400a206bdfc 100644 --- a/ELF/Options.td +++ b/ELF/Options.td @@ -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">; diff --git a/test/COFF/def-export-stdcall.s b/test/COFF/def-export-stdcall.s index d7700d9e9535..17473f7f9761 100644 --- a/test/COFF/def-export-stdcall.s +++ b/test/COFF/def-export-stdcall.s @@ -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 diff --git a/test/COFF/export.test b/test/COFF/export.test index e4a094ce6073..174f4ac55d9d 100644 --- a/test/COFF/export.test +++ b/test/COFF/export.test @@ -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 diff --git a/test/ELF/icf-none.s b/test/ELF/icf-none.s new file mode 100644 index 000000000000..671f2085f669 --- /dev/null +++ b/test/ELF/icf-none.s @@ -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 |