From owner-svn-src-stable-11@freebsd.org Mon Jul 16 05:35:40 2018 Return-Path: Delivered-To: svn-src-stable-11@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 A7BBB103F3AF; Mon, 16 Jul 2018 05:35:40 +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 5320C80F4A; Mon, 16 Jul 2018 05:35:40 +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 15AF71861D; Mon, 16 Jul 2018 05:35:40 +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 w6G5ZdJI061076; Mon, 16 Jul 2018 05:35:39 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w6G5ZdQ1061075; Mon, 16 Jul 2018 05:35:39 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201807160535.w6G5ZdQ1061075@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Mon, 16 Jul 2018 05:35:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r336331 - in stable/11: contrib/llvm/tools/lld/ELF lib/clang/include/lld/Common X-SVN-Group: stable-11 X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in stable/11: contrib/llvm/tools/lld/ELF lib/clang/include/lld/Common X-SVN-Commit-Revision: 336331 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Jul 2018 05:35:40 -0000 Author: dim Date: Mon Jul 16 05:35:39 2018 New Revision: 336331 URL: https://svnweb.freebsd.org/changeset/base/336331 Log: MFC r333401 (by emaste): 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: stable/11/contrib/llvm/tools/lld/ELF/Writer.cpp stable/11/lib/clang/include/lld/Common/Version.inc Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/llvm/tools/lld/ELF/Writer.cpp ============================================================================== --- stable/11/contrib/llvm/tools/lld/ELF/Writer.cpp Mon Jul 16 05:33:18 2018 (r336330) +++ stable/11/contrib/llvm/tools/lld/ELF/Writer.cpp Mon Jul 16 05:35:39 2018 (r336331) @@ -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: stable/11/lib/clang/include/lld/Common/Version.inc ============================================================================== --- stable/11/lib/clang/include/lld/Common/Version.inc Mon Jul 16 05:33:18 2018 (r336330) +++ stable/11/lib/clang/include/lld/Common/Version.inc Mon Jul 16 05:35:39 2018 (r336331) @@ -7,4 +7,4 @@ #define LLD_REPOSITORY_STRING "FreeBSD" // - -#define LLD_REVISION_STRING "326565-1100002" +#define LLD_REVISION_STRING "326565-1100003"