From owner-svn-src-head@freebsd.org Wed May 9 11:17:02 2018 Return-Path: Delivered-To: svn-src-head@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 A172AFB4248; Wed, 9 May 2018 11:17:02 +0000 (UTC) (envelope-from emaste@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 464A9857F4; Wed, 9 May 2018 11:17:02 +0000 (UTC) (envelope-from emaste@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 28A5310BB7; Wed, 9 May 2018 11:17:02 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w49BH1NB086401; Wed, 9 May 2018 11:17:01 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w49BH13T086399; Wed, 9 May 2018 11:17:01 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201805091117.w49BH13T086399@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 9 May 2018 11:17:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333401 - in head: contrib/llvm/tools/lld/ELF lib/clang/include/lld/Common X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: in head: contrib/llvm/tools/lld/ELF lib/clang/include/lld/Common X-SVN-Commit-Revision: 333401 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 May 2018 11:17:02 -0000 Author: emaste Date: Wed May 9 11:17:01 2018 New Revision: 333401 URL: https://svnweb.freebsd.org/changeset/base/333401 Log: lld: Omit PT_NOTE for SHT_NOTE without SHF_ALLOC A non-alloc note section should not have a PT_NOTE program header. Found while linking ghc (Haskell compiler) with lld on FreeBSD. Haskell emits a .debug-ghc-link-info note section (as the name suggests, it contains link info) as a SHT_NOTE section without SHF_ALLOC set. For this case ld.bfd does not emit a PT_NOTE segment for .debug-ghc-link-info. lld previously emitted a PT_NOTE with p_vaddr = 0 and FreeBSD's rtld segfaulted when trying to parse a note at address 0. LLVM PR: https://llvm.org/pr37361 LLVM review: https://reviews.llvm.org/D46623 PR: 226872 Reviewed by: dim Sponsored by: The FreeBSD Foundation Modified: head/contrib/llvm/tools/lld/ELF/Writer.cpp head/lib/clang/include/lld/Common/Version.inc Modified: head/contrib/llvm/tools/lld/ELF/Writer.cpp ============================================================================== --- head/contrib/llvm/tools/lld/ELF/Writer.cpp Wed May 9 10:50:51 2018 (r333400) +++ head/contrib/llvm/tools/lld/ELF/Writer.cpp Wed May 9 11:17:01 2018 (r333401) @@ -1708,7 +1708,7 @@ template std::vector Writer< // Create one PT_NOTE per a group of contiguous .note sections. PhdrEntry *Note = nullptr; for (OutputSection *Sec : OutputSections) { - if (Sec->Type == SHT_NOTE) { + if (Sec->Type == SHT_NOTE && (Sec->Flags & SHF_ALLOC)) { if (!Note || Sec->LMAExpr) Note = AddHdr(PT_NOTE, PF_R); Note->add(Sec); Modified: head/lib/clang/include/lld/Common/Version.inc ============================================================================== --- head/lib/clang/include/lld/Common/Version.inc Wed May 9 10:50:51 2018 (r333400) +++ head/lib/clang/include/lld/Common/Version.inc Wed May 9 11:17:01 2018 (r333401) @@ -7,4 +7,4 @@ #define LLD_REPOSITORY_STRING "FreeBSD" // - -#define LLD_REVISION_STRING "326565-1200001" +#define LLD_REVISION_STRING "326565-1200002"