[all-commits] [llvm/llvm-project] 60ce44: [ELF] Refine section group --gc-sections rules to ...

Fangrui Song via All-commits all-commits at lists.llvm.org
Tue Dec 10 09:01:26 PST 2019


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 60ce444eaa146bc2f762c70d433d4a0c847508f0
      https://github.com/llvm/llvm-project/commit/60ce444eaa146bc2f762c70d433d4a0c847508f0
  Author: Fangrui Song <maskray at google.com>
  Date:   2019-12-10 (Tue, 10 Dec 2019)

  Changed paths:
    M lld/ELF/InputFiles.cpp
    A lld/test/ELF/gc-sections-group-debug.s
    M lld/test/ELF/gc-sections-group.s

  Log Message:
  -----------
  [ELF] Refine section group --gc-sections rules to not discard .debug_types

clang/gcc -fdebug-type-sections places .debug_types and
.rela.debug_types in a section group, with a signature symbol which
represents the type signature. The section group is for deduplication
purposes.

After D70146, we will discard such section groups. Refine the rule so
that we will retain the group if no member has the SHF_ALLOC flag.

GNU ld has a similar rule to retain the group if all members have the
SEC_DEBUGGING flag. We try to be more general for future-proof purposes:
if other non-SHF_ALLOC sections have deduplication needs, they may be
placed in a section group. Don't discard them.

Reviewed By: grimar

Differential Revision: https://reviews.llvm.org/D71157




More information about the All-commits mailing list