[all-commits] [llvm/llvm-project] 8df4e6: [ELF] Don't consider SHF_ALLOC ".debug*" sections ...

Fangrui Song via All-commits all-commits at lists.llvm.org
Thu Nov 12 10:00:05 PST 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 8df4e60945fa9efdeab1a2fa2a5cdf22ea9c9112
      https://github.com/llvm/llvm-project/commit/8df4e60945fa9efdeab1a2fa2a5cdf22ea9c9112
  Author: Fangrui Song <i at maskray.me>
  Date:   2020-11-12 (Thu, 12 Nov 2020)

  Changed paths:
    M lld/ELF/InputSection.h
    A lld/test/ELF/gc-sections-strip-debug.s

  Log Message:
  -----------
  [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




More information about the All-commits mailing list