From owner-svn-src-vendor@freebsd.org Tue Aug 20 21:35:56 2019 Return-Path: Delivered-To: svn-src-vendor@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E1BF4E167B; Tue, 20 Aug 2019 21:35: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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46CkcX4zG2z45y5; Tue, 20 Aug 2019 21:35:56 +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 8655297CC; Tue, 20 Aug 2019 21:35:56 +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 x7KLZumj006129; Tue, 20 Aug 2019 21:35:56 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7KLZtwV006126; Tue, 20 Aug 2019 21:35:55 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201908202135.x7KLZtwV006126@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Tue, 20 Aug 2019 21:35:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r351312 - in vendor/lld/dist-release_90: COFF ELF docs X-SVN-Group: vendor X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in vendor/lld/dist-release_90: COFF ELF docs X-SVN-Commit-Revision: 351312 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.29 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: Tue, 20 Aug 2019 21:35:57 -0000 Author: dim Date: Tue Aug 20 21:35:55 2019 New Revision: 351312 URL: https://svnweb.freebsd.org/changeset/base/351312 Log: Vendor import of lld release_90 branch r369369: https://llvm.org/svn/llvm-project/lld/branches/release_90@369369 Modified: vendor/lld/dist-release_90/COFF/Driver.cpp vendor/lld/dist-release_90/COFF/Writer.cpp vendor/lld/dist-release_90/ELF/SyntheticSections.cpp vendor/lld/dist-release_90/docs/ReleaseNotes.rst Modified: vendor/lld/dist-release_90/COFF/Driver.cpp ============================================================================== --- vendor/lld/dist-release_90/COFF/Driver.cpp Tue Aug 20 21:35:53 2019 (r351311) +++ vendor/lld/dist-release_90/COFF/Driver.cpp Tue Aug 20 21:35:55 2019 (r351312) @@ -184,8 +184,10 @@ void LinkerDriver::addBuffer(std::unique_ptr file = CHECK(Archive::create(mbref), filename + ": failed to parse archive"); + Archive *archive = file.get(); + make>(std::move(file)); // take ownership - for (MemoryBufferRef m : getArchiveMembers(file.get())) + for (MemoryBufferRef m : getArchiveMembers(archive)) addArchiveBuffer(m, "", filename, 0); return; } Modified: vendor/lld/dist-release_90/COFF/Writer.cpp ============================================================================== --- vendor/lld/dist-release_90/COFF/Writer.cpp Tue Aug 20 21:35:53 2019 (r351311) +++ vendor/lld/dist-release_90/COFF/Writer.cpp Tue Aug 20 21:35:55 2019 (r351312) @@ -762,6 +762,28 @@ void Writer::locateImportTables() { } } +// Return whether a SectionChunk's suffix (the dollar and any trailing +// suffix) should be removed and sorted into the main suffixless +// PartialSection. +static bool shouldStripSectionSuffix(SectionChunk *sc, StringRef name) { + // On MinGW, comdat groups are formed by putting the comdat group name + // after the '$' in the section name. For .eh_frame$, that must + // still be sorted before the .eh_frame trailer from crtend.o, thus just + // strip the section name trailer. For other sections, such as + // .tls$$ (where non-comdat .tls symbols are otherwise stored in + // ".tls$"), they must be strictly sorted after .tls. And for the + // hypothetical case of comdat .CRT$XCU, we definitely need to keep the + // suffix for sorting. Thus, to play it safe, only strip the suffix for + // the standard sections. + if (!config->mingw) + return false; + if (!sc || !sc->isCOMDAT()) + return false; + return name.startswith(".text$") || name.startswith(".data$") || + name.startswith(".rdata$") || name.startswith(".pdata$") || + name.startswith(".xdata$") || name.startswith(".eh_frame$"); +} + // Create output section objects and add them to OutputSections. void Writer::createSections() { // First, create the builtin sections. @@ -807,10 +829,7 @@ void Writer::createSections() { continue; } StringRef name = c->getSectionName(); - // On MinGW, comdat groups are formed by putting the comdat group name - // after the '$' in the section name. Such a section name suffix shouldn't - // imply separate alphabetical sorting of those section chunks though. - if (config->mingw && sc && sc->isCOMDAT()) + if (shouldStripSectionSuffix(sc, name)) name = name.split('$').first; PartialSection *pSec = createPartialSection(name, c->getOutputCharacteristics()); @@ -1075,6 +1094,13 @@ Optional Writer::createSymbol(Defined * break; } } + + // Symbols that are runtime pseudo relocations don't point to the actual + // symbol data itself (as they are imported), but points to the IAT entry + // instead. Avoid emitting them to the symbol table, as they can confuse + // debuggers. + if (def->isRuntimePseudoReloc) + return None; StringRef name = def->getName(); if (name.size() > COFF::NameSize) { Modified: vendor/lld/dist-release_90/ELF/SyntheticSections.cpp ============================================================================== --- vendor/lld/dist-release_90/ELF/SyntheticSections.cpp Tue Aug 20 21:35:53 2019 (r351311) +++ vendor/lld/dist-release_90/ELF/SyntheticSections.cpp Tue Aug 20 21:35:55 2019 (r351312) @@ -3177,11 +3177,23 @@ static bool isDuplicateArmExidxSec(InputSection *prev, // The .ARM.exidx table must be sorted in ascending order of the address of the // functions the table describes. Optionally duplicate adjacent table entries -// can be removed. At the end of the function the ExecutableSections must be +// can be removed. At the end of the function the executableSections must be // sorted in ascending order of address, Sentinel is set to the InputSection // with the highest address and any InputSections that have mergeable // .ARM.exidx table entries are removed from it. void ARMExidxSyntheticSection::finalizeContents() { + if (script->hasSectionsCommand) { + // The executableSections and exidxSections that we use to derive the + // final contents of this SyntheticSection are populated before the + // linker script assigns InputSections to OutputSections. The linker script + // SECTIONS command may have a /DISCARD/ entry that removes executable + // InputSections and their dependent .ARM.exidx section that we recorded + // earlier. + auto isDiscarded = [](const InputSection *isec) { return !isec->isLive(); }; + llvm::erase_if(executableSections, isDiscarded); + llvm::erase_if(exidxSections, isDiscarded); + } + // Sort the executable sections that may or may not have associated // .ARM.exidx sections by order of ascending address. This requires the // relative positions of InputSections to be known. Modified: vendor/lld/dist-release_90/docs/ReleaseNotes.rst ============================================================================== --- vendor/lld/dist-release_90/docs/ReleaseNotes.rst Tue Aug 20 21:35:53 2019 (r351311) +++ vendor/lld/dist-release_90/docs/ReleaseNotes.rst Tue Aug 20 21:35:55 2019 (r351312) @@ -28,6 +28,15 @@ ELF Improvements ``$ ld.lld --call-shared`` now prints ``unknown argument '--call-shared', did you mean '--call_shared'``. +* lld now supports replacing ``JAL`` with ``JALX`` instructions in case + of MIPS - microMIPS cross-mode jumps. + +* lld now creates LA25 thunks for MIPS R6 code. + +* Put MIPS-specific .reginfo, .MIPS.options, and .MIPS.abiflags sections + into corresponding PT_MIPS_REGINFO, PT_MIPS_OPTIONS, and PT_MIPS_ABIFLAGS + segments. + * ... COFF Improvements @@ -53,6 +62,14 @@ COFF Improvements * Several speed and memory usage improvements. +* Range extension thunks are now created for ARM64, if needed + +* lld-link now supports resource object files created by GNU windres and + MS cvtres, not only llvm-cvtres + +* The generated thunks for delayimports now share the majority of code + among thunks, significantly reducing the overhead of using delayimport + * ... MinGW Improvements @@ -61,6 +78,17 @@ MinGW Improvements * lld now correctly links crtend.o as the last object file, handling terminators for the sections such as .eh_frame properly, fixing DWARF exception handling with libgcc and gcc's crtend.o. + +* lld now also handles DWARF unwind info generated by GCC, when linking + with libgcc + +* Many more GNU ld options are now supported, which e.g. allows the lld + MinGW frontend to be called by GCC + +* PDB output can be requested without manually specifying the PDB file + name, with the new option ``-pdb=`` with an empty value to the option. + (The old existing syntax ``-pdb `` was more cumbersome to use + with an empty parameter value.) MachO Improvements ------------------