]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
MFC r367623:
authorDimitry Andric <dim@FreeBSD.org>
Sun, 15 Nov 2020 11:28:02 +0000 (11:28 +0000)
committerDimitry Andric <dim@FreeBSD.org>
Sun, 15 Nov 2020 11:28:02 +0000 (11:28 +0000)
commitd815b3c42900ea531dd718e40fbe132d9eb9b68e
treeb410dddd472e1381e602d2cb031f5fff9d5c3257
parent304afae1cbe5c4a9b5219dc3217f6c4eb7b0a145
MFC r367623:

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
contrib/llvm-project/lld/ELF/InputSection.h