From owner-svn-src-vendor@freebsd.org Sat Feb 24 21:27:56 2018 Return-Path: Delivered-To: svn-src-vendor@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B6C3BF23FB8; Sat, 24 Feb 2018 21:27:56 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BBBFC77E22; Sat, 24 Feb 2018 21:27:55 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A172F2B064; Sat, 24 Feb 2018 21:27:55 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1OLRteY009167; Sat, 24 Feb 2018 21:27:55 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1OLRtXQ009162; Sat, 24 Feb 2018 21:27:55 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201802242127.w1OLRtXQ009162@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 24 Feb 2018 21:27:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r329937 - in vendor/lld/dist-release_60: ELF docs test/ELF X-SVN-Group: vendor X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in vendor/lld/dist-release_60: ELF docs test/ELF X-SVN-Commit-Revision: 329937 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Feb 2018 21:27:57 -0000 Author: dim Date: Sat Feb 24 21:27:54 2018 New Revision: 329937 URL: https://svnweb.freebsd.org/changeset/base/329937 Log: Vendor import of lld release_60 branch r325932: https://llvm.org/svn/llvm-project/lld/branches/release_60@325932 Added: vendor/lld/dist-release_60/test/ELF/relocatable-versioned.s (contents, props changed) Modified: vendor/lld/dist-release_60/ELF/Driver.cpp vendor/lld/dist-release_60/ELF/Options.td vendor/lld/dist-release_60/docs/ReleaseNotes.rst vendor/lld/dist-release_60/test/ELF/pie.s Modified: vendor/lld/dist-release_60/ELF/Driver.cpp ============================================================================== --- vendor/lld/dist-release_60/ELF/Driver.cpp Sat Feb 24 21:27:52 2018 (r329936) +++ vendor/lld/dist-release_60/ELF/Driver.cpp Sat Feb 24 21:27:54 2018 (r329937) @@ -638,7 +638,7 @@ void LinkerDriver::readConfigs(opt::InputArgList &Args Config->Optimize = args::getInteger(Args, OPT_O, 1); Config->OrphanHandling = getOrphanHandling(Args); Config->OutputFile = Args.getLastArgValue(OPT_o); - Config->Pie = Args.hasFlag(OPT_pie, OPT_no_pie, false); + Config->Pie = Args.hasFlag(OPT_pie, OPT_nopie, false); Config->PrintGcSections = Args.hasFlag(OPT_print_gc_sections, OPT_no_print_gc_sections, false); Config->Rpath = getRpath(Args); @@ -1061,7 +1061,12 @@ template void LinkerDriver::link(opt::Inp addReservedSymbols(); // Apply version scripts. - Symtab->scanVersionScript(); + // + // For a relocatable output, version scripts don't make sense, and + // parsing a symbol version string (e.g. dropping "@ver1" from a symbol + // name "foo@ver1") rather do harm, so we don't call this if -r is given. + if (!Config->Relocatable) + Symtab->scanVersionScript(); // Create wrapped symbols for -wrap option. for (auto *Arg : Args.filtered(OPT_wrap)) Modified: vendor/lld/dist-release_60/ELF/Options.td ============================================================================== --- vendor/lld/dist-release_60/ELF/Options.td Sat Feb 24 21:27:52 2018 (r329936) +++ vendor/lld/dist-release_60/ELF/Options.td Sat Feb 24 21:27:54 2018 (r329937) @@ -202,8 +202,6 @@ def no_gnu_unique: F<"no-gnu-unique">, def no_merge_exidx_entries: F<"no-merge-exidx-entries">, HelpText<"Disable merging .ARM.exidx entries">; -def no_pie: F<"no-pie">, HelpText<"Do not create a position independent executable">; - def no_threads: F<"no-threads">, HelpText<"Do not run the linker multi-threaded">; @@ -212,6 +210,8 @@ def no_whole_archive: F<"no-whole-archive">, def noinhibit_exec: F<"noinhibit-exec">, HelpText<"Retain the executable output file whenever it is still usable">; + +def nopie: F<"nopie">, HelpText<"Do not create a position independent executable">; def no_omagic: Flag<["--"], "no-omagic">, MetaVarName<"">, HelpText<"Do not set the text data sections to be writable">; Modified: vendor/lld/dist-release_60/docs/ReleaseNotes.rst ============================================================================== --- vendor/lld/dist-release_60/docs/ReleaseNotes.rst Sat Feb 24 21:27:52 2018 (r329936) +++ vendor/lld/dist-release_60/docs/ReleaseNotes.rst Sat Feb 24 21:27:54 2018 (r329937) @@ -5,17 +5,12 @@ LLD 6.0.0 Release Notes .. contents:: :local: -.. warning:: - These are in-progress notes for the upcoming LLVM 6.0.0 release. - Release notes for previous releases can be found on - `the Download Page `_. - Introduction ============ -This document contains the release notes for the LLD linker, release 6.0.0. -Here we describe the status of LLD, including major improvements -from the previous release. All LLD releases may be downloaded +This document contains the release notes for the lld linker, release 6.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 `_. Non-comprehensive list of changes in this release @@ -24,20 +19,81 @@ Non-comprehensive list of changes in this release ELF Improvements ---------------- -* Item 1. +* A lot of bugs and compatibility issues have been identified and fixed as a + result of people using lld 5.0 as a standard system linker. In particular, + linker script and version script support has significantly improved that + it should be able to handle almost all scripts. +* A mitigation for Spectre v2 has been implemented. If you pass ``-z + retpolineplt``, lld uses RET instruction instead of JMP instruction in PLT. + The option is available for x86 and x86-64. + +* Identical Code Folding (ICF) now de-duplicates .eh_frame entries, so lld now + generates slightly smaller outputs than before when you pass ``--icf=all``. + +* Analysis for ``--as-needed`` is now done after garbage collection. If garbage + collector eliminates all sections that use some library, that library is + eliminated from DT_NEEDED tags. Previously, the analysis ran before garbage + collection. + +* Size of code segment is now always rounded up to page size to make sure that + unused bytes at end of code segment is filled with trap instructions (such + as INT3) instead of zeros. + +* lld is now able to generate Android-style compact dynamic relocation table. + You can turn on the feature by passing ``--pack-dyn-relocs=android``. + +* Debug information is used in more cases when reporting errors. + +* ``--gdb-index`` gets faster than before. + +* String merging is now multi-threaded, which makes ``-O2`` faster. + +* ``--hash-style=both`` is now default instead of ``--hash-style=sysv`` to + match the behavior of recent versions of GNU linkers. + +* ARM PLT entries automatically use short or long variants. + +* lld can now identify and patch a code sequence that triggers AArch64 errata 843419. + Add ``--fix-cortex-a53-843419`` to enable the feature. + +* lld can now generate thunks for out of range thunks. + +* MIPS port now generates all output dynamic relocations using Elf_Rel format only. + +* Added handling of the R_MIPS_26 relocation in case of N32/N64 ABIs and + generating proper PLT entries. + +* The following options have been added: ``--icf=none`` ``-z muldefs`` + ``--plugin-opt`` ``--no-eh-frame-hdr`` ``--no-gdb-index`` + ``--orphan-handling={place,discard,warn,error}`` + ``--pack-dyn-relocs={none,android}`` ``--no-omagic`` + ``--no-print-gc-sections`` ``--ignore-function-address-equality`` ``-z + retpolineplt`` ``--print-icf-sections`` ``--no-pie`` + COFF Improvements ----------------- * A GNU ld style frontend for the COFF linker has been added for MinGW. In MinGW environments, the linker is invoked with GNU ld style parameters; - which LLD previously only supported when used as an ELF linker. When + which lld previously only supported when used as an ELF linker. When a PE/COFF target is chosen, those parameters are rewritten into the lld-link style parameters and the COFF linker is invoked instead. * Initial support for the ARM64 architecture has been added. -MachO Improvements ------------------- +* New ``--version`` flag. -* Item 1. +* Significantly improved support for writing PDB Files. + +* New ``--rsp-quoting`` flag, like ``clang-cl``. + +* ``/manifestuac:no`` no longer incorrectly disables ``/manifestdependency:``. + +* Only write ``.manifest`` files if ``/manifest`` is passed. + +WebAssembly Improvements +------------------------ + +* Initial version of WebAssembly support has landed. You can invoke the + WebAssembly linker by ``wasm-ld``. Modified: vendor/lld/dist-release_60/test/ELF/pie.s ============================================================================== --- vendor/lld/dist-release_60/test/ELF/pie.s Sat Feb 24 21:27:52 2018 (r329936) +++ vendor/lld/dist-release_60/test/ELF/pie.s Sat Feb 24 21:27:54 2018 (r329937) @@ -48,7 +48,7 @@ # CHECK: Type: PT_DYNAMIC ## Check -nopie -# RUN: ld.lld -no-pie %t1.o -o %t2 +# RUN: ld.lld -nopie %t1.o -o %t2 # RUN: llvm-readobj -file-headers -r %t2 | FileCheck %s --check-prefix=NOPIE # NOPIE-NOT: Type: SharedObject Added: vendor/lld/dist-release_60/test/ELF/relocatable-versioned.s ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/lld/dist-release_60/test/ELF/relocatable-versioned.s Sat Feb 24 21:27:54 2018 (r329937) @@ -0,0 +1,9 @@ +# REQUIRES: x86 +# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t1.o +# RUN: ld.lld -o %t2.o -r %t1.o +# RUN: llvm-nm %t2.o | FileCheck %s +# CHECK: foo@VERSION + +.global "foo@VERSION" +"foo@VERSION": + ret