Date: Thu, 12 Nov 2020 19:25:31 +0000 (UTC) From: Dimitry Andric <dim@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367623 - head/contrib/llvm-project/lld/ELF Message-ID: <202011121925.0ACJPVvU059103@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: dim Date: Thu Nov 12 19:25:31 2020 New Revision: 367623 URL: https://svnweb.freebsd.org/changeset/base/367623 Log: Merge commit 8df4e6094 from llvm git (by Fangrui Song): [ELF] Don't consider SHF_ALLOC ".debug*" sections debug sections Fixes PR48071 * The Rust compiler produces SHF_ALLOC `.debug_gdb_scripts` (which normally does not have the flag) * `.debug_gdb_scripts` sections are removed from `inputSections` due to --strip-debug/--strip-all * When processing --gc-sections, pieces of a SHF_MERGE section can be marked live separately `=>` segfault when marking liveness of a `.debug_gdb_scripts` which is not split into pieces (because it is not in `inputSections`) This patch circumvents the problem by not treating SHF_ALLOC ".debug*" as debug sections (to prevent --strip-debug's stripping) (which is still useful on its own). Reviewed By: grimar Differential Revision: https://reviews.llvm.org/D91291 This should fix lld segfaulting when linking the rust-based parts of the devel/py-maturin port. Reported by: Nick Venenga <nijave@gmail.com> PR: 250783 MFC after: 3 days Modified: head/contrib/llvm-project/lld/ELF/InputSection.h Modified: head/contrib/llvm-project/lld/ELF/InputSection.h ============================================================================== --- head/contrib/llvm-project/lld/ELF/InputSection.h Thu Nov 12 18:24:37 2020 (r367622) +++ head/contrib/llvm-project/lld/ELF/InputSection.h Thu Nov 12 19:25:31 2020 (r367623) @@ -391,7 +391,8 @@ class InputSection : public InputSectionBase { (privat }; inline bool isDebugSection(const InputSectionBase &sec) { - return sec.name.startswith(".debug") || sec.name.startswith(".zdebug"); + return (sec.flags & llvm::ELF::SHF_ALLOC) == 0 && + (sec.name.startswith(".debug") || sec.name.startswith(".zdebug")); } // The list of all input sections.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202011121925.0ACJPVvU059103>