Date: Mon, 16 Jul 2018 05:35:39 +0000 (UTC) From: Dimitry Andric <dim@FreeBSD.org> 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 Message-ID: <201807160535.w6G5ZdQ1061075@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
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 <class ELFT> std::vector<PhdrEntry *> 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" // <Upstream revision at import>-<Local identifier in __FreeBSD_version style> -#define LLD_REVISION_STRING "326565-1100002" +#define LLD_REVISION_STRING "326565-1100003"
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201807160535.w6G5ZdQ1061075>